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

Alon Bar-Lev alonbl at redhat.com
Fri Jun 14 06:46:20 UTC 2013


Alon Bar-Lev 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')
or add --pidfile= to vdsm, better positive than negative... and default is existing file for strange compatibility (if we want that), and we set it to /dev/null if not required.

I don't think this is required for backward compatibility as the services are also upgraded and nothing use vdsm directly.

So we can have standard --pidfile= parameter, if exists write to this file.

I still cannot understand how can it create the file at /var/run if it was not created first by root and chown.
Line 43:     args = parser.parse_args(sys.argv[1:])
Line 44:     return args
Line 45: 
Line 46: if __name__ == '__main__':


Line 51:             os.nice(config.getint('vars', 'vdsm_nice'))
Line 52:         except OSError as e:
Line 53:             sys.stderr.write("daemon adapter: failed to renice, %s" % e)
Line 54: 
Line 55:     if args.user is not None:
-X for ~50ms is not really extreme...
Line 56:         userPw = pwd.getpwnam(args.user)
Line 57:         os.environ.update({
Line 58:             'LOGNAME': userPw.pw_name,
Line 59:             'USER': userPw.pw_name,


Line 84:     os.open("/dev/null", os.O_WRONLY)
Line 85:     os.close(2)
Line 86:     os.open("/dev/null", os.O_WRONLY)
Line 87: 
Line 88:     os.execve(cmd[0], cmd, env)
Great! so we have a solution.

Thanks!


-- 
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