modded config, added systemd/udev files

This commit is contained in:
Paul Lecuq 2021-09-21 09:45:43 +02:00
parent 58a0e414ed
commit 3ac1d3eb54
3 changed files with 19 additions and 3 deletions

View File

@ -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

2
misc/udev/99-midi.rules Normal file
View File

@ -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}"

View File

@ -12,7 +12,7 @@ pub struct Config {
pub authtoken: Option<String>,
pub sloweffect: Option<bool>,
pub refresh: Option<u64>,
pub limit: Option<i64>,
pub limit: Option<u64>,
}
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);
}
}