freebsd-ports/japanese/canna-lib/files/canna.sh.in
Masafumi Max NAKANE a67b340bea Cannaserver now has the -u option which allow you to specify who should
own the server process.  So instead of patching up the source to
drop the root privilege, just use this.
Suggested by:	AIDA Shinra <aida-s@jcom.home.ne.jp>
2002-11-14 02:25:20 +00:00

32 lines
640 B
Bash

#!/bin/sh
OPTIONS="-u bin"
# Uncomment the following if you want to use a TCP connection
# instead of a UNIX domain socket.
#OPTIONS="-u bin -inet"
if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/${0##*/}\$"); then
echo "$0: Cannot determine the PREFIX" >&2
exit 64
fi
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
exit 0