mirror of
https://github.com/egor-white/zaprett.git
synced 2025-12-10 13:30:23 +05:00
add saving logs from nfqws to files
This commit is contained in:
@@ -1,13 +1,20 @@
|
||||
use crate::{MODULE_PATH, run_nfqws};
|
||||
use daemonize::Daemonize;
|
||||
use log::{error, info};
|
||||
use std::fs::File;
|
||||
|
||||
pub async fn daemonize_nfqws(args: &str) {
|
||||
info!("Starting nfqws as a daemon");
|
||||
|
||||
let stdout = File::create(MODULE_PATH.join("tmp/nfqws.out")).unwrap();
|
||||
let stderr = File::create(MODULE_PATH.join("tmp/nfqws.err")).unwrap();
|
||||
|
||||
let daemonize = Daemonize::new()
|
||||
.pid_file(MODULE_PATH.join("tmp/pid.lock").as_path())
|
||||
.working_directory("/tmp")
|
||||
// .group("daemon")
|
||||
.stdout(stdout)
|
||||
.stderr(stderr)
|
||||
.privileged_action(|| "Executed before drop privileges");
|
||||
|
||||
match daemonize.start() {
|
||||
|
||||
Reference in New Issue
Block a user