From 3ac1d3eb542b89f858197bd28c5363073fe3b01c Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Tue, 21 Sep 2021 09:45:43 +0200 Subject: [PATCH] modded config, added systemd/udev files --- misc/systemd/zabbixlaunch.service | 14 ++++++++++++++ misc/udev/99-midi.rules | 2 ++ src/config/mod.rs | 6 +++--- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 misc/systemd/zabbixlaunch.service create mode 100644 misc/udev/99-midi.rules diff --git a/misc/systemd/zabbixlaunch.service b/misc/systemd/zabbixlaunch.service new file mode 100644 index 0000000..520d9fd --- /dev/null +++ b/misc/systemd/zabbixlaunch.service @@ -0,0 +1,14 @@ +[Unit] +Description=Zabbixlaunch +Documentation=https://git.paulbsd.com/paulbsd/zabbixlaunch +After=network.target + +[Service] +ExecStart=/usr/local/bin/zabbixlaunch --config /etc/zabbixlaunch/config.json +ExecReload=/bin/kill -HUP $MAINPID +Restart=on-failure +RestartForceExitStatus=SIGPIPE +KillMode=control-group + +[Install] +WantedBy=multi-user.target diff --git a/misc/udev/99-midi.rules b/misc/udev/99-midi.rules new file mode 100644 index 0000000..9971b8b --- /dev/null +++ b/misc/udev/99-midi.rules @@ -0,0 +1,2 @@ +KERNEL=="midiC[D0-9]*", DRIVERS=="usb", ACTION=="add", PROGRAM="/usr/bin/systemctl start zabbixlaunch", NAME="snd/%c{1}" +KERNEL=="midiC[D0-9]*", DRIVERS=="usb", ACTION=="remove", PROGRAM="/usr/bin/systemctl stop zabbixlaunch", NAME="snd/%c{1}" diff --git a/src/config/mod.rs b/src/config/mod.rs index a0d1162..d3317ee 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -12,7 +12,7 @@ pub struct Config { pub authtoken: Option, pub sloweffect: Option, pub refresh: Option, - pub limit: Option, + pub limit: Option, } impl Config { @@ -24,7 +24,7 @@ impl Config { authtoken: Some(String::from("token")), sloweffect: Some(true), refresh: Some(5u64), - limit: Some(20i64), + limit: Some(20u64), } } @@ -39,7 +39,7 @@ impl Config { self.refresh = Some(5u64); } if self.limit.is_none() { - self.limit = Some(20i64); + self.limit = Some(20u64); } }