Change in vdsm[master]: vdsmd.init: Add init adapter

zhshzhou at linux.vnet.ibm.com zhshzhou at linux.vnet.ibm.com
Fri Jun 14 08:47:46 UTC 2013


Zhou Zheng Sheng has posted comments on this change.

Change subject: vdsmd.init: Add init adapter
......................................................................


Patch Set 1: (3 inline comments)

....................................................
File vdsm/init/daemonAdapter
Line 38:                         help='Ajust nice according to configuration file')
Line 39:     parser.add_argument('-r', '--respawn-pid-file', dest='respawnPidFile',
Line 40:                         default=None, metavar='respawn_pid_file_path',
Line 41:                         help='Run with respawn watchdog protection and '
Line 42:                              'specify the respawn pid file path')
OK. So we can add --pidfile= parameter to daemon adapter and VDSM, and daemon adapter will passthru this parameter to VDSM. If VDSM is called without --pidfile=, it does not create pidfile. And we leave the the downstream init scripts take care of creating empty pidfiles.
Line 43:     args = parser.parse_args(sys.argv[1:])
Line 44:     return args
Line 45: 
Line 46: if __name__ == '__main__':


Line 62:         os.setgid(userPw.pw_gid)
Line 63:         os.setuid(userPw.pw_uid)
Line 64: 
Line 65:     cmd = []
Line 66:     if args.respawnPidFile:
Done
Line 67:         cmd += [os.path.join(P_VDSM, 'respawn'), '--minlifetime', '10',
Line 68:                 '--daemon', '--masterpid', args.respawnPidFile]
Line 69: 
Line 70:     cmd.append(os.path.join(P_VDSM, 'vdsm'))


....................................................
File vdsm/vdsmd.service.in
Line 6: 
Line 7: [Service]
Line 8: Type=simple
Line 9: EnvironmentFile=-/etc/sysconfig/vdsm
Line 10: ExecStartPre=@VDSMDIR@/init/run_task.sh pre-start "run_init_hooks gencerts libvirt_reconfigure syslog_available nwfilter dummybr load_needed_modules tune_system mkdirs test_space test_lo test_conflicting_conf"
Debian's sysv init script can be different from Red Hat family's sysv init script. If I moved some tasks to vdsmd.init.in which is for RH family, I have to copy the task code to Debian's vdsmd init script. So I think the some tasks can be put in a common place that all init systems with different abilities and boilerplate can selectively invoke them. The most flexible way is to have downstream init wrappers name the tasks themselves. I think using --exclude "abc def" is good enough to avoid long lists.
Line 11: ExecStart=@PYTHON@ @VDSMDIR@/init/daemonAdapter -u vdsm -n
Line 12: ExecStopPost=@VDSMDIR@/init/run_task.sh post-stop "run_final_hooks"
Line 13: KillMode=process
Line 14: Restart=always


-- 
To view, visit http://gerrit.ovirt.org/15578
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id8e514df1ca88500f746242134ddb24c31588046
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
Gerrit-Reviewer: Alon Bar-Lev <alonbl at redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw at linux.vnet.ibm.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server


More information about the vdsm-patches mailing list