diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2020-05-18 13:55:00 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2020-05-18 14:25:41 +0200 |
commit | fad84e6d1a4b41dcfc518e014f5e48c3613b6136 (patch) | |
tree | c930d2e81f06132d5ebdeeea5f86cb1a4b016fa9 | |
parent | 7cf06683f29b5bd725b9ec15e2ffac77e039e51b (diff) |
Add some output
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r-- | src/main.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 3e0d972..1d96b46 100644 --- a/src/main.rs +++ b/src/main.rs @@ -94,10 +94,14 @@ async fn main() -> Result<()> { let mut lock = pidlock::Pidlock::new("/tmp/distrox_server.pid"); if *lock.state() == pidlock::PidlockState::Acquired { // We assume that the server is already running + info!("Assuming that the server is already running. Doing nothing."); return Ok(()) } + info!("Starting server"); let _ = lock.acquire().map_err(|_| anyhow!("Error while getting the PID lock"))?; + + info!("Got PID lock for server"); actix_web::HttpServer::new(|| { actix_web::App::new() .service(actix_web::web::resource("/{name}/{id}/index.html").to(index)) @@ -107,6 +111,8 @@ async fn main() -> Result<()> { .run() .await; + info!("Server shutdown"); + info!("Releasing PID lock for server"); lock.release().map_err(|_| anyhow!("Error while releasing the PID lock")) } else { let app = { |