- cmd = "%(create)s%(gohome)s rm -f %(pidfile)s ; %(sudo)s nohup bash -c %(command)s " % {
- 'command' : shell_escape(daemon_command),
- 'sudo' : 'sudo -S' if sudo else '',
- 'pidfile' : shell_escape(pidfile),
- 'gohome' : 'cd %s ; ' % (shell_escape(home),) if home else '',
- 'create' : 'mkdir -p %s ; ' % (shell_escape(home),) if create_home and home else '',
- }
-
- (out,err),proc = rexec(
+ cmd = "{create}{gohome} rm -f {pidfile} ; {sudo} nohup bash -c {command} "\
+ .format(command = shell_escape(daemon_command),
+ sudo = 'sudo -S' if sudo else '',
+ pidfile = shell_escape(pidfile),
+ gohome = 'cd {} ; '.format(shell_escape(home)) if home else '',
+ create = 'mkdir -p {} ; '.format(shell_escape(home)) if create_home and home else '')
+
+ (out, err), proc = rexec(