mirror of
https://github.com/mimblewimble/grin.git
synced 2025-02-01 17:01:09 +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::io::Read;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
use std::env::current_dir;
|
||||||
|
|
||||||
use clap::{App, Arg, ArgMatches, SubCommand};
|
use clap::{App, Arg, ArgMatches, SubCommand};
|
||||||
use daemonize::Daemonize;
|
use daemonize::Daemonize;
|
||||||
|
@ -333,6 +334,7 @@ fn server_command(server_args: &ArgMatches, global_config: GlobalConfig) {
|
||||||
let daemonize = Daemonize::new()
|
let daemonize = Daemonize::new()
|
||||||
.pid_file("/tmp/grin.pid")
|
.pid_file("/tmp/grin.pid")
|
||||||
.chown_pid_file(true)
|
.chown_pid_file(true)
|
||||||
|
.working_directory(current_dir().unwrap())
|
||||||
.privileged_action(move || {
|
.privileged_action(move || {
|
||||||
grin::Server::start(server_config.clone()).unwrap();
|
grin::Server::start(server_config.clone()).unwrap();
|
||||||
loop {
|
loop {
|
||||||
|
|
Loading…
Reference in a new issue