blob: dc39614451c1878a2afddf9e2cf3bd18b93d508c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
#!/bin/sh
# PROVIDE: timestamp-server
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# timestamp-server_enable (bool): Set it to YES to enable timestamp-server.
# Default is "NO".
# timestamp-server_user (user): Set user to run timestamp-server.
# Default is "timestamp-server".
# timestamp-server_group (group): Set group to run timestamp-server.
# Default is "timestamp-server".
# timestamp-server_config (file): Set timestamp-server config file.
# Default is "%%PREFIX%%/etc/timestamp-server/timestamp-server.yaml".
. /etc/rc.subr
name=timestamp-server
rcvar=timestamp-server_enable
load_rc_config $name
: ${timestamp-server_enable:="NO"}
: ${timestamp-server_user:="timestamp-authority"}
: ${timestamp-server_group:="timestamp-authority"}
: ${timestamp-server_config:="%%PREFIX%%/etc/timestamp-authority/timestamp-server.yaml"}
pidfile=/var/run/timestamp-server.pid
procname="%%PREFIX%%/bin/timestamp-server"
command="/usr/sbin/daemon"
command_args="-f -t ${name} -p ${pidfile} ${procname} serve -config=${timestamp-server_config}"
start_precmd=timestamp-server_startprecmd
required_files="$timestamp-server_config"
timestamp-server_startprecmd()
{
if [ ! -e ${pidfile} ]; then
install -o ${timestamp-server_user} -g ${timestamp-server_group} /dev/null ${pidfile};
fi
}
run_rc_command "$1"
|