#!/bin/sh # # alice An XMPP (Jabber) component for making aliases for an existing XMPP acconts # # chkconfig: 345 71 29 # description: Alice is a small script for creating aliases for an existing Jabber accounts # # processname: perl # config: @configfile@ # pidfile: @pidfile@ # ### BEGIN INIT INFO # Provides: jabber-alice # Required-Start: $network # Required-Stop: $network # Should-Start: $jabber # Default-Start: 3 4 5 # Default-Stop: 0 1 2 6 # Short-Description: start and stop Alice XMPP component # Description: Alice is a small script for creating aliases for an existing Jabber accounts ### END INIT INFO # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network [ -r @sysconfigfile@ ] && . @sysconfigfile@ LOCKFILE=@lockfile@ PIDFILE=@pidfile@ BASEDIR=@basedir@ EXECFILE=$BASEDIR/@scriptname@ # Check that networking is up. [ $NETWORKING = "no" ] && exit 0 RETVAL=0 start() { if [ ! -r "$CONFIG_FILE" ]; then echo "alice is not configured - no config file $CONFIG_FILE found" # LSB 3.1.0: 6 - program is not configured RETVAL=6 fi start_daemon \ --pidfile "$PIDFILE" \ --lockfile "$LOCKFILE" \ --user "$USERNAME" \ --name perl \ --displayname jabber-alice \ -- "$EXECFILE" --config="$CONFIG_FILE" RETVAL=$? } stop() { stop_daemon \ --pidfile "$PIDFILE" \ --lockfile "$LOCKFILE" \ --expect-user "$USERNAME" \ --displayname jabber-alice \ -- perl RETVAL=$? } stat() { status \ --pidfile "$PIDFILE" \ --lockfile "$LOCKFILE" \ --expect-user "$USERNAME" \ --displayname jabber-alice \ -- perl RETVAL=$? } # See how we were called. case "$1" in start) start ;; stop|condstop) stop ;; restart|force-reload) stop start ;; try-restart|condrestart|condreload) stat 2&>/dev/null [ "$RETVAL" == "0" ] && (stop; start); ;; status) stat ;; *) msg_usage "${0##*/} {start|stop|restart|status|try-restart|force-reload|condstop|condrestart|condreload|help}" RETVAL=1 esac exit $RETVAL