remove libc and daemonize option
This commit is contained in:
parent
4bbdb2f45f
commit
03918ea53e
4 changed files with 1 additions and 18 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -390,7 +390,6 @@ dependencies = [
|
|||
"handlebars 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hotwatch 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
|
@ -17,7 +17,6 @@ handlebars = "2.0"
|
|||
hotwatch = "0.4"
|
||||
percent-encoding = "2.1"
|
||||
itertools = "0.8"
|
||||
libc = "0.2"
|
||||
log = "0.4"
|
||||
simple_logger = "1.3"
|
||||
clap = { version = "2.33", features = ["yaml", "wrap_help"] }
|
||||
|
|
|
@ -14,10 +14,6 @@ args:
|
|||
multiple: true
|
||||
help: Decreases the log level to error or no logging at all, respectively.
|
||||
conflicts_with: "verbose"
|
||||
- daemon:
|
||||
short: "d"
|
||||
long: "daemon"
|
||||
help: "Run bunbun as a daemon."
|
||||
- config:
|
||||
short: "c"
|
||||
long: "config"
|
||||
|
|
13
src/main.rs
13
src/main.rs
|
@ -1,10 +1,8 @@
|
|||
use actix_web::middleware::Logger;
|
||||
use actix_web::{App, HttpServer};
|
||||
use actix_web::{middleware::Logger, App, HttpServer};
|
||||
use clap::{crate_authors, crate_version, load_yaml, App as ClapApp};
|
||||
use error::BunBunError;
|
||||
use handlebars::Handlebars;
|
||||
use hotwatch::{Event, Hotwatch};
|
||||
use libc::daemon;
|
||||
use log::{debug, error, info, trace, warn};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::cmp::min;
|
||||
|
@ -53,15 +51,6 @@ async fn main() -> Result<(), BunBunError> {
|
|||
groups: conf.groups,
|
||||
}));
|
||||
|
||||
// Daemonize after trying to read from config and before watching; allow user
|
||||
// to see a bad config (daemon process sets std{in,out} to /dev/null)
|
||||
if matches.is_present("daemon") {
|
||||
unsafe {
|
||||
debug!("Daemon flag provided. Running as a daemon.");
|
||||
daemon(0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
let _watch = start_watch(state.clone(), conf_file_location)?;
|
||||
|
||||
HttpServer::new(move || {
|
||||
|
|
Loading…
Reference in a new issue