mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 11:31:08 +03:00
Daemonize server with proper working directory. (#289)
This commit is contained in:
parent
10380c0ce0
commit
efb41596b2
1 changed files with 2 additions and 0 deletions
|
@ -34,6 +34,7 @@ use std::thread;
|
|||
use std::io::Read;
|
||||
use std::fs::File;
|
||||
use std::time::Duration;
|
||||
use std::env::current_dir;
|
||||
|
||||
use clap::{App, Arg, ArgMatches, SubCommand};
|
||||
use daemonize::Daemonize;
|
||||
|
@ -333,6 +334,7 @@ fn server_command(server_args: &ArgMatches, global_config: GlobalConfig) {
|
|||
let daemonize = Daemonize::new()
|
||||
.pid_file("/tmp/grin.pid")
|
||||
.chown_pid_file(true)
|
||||
.working_directory(current_dir().unwrap())
|
||||
.privileged_action(move || {
|
||||
grin::Server::start(server_config.clone()).unwrap();
|
||||
loop {
|
||||
|
|
Loading…
Reference in a new issue