Skip to content

Commit

Permalink
Add rc.d script for FreeBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
xianghuzhao committed Mar 1, 2020
1 parent f0b1f26 commit b948f45
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
4 changes: 3 additions & 1 deletion release/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ release() {
echo "Build Herald Daemon $goos-$goarch failed"
fi

cp ../support/etc/config.yml.example "$target_dir/config.yml"
cp ../support/config.yml.example "$target_dir/config.yml"
if [ $goos = linux ]; then
cp -r ../support/systemd "$target_dir/systemd"
elif [ $goos = freebsd ]; then
cp -r ../support/rc.d "$target_dir/rc.d"
fi

tar -C "$build_dir" -czf "$build_dir/$archive_name" "$target_name"
Expand Down
File renamed without changes.
18 changes: 18 additions & 0 deletions support/rc.d/heraldd
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh
# PROVIDE: heraldd
# REQUIRE: DAEMON NETWORKING LOGIN
# KEYWORD: shutdown

. /etc/rc.subr

name=heraldd
rcvar="${name}_enable"
heraldd_command="/usr/local/bin/${name}"
pidfile="/var/run/${name}.pid"

heraldd_config="/usr/local/etc/heraldd/config.yml"
command="/usr/sbin/daemon"
command_args="-P ${pidfile} -r -f ${heraldd_command} -config ${heraldd_config}"

load_rc_config $name
run_rc_command "$1"
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main

// Version for Herald Daemon
const Version = "1.4.0"
const Version = "1.4.1"

0 comments on commit b948f45

Please sign in to comment.