3 # dictd: Starts the Dictionary Daemon
6 # description: This is a daemon for the Dictionary Server Protocol (DICT), \
7 # a TCP transaction based query/response protocol that allows \
8 # a client to access dictionary definitions from a set of \
9 # natural language dictionary databases.
11 # config: /etc/dictd.conf
12 # config: /etc/dictd/*
15 DAEMON_NAME="Dictionary Daemon"
16 DAEMON_CONF=/etc/dictd.conf
18 generate_dictdconf() {
20 if ls /etc/dictd/*.dictconf >/dev/null 2>&1; then
21 echo "# DO NOT EDIT! This file is autogenerated by $0." >$DAEMON_CONF
22 echo "# To configure dictd edit /etc/dictd/* files and restart daemon"\
24 cat /etc/dictd/dictd-main.conf /etc/dictd/*.dictconf >>$DAEMON_CONF
28 echo "$0: $(nls 'no dictionaries found')"
32 # Source function library.
33 . /etc/rc.d/init.d/functions
36 . /etc/sysconfig/network
38 if is_yes "${NETWORKING}"; then
39 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
40 msg_network_down ${DAEMON_FILE}
48 [ -f /etc/sysconfig/${DAEMON_FILE} ] && . /etc/sysconfig/${DAEMON_FILE}
51 # See how we were called.
54 [ -x /usr/sbin/${DAEMON_FILE} ] || exit 0
55 if [ ! -f /var/lock/subsys/${DAEMON_FILE} ]; then
56 if generate_dictdconf; then
57 msg_starting ${DAEMON_NAME}
58 daemon ${DAEMON_FILE} ${DICTD_OPTS}
59 pidofproc ${DAEMON_FILE} >/dev/null 2>&1
61 [ $RETVAL -eq 0 ] && \
62 touch /var/lock/subsys/${DAEMON_FILE}
67 msg_already_running ${DAEMON_NAME}
71 if [ -f /var/lock/subsys/${DAEMON_FILE} ]; then
72 msg_stopping ${DAEMON_NAME}
73 killproc /usr/sbin/${DAEMON_FILE}
74 rm -f /var/lock/subsys/${DAEMON_FILE} >/dev/null 2>&1
76 msg_not_running ${DAEMON_NAME}
89 msg_usage "$0 {start|stop|restart|force-reload|status}"