Lines 1-14
Link Here
|
1 |
#!/bin/sh |
1 |
#!/bin/sh |
2 |
# |
2 |
# |
3 |
# Put the yggdrasil and yggdrasilctl binaries into /usr/local/bin |
3 |
# Put the yggdrasil and yggdrasilctl binaries into /usr/local/bin |
4 |
# Then copy this script into /etc/rc.d/yggdrasil |
4 |
# Then copy this script into /usr/local/etc/rc.d/yggdrasil |
5 |
# Finally, run: |
5 |
# Finally, run: |
6 |
# 1. chmod +x /etc/rc.d/yggdrasil /usr/local/bin/{yggdrasil,yggdrasilctl} |
6 |
# 1. chmod +x /etc/rc.d/yggdrasil /usr/local/bin/{yggdrasil,yggdrasilctl} |
7 |
# 2. echo "yggdrasil_enable=yes" >> /etc/rc.d |
7 |
# 2. sysrc yggdrasil_enable=YES |
8 |
# 3. service yggdrasil start |
8 |
# 3. service yggdrasil start |
9 |
# |
9 |
# |
10 |
# PROVIDE: yggdrasil |
10 |
# PROVIDE: yggdrasil |
11 |
# REQUIRE: networking |
11 |
# REQUIRE: NETWORKING |
12 |
# KEYWORD: |
12 |
# KEYWORD: |
13 |
|
13 |
|
14 |
. /etc/rc.subr |
14 |
. /etc/rc.subr |
Lines 19-27
Link Here
|
19 |
start_cmd="${name}_start" |
19 |
start_cmd="${name}_start" |
20 |
stop_cmd="${name}_stop" |
20 |
stop_cmd="${name}_stop" |
21 |
|
21 |
|
|
|
22 |
yggdrasil_command="%%PREFIX%%/bin/yggdrasil" |
22 |
pidfile="/var/run/yggdrasil/${name}.pid" |
23 |
pidfile="/var/run/yggdrasil/${name}.pid" |
23 |
command="/usr/sbin/daemon" |
24 |
command="/usr/sbin/daemon" |
24 |
command_args="-P ${pidfile} -r -f ${yggdrasil_command}" |
25 |
command_args="-P ${pidfile} -r -S -m 3 -s info -T yggdrasil ${yggdrasil_command}" |
25 |
|
26 |
|
26 |
yggdrasil_start() |
27 |
yggdrasil_start() |
27 |
{ |
28 |
{ |
Lines 39-45
Link Here
|
39 |
mkdir -p /var/run/yggdrasil |
40 |
mkdir -p /var/run/yggdrasil |
40 |
|
41 |
|
41 |
logger -s -t yggdrasil "Starting yggdrasil" |
42 |
logger -s -t yggdrasil "Starting yggdrasil" |
42 |
${command} ${command_args} %%PREFIX%%/bin/yggdrasil -useconffile %%PREFIX%%/etc/yggdrasil.conf \ |
43 |
${command} ${command_args} -useconffile %%PREFIX%%/etc/yggdrasil.conf \ |
43 |
1>/var/log/yggdrasil.stdout.log \ |
44 |
1>/var/log/yggdrasil.stdout.log \ |
44 |
2>/var/log/yggdrasil.stderr.log & |
45 |
2>/var/log/yggdrasil.stderr.log & |
45 |
} |
46 |
} |