Royce Lv has uploaded a new change for review.
Change subject: [WIP]normalize startup: start supervdsm when startup ......................................................................
[WIP]normalize startup: start supervdsm when startup
start vdsm as root, after restart supervdsm, drop previledge to begin normal start flow
Change-Id: I23d9c4f4cd13f92e820a1a261fc4bbacb0f7d55a Signed-off-by: Royce Lvlvroyce@linux.vnet.ibm.com --- M vdsm/vdsm M vdsm/vdsmd.init.in 2 files changed, 15 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/10708/1
diff --git a/vdsm/vdsm b/vdsm/vdsm index 4746a0f..3c37b26 100755 --- a/vdsm/vdsm +++ b/vdsm/vdsm @@ -23,6 +23,8 @@ from vdsm import constants import zombieReaper import dsaversion +from supervdsm import restartSuperVdsm + if sys.version_info[0] == 2: # as long as we work with Python 2, we need to monkey-patch threading # module before it is ever used. @@ -139,9 +141,20 @@ syslog.syslog("VDSM failed to start: vdsm user is not in KVM group") sys.exit(1)
+ +def dropPrivileges(): + if os.getuid() != 0: + sys.exit(1) + vdsm_uid, vdsm_gid = pwd.getpwnam(constants.VDSM_USER)[2:4:] + + os.setgroups([]) + os.setgid(vdsm_gid) + os.setuid(vdsm_uid) + if __name__ == '__main__': + restartSuperVdsm() + dropPrivileges() __assertVdsmUser() __assertLogPermission() - os.setpgrp() parse_args() run() diff --git a/vdsm/vdsmd.init.in b/vdsm/vdsmd.init.in index c8223d3..a4a75b5 100755 --- a/vdsm/vdsmd.init.in +++ b/vdsm/vdsmd.init.in @@ -499,7 +499,7 @@
LIBVIRT_LOG_FILTERS=`$GETCONFITEM $CONF_FILE vars libvirt_log_filters "1:libvirt 1:remote"` \ LIBVIRT_LOG_OUTPUTS=`$GETCONFITEM $CONF_FILE vars libvirt_log_outputs "1:file:/var/log/vdsm/libvirt.log"` \ - LC_ALL=C NICELEVEL=$vdsm_nice daemon --user=vdsm @VDSMDIR@/respawn --minlifetime 10 --daemon --masterpid $RESPAWNPIDFILE $VDSM_BIN + LC_ALL=C NICELEVEL=$vdsm_nice daemon @VDSMDIR@/respawn --minlifetime 10 --daemon --masterpid $RESPAWNPIDFILE $VDSM_BIN RETVAL=$? [ "$RETVAL" -eq 0 ] && log_success_msg $"$prog start" || log_failure_msg $"$prog start" [ "$RETVAL" -eq 0 ] && touch /var/lock/subsys/vdsmd
-- To view, visit http://gerrit.ovirt.org/10708 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: I23d9c4f4cd13f92e820a1a261fc4bbacb0f7d55a Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Royce Lv lvroyce@linux.vnet.ibm.com
oVirt Jenkins CI Server has posted comments on this change.
Change subject: [WIP]normalize startup: start supervdsm when startup ......................................................................
Patch Set 1:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/620/ (1/2)
-- To view, visit http://gerrit.ovirt.org/10708 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I23d9c4f4cd13f92e820a1a261fc4bbacb0f7d55a Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: [WIP]normalize startup: start supervdsm when startup ......................................................................
Patch Set 1:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/585/ (2/2)
-- To view, visit http://gerrit.ovirt.org/10708 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I23d9c4f4cd13f92e820a1a261fc4bbacb0f7d55a Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: [WIP]normalize startup: start supervdsm when startup ......................................................................
Patch Set 1: Fails
Build Failed
http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/620/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/585/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/10708 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I23d9c4f4cd13f92e820a1a261fc4bbacb0f7d55a Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: [WIP]normalize startup: start supervdsm when startup ......................................................................
Patch Set 2:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/625/ (1/2)
-- To view, visit http://gerrit.ovirt.org/10708 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I23d9c4f4cd13f92e820a1a261fc4bbacb0f7d55a Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: [WIP]normalize startup: start supervdsm when startup ......................................................................
Patch Set 2:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/590/ (2/2)
-- To view, visit http://gerrit.ovirt.org/10708 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I23d9c4f4cd13f92e820a1a261fc4bbacb0f7d55a Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: [WIP]normalize startup: start supervdsm when startup ......................................................................
Patch Set 2:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/625/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/590/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/10708 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I23d9c4f4cd13f92e820a1a261fc4bbacb0f7d55a Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Royce Lv has abandoned this change.
Change subject: [WIP]normalize startup: start supervdsm when startup ......................................................................
Patch Set 2: Abandoned
-- To view, visit http://gerrit.ovirt.org/10708 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: abandon Gerrit-Change-Id: I23d9c4f4cd13f92e820a1a261fc4bbacb0f7d55a Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Yaniv Bronhaim ybronhei@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
vdsm-patches@lists.fedorahosted.org