#!/sbin/runscript # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/app-text/gonzui/files/gonzui.initd,v 1.1 2011/01/15 01:55:39 matsuu Exp $ GONZUI_SERVER="/usr/bin/gonzui-server" GONZUIRC="/etc/gonzuirc" GONZUI_PIDFILE="/var/run/gonzui.pid" depend() { need net } checkconfig() { if [ ! -f "$GONZUIRC" ] ; then eerror "Please create $GONZUIRC" return 1 fi return 0 } start() { checkconfig || return $? ebegin "Starting gonzui" start-stop-daemon --start --quiet --pidfile "${GONZUI_PIDFILE}" \ --exec /usr/bin/ruby "${GONZUI_SERVER}" -- --daemon \ --gonzuirc="${GONZUIRC}" --quiet eend $? "Failed to start gonzui" } stop() { ebegin "Stopping gonzui" start-stop-daemon --signal INT --quiet --pidfile "${GONZUI_PIDFILE}" eend $? "Failed to stop gonzui" }