Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial commit of systemd unit and bsd rc script
- Loading branch information
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
# | ||
# PROVIDE: fscanary | ||
# REQUIRE: syslog | ||
# KEYWORD: | ||
|
||
. /etc/rc.subr | ||
|
||
name="fscanary" | ||
rcvar="fscanary_enable" | ||
command="/usr/local/bin/fscanary" | ||
|
||
fscanary_user="root" | ||
fscanary_config="/usr/local/etc/fscanary.conf" | ||
fscanary_syslog_facility="daemon" | ||
fscanary_syslog_priority="info" | ||
|
||
start_cmd="/usr/sbin/daemon -l $fscanary_syslog_facility -s $fscanary_syslog_priority -T $name -t $name -u $fscanary_user $command -config $fscanary_config" | ||
|
||
load_rc_config $name | ||
: ${fscanary_enable:=no} | ||
|
||
run_rc_command "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[Unit] | ||
Description=File System Canary Daemon | ||
After=network.target | ||
|
||
[Service] | ||
Type=simple | ||
User=root | ||
Group=root | ||
Restart=on-failure | ||
RestartSec=3 | ||
StartLimitIntervalSec=60 | ||
ExecStart=/usr/local/bin/fscanary | ||
# log stdin/stdout to syslog/journald | ||
StandardOutput=syslog | ||
StandardError=syslog | ||
SyslogIdentifier=fscanary | ||
# you may wish to give fscanary a higher nice priority to make it schedule | ||
# better with other system processes | ||
#Nice=5 | ||
|
||
[Install] | ||
WantedBy=default.target |