aboutsummaryrefslogtreecommitdiffstats
path: root/japanese/canna-lib/files/canna.sh.in
blob: 6881832fb165e1b04a86d46e128cd0be94fae05e (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
#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: canna
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: FreeBSD shutdown

# Define these canna_* variables in one of these files:
#   /etc/rc.conf
#   /etc/rc.conf.local
#   /etc/rc.conf.d/canna
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#
canna_enable=${canna_enable:-"NO"}      # Enable canna
#canna_program="@PREFIX@/sbin/cannaserver"  # Location of canna
canna_flags=${canna_flags:-"-u bin"}        # Flags to canna program
# Put the following into /etc/rc.conf if you want to use a TCP
# connection instead of a UNIX domain socket.
#canna_flags="-u bin -inet"

. @RC_SUBR@

name="canna"
rcvar=`set_rcvar`
command="@PREFIX@/sbin/cannaserver"
start_precmd="canna_prestart"
stop_cmd="canna_stop"

canna_prestart() {
    @RM@ -f /tmp/.iroha_unix/IROHA
    @TOUCH@ /var/log/CANNA0msgs
    @CHOWN@ bin:bin /var/log/CANNA0msgs
}

canna_stop() {
    @PREFIX@/sbin/cannakill && echo "Stopping ${name}."
}

load_rc_config $name
run_rc_command "$1"