Skip to content

Issue with setenforce Permissive command in installvm.py script  #9

Description

@vpuliyal

@PraveenPenguin I setup my dhcp and tftp servers on my lpar. I ran installvm.py script with below arguments and within 5 seconds run was completed.

[root@lktul installpowervm]# python3.7 -u installvm.py --host-ip 9.40.200.xxx --host-name linuxci-lpar1.aus.stglabs.ibm.com --host-gw 9.40.200.1 --host-netmask 255.255.255.0 --host-mac 9a:9e:c4:11:ad:02 --lpar-hmc perfpxxxxx.aus.stglabs.ibm.com --lpar-managed-system perfrainxxxxx --lpar-partition-name linuxci-lpar1 --distro rhel_8.6le_ga --host-disk=nvme-eui.36455630528016980025384100000002 --hmc-profile default_profile --hmc-userid hscroot --hmc-password xxxxxxxxxxxxx
[root@lktul installpowervm]# ls
installvm.conf installvm.py lib LICENSE log README.md
[root@lktul installpowervm]# cd log/
[root@lktul log]# ls

[root@lktul log]# cd ..

I debug the issue and issue with setenforce Permissive command in installvm.py script.

[root@cihttp rhel]# setenforce Permissive
setenforce: SELinux is disabled
[root@cihttp rhel]# echo $?
1
[root@cihttp rhel]# setenforce Permissive
setenforce: SELinux is disabled
[root@cihttp rhel]# echo $?
1

$? gives you the return value from the last run command. In this case, since SELinux is already disabled, running setenforce Permissive wouldn't go through as it's not needed. I think your script should be handling this case gracefully. It should first check the status of SELinux and then only run these commands if needed.

I've commented below lines in installvm.py script and started now it is working fine. But log files are not showing in log dir.
#cmd = 'setenforce Permissive'
#self.runCommand(self.dhcpSrvCon, cmd)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions