summaryrefslogtreecommitdiff
path: root/security/p5-openxpki/files/openxpki.in
blob: 087bee7699859b74368782aa8a220816d068d942 (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
# $FreeBSD$
#
# PROVIDE: openxpki
# REQUIRE: LOGIN
# REQUIRE: postgresql
# REQUIRE: mysql
# KEYWORD: shutdown
#
# Define this variable in file /etc/rc.conf:
# openxpki_enable="YES"
# to ensure that openxpki starts at boot time.
# Define and edit this variable in file /etc/rc.conf:
# openxpki_conf="%%PREFIX%%/etc/openxpki/config.git"
# if your configuration is in different place.
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
# SET THEM IN THE /etc/rc.conf FILE
#

. /etc/rc.subr

name=openxpki
desc="OpenXPKI daemon"
rcvar=openxpki_enable
load_rc_config ${name}
: ${openxpki_enable:=no}
: ${openxpki_conf=%%PREFIX%%/etc/openxpki/config.git}
command=%%PREFIX%%/bin/openxpkictl
procname=openxpkid
openxpki_user=${name}
pidfile=/var/openxpki/openxpkid.pid

extra_commands=reload
start_cmd=control
stop_cmd=control
restart_cmd=control
status_cmd=control
reload_cmd=control

control()
{
	USER=${openxpki_user} ${command} --config ${openxpki_conf} ${rc_arg}
}

run_rc_command "$1"