Compare commits
No commits in common. "c3a572619f8f30a0f6bd079ab14b8f92d198f8d3" and "e7ca4cb4344cff762f19283a59521751f4354cbf" have entirely different histories.
c3a572619f
...
e7ca4cb434
@ -4,13 +4,9 @@ Watchdog for monitoring web-services
|
|||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
###On \*nix
|
**On \*nix:** OpenSSL 1.0.1, 1.0.2, 1.1.0, or 1.1.1 with headers (see https://github.com/sfackler/rust-openssl)
|
||||||
- OpenSSL 1.0.1, 1.0.2, 1.1.0, or 1.1.1 with headers (see https://github.com/sfackler/rust-openssl)
|
|
||||||
- Perl
|
|
||||||
- Curl
|
|
||||||
|
|
||||||
###On Windows
|
**On Windows:** Nothing
|
||||||
- PowerShell
|
|
||||||
|
|
||||||
## Configuration file
|
## Configuration file
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@ Description=Watchdog service
|
|||||||
User=wwwrun
|
User=wwwrun
|
||||||
Group=www
|
Group=www
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=/usr/local/sbin/cai-watchdog
|
ExecStart=/usr/local/bin/cai-watchdog
|
||||||
|
|
||||||
KillMode=control-group
|
KillMode=control-group
|
||||||
NotifyAccess=all
|
NotifyAccess=all
|
||||||
10
src/main.rs
10
src/main.rs
@ -3,10 +3,9 @@ extern crate ini;
|
|||||||
extern crate exitcode;
|
extern crate exitcode;
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::path::Path;
|
|
||||||
use std::process::Command;
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
use std::process::Command;
|
||||||
|
|
||||||
/// Rule description structure
|
/// Rule description structure
|
||||||
pub struct Rule {
|
pub struct Rule {
|
||||||
@ -162,13 +161,6 @@ fn main() {
|
|||||||
"/etc/cai-watchdog.conf"
|
"/etc/cai-watchdog.conf"
|
||||||
};
|
};
|
||||||
|
|
||||||
if !Path::new(cfg_file).exists() {
|
|
||||||
println!("Error! Can't find configuration file.");
|
|
||||||
println!("Exiting...");
|
|
||||||
|
|
||||||
std::process::exit(exitcode::CONFIG);
|
|
||||||
}
|
|
||||||
|
|
||||||
let cfg = ini!(cfg_file);
|
let cfg = ini!(cfg_file);
|
||||||
|
|
||||||
let check_interval = cfg["main"]["check_interval"].clone().unwrap().parse::<u64>().unwrap() * 1000;
|
let check_interval = cfg["main"]["check_interval"].clone().unwrap().parse::<u64>().unwrap() * 1000;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user