Avoid changing user for daemonize. Just stick to the basics.
This commit is contained in:
parent
7f2acedf9f
commit
c6bcd464c2
@ -58,7 +58,7 @@ Parity. Ethereum Client.
|
|||||||
Copyright 2015, 2016 Ethcore (UK) Limited
|
Copyright 2015, 2016 Ethcore (UK) Limited
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
parity daemon [options] [ --no-bootstrap | <enode>... ]
|
parity daemon <pid_file> [options] [ --no-bootstrap | <enode>... ]
|
||||||
parity [options] [ --no-bootstrap | <enode>... ]
|
parity [options] [ --no-bootstrap | <enode>... ]
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
@ -187,17 +187,9 @@ impl Configuration {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if self.args.cmd_daemon {
|
if self.args.cmd_daemon {
|
||||||
let daemonize = Daemonize::new()
|
let daemonize = Daemonize::new().pid_file(self.args.arg_pid_file.clone()).chown_pid_file(true);
|
||||||
.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");
|
|
||||||
|
|
||||||
match daemonize.start() {
|
match daemonize.start() {
|
||||||
Ok(_) => info!("Success, daemonized"),
|
Ok(_) => info!("Daemonized"),
|
||||||
Err(e) => { error!("{}", e); return; },
|
Err(e) => { error!("{}", e); return; },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user