Skip to content

Commit

Permalink
initial commit of systemd unit and bsd rc script
Browse files Browse the repository at this point in the history
  • Loading branch information
fukawi2 committed Mar 18, 2018
1 parent ce142e4 commit 5409520
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
23 changes: 23 additions & 0 deletions fscanary.rc
@@ -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"
22 changes: 22 additions & 0 deletions fscanary.service
@@ -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

0 comments on commit 5409520

Please sign in to comment.