Avoid changing user for daemonize. Just stick to the basics.

This commit is contained in:
Gav Wood 2016-02-18 13:54:18 +01:00
parent 7f2acedf9f
commit c6bcd464c2

View File

@ -58,7 +58,7 @@ Parity. Ethereum Client.
Copyright 2015, 2016 Ethcore (UK) Limited
Usage:
parity daemon [options] [ --no-bootstrap | <enode>... ]
parity daemon <pid_file> [options] [ --no-bootstrap | <enode>... ]
parity [options] [ --no-bootstrap | <enode>... ]
Options:
@ -187,17 +187,9 @@ impl Configuration {
return;
}
if self.args.cmd_daemon {
let daemonize = Daemonize::new()
.pid_file("/tmp/parity.pid") // Every method except `new` and `start`
.chown_pid_file(true) // is optional, see `Daemonize` documentation
.working_directory("/tmp") // for default behaviour.
.user("nobody")
.group("daemon") // Group name
.group(2) // Or group id
.privileged_action(|| "Executed before drop privileges");
let daemonize = Daemonize::new().pid_file(self.args.arg_pid_file.clone()).chown_pid_file(true);
match daemonize.start() {
Ok(_) => info!("Success, daemonized"),
Ok(_) => info!("Daemonized"),
Err(e) => { error!("{}", e); return; },
}
}