3 # Provides: koha-common
4 # Required-Start: $remote_fs
5 # Required-Stop: $remote_fs
6 # Default-Start: 2 3 4 5
8 # Short-Description: Start Zebra server for each Koha instance
9 # Description: For each enabled Koha instance on this host,
10 # as listed by "koha-list --enabled", start a Zebra
11 # server (using koha-start-zebra).
14 # Author: Lars Wirzenius <lars@catalyst.net.nz>
18 # PATH should only include /usr/* if it runs after the mountnfs.sh script
19 PATH=/sbin:/usr/sbin:/bin:/usr/bin
22 SCRIPTNAME=/etc/init.d/$NAME
24 # Exit if the package is not installed
25 [ -x /usr/sbin/koha-start-zebra ] || exit 0
27 # Read configuration variable file if it is present
28 if [ -r /etc/default/$NAME ]; then
31 elif [ -r /etc/sysconfig/$NAME ]; then
33 . /etc/sysconfig/$NAME
36 # Load the VERBOSE setting and other rcS variables
39 # Define LSB log_* functions.
40 # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
41 . /lib/lsb/init-functions
44 # Function that starts the daemon/service
48 # We insure all required directories exist, including disabled ones.
49 koha-create-dirs $(koha-list)
50 koha-start-zebra $(koha-list --enabled)
51 koha-start-sip $(koha-list --enabled)
55 # Function that stops the daemon/service
59 # We stop everything, including disabled ones.
60 koha-stop-zebra $(koha-list) || true
61 koha-stop-sip $(koha-list) || true
65 # Function that sends a SIGHUP to the daemon/service
68 koha-restart-zebra $(koha-list --enabled)
69 koha-stop-sip $(koha-list) || true
70 koha-start-sip $(koha-list --enabled)
75 [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
78 0) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
79 *) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
83 [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
86 0) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
87 *) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
92 # If the "reload" option is implemented then remove the
93 # 'force-reload' alias
95 log_daemon_msg "Restarting $DESC" "$NAME"
102 *) log_end_msg 1 ;; # Failed to start
111 # TODO: Implement this. It should check every daemon is running
113 # status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
116 #echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2
117 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2