diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2019-04-28 09:54:45 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2019-04-28 09:54:45 +0100 |
commit | b7ebc951da8800f711142f69d9d958bde67a112d (patch) | |
tree | e318514216845acb8f2e49fff7a5cba4027e9d91 /www-misc/monitorix/files | |
parent | dc7cbdfa65fd814b3b9aa3c56257da201109e807 (diff) |
gentoo resync : 28.04.2019
Diffstat (limited to 'www-misc/monitorix/files')
-rwxr-xr-x | www-misc/monitorix/files/monitorix | 30 | ||||
-rw-r--r-- | www-misc/monitorix/files/monitorix.init | 24 |
2 files changed, 30 insertions, 24 deletions
diff --git a/www-misc/monitorix/files/monitorix b/www-misc/monitorix/files/monitorix new file mode 100755 index 000000000000..389119e2e552 --- /dev/null +++ b/www-misc/monitorix/files/monitorix @@ -0,0 +1,30 @@ +#!/sbin/openrc-run +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +name="Monitorix" +description="Monitorix is a lightweight system monitoring tool" +command=/usr/sbin/monitorix +command_args="-c /etc/monitorix/monitorix.conf -p /var/run/$name.pid" +pidfile=/var/run/monitorix.pid + +checkconfig() { + if [[ ! -e /etc/monitorix/monitorix.conf ]]; then + eerror "Please check that the configuration file exists." + return 1 + fi +} + +start() { + checkconfig || return 1 + ebegin "Starting $name" + start-stop-daemon --start --name $name --pidfile /var/run/$name.pid --exec $command -- $command_args + eend $? +} + +stop() { + ebegin "Stopping $name" + start-stop-daemon --stop --pidfile /var/run/$name.pid + eend $? +} + diff --git a/www-misc/monitorix/files/monitorix.init b/www-misc/monitorix/files/monitorix.init deleted file mode 100644 index a614bd0bd4a1..000000000000 --- a/www-misc/monitorix/files/monitorix.init +++ /dev/null @@ -1,24 +0,0 @@ -#!/sbin/openrc-run - -depend() { - need net -} - -start() { - ebegin "Starting monitorix" - start-stop-daemon --start --exec /usr/sbin/monitorix --pidfile /var/run/monitorix.pid -- -c /etc/monitorix/monitorix.conf -p /var/run/monitorix.pid - local i=0 - local timeout=5 - while [ ! -f /var/run/monitorix.pid ] && [ $i -le $timeout ]; do - sleep 1 - i=$(($i + 1)) - done - [ $timeout -gt $i ] - eend $? -} - -stop() { - ebegin "Stopping monitorix" - start-stop-daemon --stop --signal QUIT --stop --exec /usr/sbin/monitorix --pidfile /var/run/monitorix.pid - eend $? -} |