diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2013-11-01 13:55:37 +0000 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2013-11-01 13:55:42 +0000 |
commit | b20d58f4e643d155ed97a164ecc89b56444c9a8f (patch) | |
tree | 492f0e733123ebd09cb83c1273e0c2984281ea4c /main/monit/monit.initd | |
parent | 7467d292063c766cc80129520e9ca22c9c096705 (diff) | |
download | aports-b20d58f4e643d155ed97a164ecc89b56444c9a8f.tar.bz2 aports-b20d58f4e643d155ed97a164ecc89b56444c9a8f.tar.xz |
main/monit: move to main and add monitrc
Diffstat (limited to 'main/monit/monit.initd')
-rw-r--r-- | main/monit/monit.initd | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/main/monit/monit.initd b/main/monit/monit.initd new file mode 100644 index 0000000000..4163c988b8 --- /dev/null +++ b/main/monit/monit.initd @@ -0,0 +1,39 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later +# $Header: /var/cvsroot/gentoo-x86/app-admin/monit/files/monit.initd-5.0-r1,v 1.2 2011/12/31 16:28:50 idl0r Exp $ + +extra_commands="configtest" +extra_started_commands="reload" + +depend() { + use net +} + +configtest() { + /usr/bin/monit -t 1>/dev/null 2>&1 + ret=$? + if [ $ret -ne 0 ]; then + eerror "${SVCNAME} has detected an error in your setup:" + /usr/bin/monit -t + fi + return $ret +} + +start() { + ebegin "Starting monit" + start-stop-daemon --start --quiet --exec /usr/bin/monit >/dev/null 2>&1 + eend $? +} + +stop() { + ebegin "Stopping monit" + start-stop-daemon --stop --quiet --exec /usr/bin/monit + eend $? +} + +reload() { + ebegin "Reloading monit" + /usr/bin/monit -c /etc/monitrc reload >/dev/null 2>&1 + eend $? +} |