Create Anubis FreeBSD rc.d script (#274)
* Create anubis.freebsd add freebsd rc.d script so can be run as a freebsd daemon Signed-off-by: Paul Wilde <31094984+pswilde@users.noreply.github.com> * Update CHANGELOG.md Signed-off-by: Paul Wilde <31094984+pswilde@users.noreply.github.com> --------- Signed-off-by: Paul Wilde <31094984+pswilde@users.noreply.github.com>
This commit is contained in:
parent
5d4d2e3e2a
commit
8689143214
2 changed files with 35 additions and 0 deletions
|
|
@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- Whitelisted [DuckDuckBot](https://duckduckgo.com/duckduckgo-help-pages/results/duckduckbot/) in botPolicies
|
- Whitelisted [DuckDuckBot](https://duckduckgo.com/duckduckgo-help-pages/results/duckduckbot/) in botPolicies
|
||||||
- Improvements to build scripts to make them less independent of the build host
|
- Improvements to build scripts to make them less independent of the build host
|
||||||
- Improved the OpenGraph error logging
|
- Improved the OpenGraph error logging
|
||||||
|
- Added FreeBSD rc.d script so can be run as a FreeBSD daemon.
|
||||||
|
|
||||||
## v1.16.0
|
## v1.16.0
|
||||||
|
|
||||||
|
|
|
||||||
34
run/anubis.freebsd
Normal file
34
run/anubis.freebsd
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# PROVIDE: anubis
|
||||||
|
# REQUIRE: NETWORKING
|
||||||
|
# KEYWORD: shutdown
|
||||||
|
|
||||||
|
. /etc/rc.subr
|
||||||
|
|
||||||
|
name=anubis
|
||||||
|
rcvar=anubis_enable
|
||||||
|
|
||||||
|
load_rc_config ${name}
|
||||||
|
|
||||||
|
: ${anubis_enable="NO"}
|
||||||
|
: ${anubis_user="anubis"}
|
||||||
|
: ${anubis_bin="/usr/local/bin/anubis"}
|
||||||
|
: ${anubis_environment_file="/etc/anubis.env"}
|
||||||
|
|
||||||
|
command=/usr/sbin/daemon
|
||||||
|
procname=${anubis_bin}
|
||||||
|
pidfile=/var/run/anubis.pid
|
||||||
|
logfile=/var/log/anubis.log
|
||||||
|
command_args="-c -f -p ${pidfile} -o ${logfile} ${procname}"
|
||||||
|
start_precmd=anubis_precmd
|
||||||
|
|
||||||
|
anubis_precmd () {
|
||||||
|
export $(xargs < ${anubis_environment_file})
|
||||||
|
if [ ! -f ${logfile} ]; then
|
||||||
|
install -o anubis /dev/null ${logfile}
|
||||||
|
fi
|
||||||
|
install -o anubis /dev/null ${pidfile}
|
||||||
|
}
|
||||||
|
|
||||||
|
run_rc_command "$1"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue