diff options
author | Masafumi Max NAKANE <max@FreeBSD.org> | 2004-02-16 06:37:22 +0000 |
---|---|---|
committer | Masafumi Max NAKANE <max@FreeBSD.org> | 2004-02-16 06:37:22 +0000 |
commit | d1c4fdec2fac2204018ffeb7981d62d3f14f7ea0 (patch) | |
tree | c3172c5f92044f888e72d2cec028ac91c36d50eb /japanese/canna-lib/files | |
parent | 2a96f151b3c72b039d097aa2ee7b03da506e98e2 (diff) | |
download | ports-d1c4fdec2fac2204018ffeb7981d62d3f14f7ea0.tar.gz ports-d1c4fdec2fac2204018ffeb7981d62d3f14f7ea0.zip |
Notes
Diffstat (limited to 'japanese/canna-lib/files')
-rw-r--r-- | japanese/canna-lib/files/canna.sh.in | 64 |
1 files changed, 38 insertions, 26 deletions
diff --git a/japanese/canna-lib/files/canna.sh.in b/japanese/canna-lib/files/canna.sh.in index 1595ca688f9f..6881832fb165 100644 --- a/japanese/canna-lib/files/canna.sh.in +++ b/japanese/canna-lib/files/canna.sh.in @@ -1,32 +1,44 @@ #!/bin/sh +# +# $FreeBSD$ +# -OPTIONS="-u bin" -# Uncomment the following if you want to use a TCP connection -# instead of a UNIX domain socket. -#OPTIONS="-u bin -inet" +# PROVIDE: canna +# REQUIRE: DAEMON +# BEFORE: LOGIN +# KEYWORD: FreeBSD shutdown -if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/${0##*/}\$"); then - echo "$0: Cannot determine the PREFIX" >&2 - exit 64 -fi +# 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@ -case "$1" in -start) - if [ -x ${PREFIX}/sbin/cannaserver ]; then - @RM@ -f /tmp/.iroha_unix/IROHA - @TOUCH@ /var/log/CANNA0msgs - @CHOWN@ bin:bin /var/log/CANNA0msgs - ${PREFIX}/sbin/cannaserver ${OPTIONS} && echo -n ' canna' - fi - ;; -stop) - ${PREFIX}/sbin/cannakill && echo -n ' canna' - ;; -*) - echo "Usage: `basename $0` {start|stop}" >&2 - exit 64 - ;; -esac +name="canna" +rcvar=`set_rcvar` +command="@PREFIX@/sbin/cannaserver" +start_precmd="canna_prestart" +stop_cmd="canna_stop" -exit 0 +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" |