summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-admin/mon/files/mon.init')
-rw-r--r--app-admin/mon/files/mon.init32
1 files changed, 32 insertions, 0 deletions
diff --git a/app-admin/mon/files/mon.init b/app-admin/mon/files/mon.init
new file mode 100644
index 0000000..bb7122e
--- /dev/null
+++ b/app-admin/mon/files/mon.init
@@ -0,0 +1,32 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/mon/files/mon.rc6,v 1.7 2007/07/09 22:47:42 uberlord Exp $
+
+depend() {
+ need clock
+ after logger
+}
+
+checkconfig() {
+ if [ ! -e /etc/mon/mon.cf ] ; then
+ eerror "You need an /etc/mon/mon.cf file to run mon"
+ eerror "There is a sample at /etc/mon/mon.cf.sample"
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting mon"
+ start-stop-daemon --start --exec /usr/sbin/mon \
+ --pidfile /var/run/mon.pid \
+ -- -P /var/run/mon.pid -f
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping mon"
+ start-stop-daemon --stop --pidfile /var/run/mon.pid
+ eend $?
+}