diff options
author | 2017-04-01 11:25:48 +0200 | |
---|---|---|
committer | 2017-04-05 18:48:29 +0800 | |
commit | 4cb80ab1fbb66072bb6920383a2cbe134c766547 (patch) | |
tree | 11a470697e48edaeb2474afd93e065fd927adcc0 /src/main.rs | |
parent | Wrap `UdpSocket` in `RwLock`, so that it is possible to change it (diff) | |
download | wireguard-rs-sg/master.tar.xz wireguard-rs-sg/master.zip |
Added API function for retrieving the 'run path'sg/master
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 326639c..2c66085 100644 --- a/src/main.rs +++ b/src/main.rs @@ -61,11 +61,13 @@ fn run() -> Result<()> { } debug!("Starting daemon."); + // Daemonize the process + let pid_path = WireGuard::get_run_path(); let daemonize = Daemonize::new() - .pid_file("/tmp/wireguard.pid") + .pid_file(pid_path.join("wireguard.pid")) .chown_pid_file(true) - .working_directory("/tmp") + .working_directory(pid_path) .user("nobody") .group("daemon") .umask(0o077); |