diff options
author | Dan Theisen <djt@hxx.in> | 2018-07-06 02:10:32 -0700 |
---|---|---|
committer | Dan Theisen <djt@hxx.in> | 2018-07-06 02:34:42 -0700 |
commit | 18ab65d12e1f62baae5e5e44da269d87f1022356 (patch) | |
tree | 95799fe9c2d59217c7d46f45c8c98bde0349e889 /user/smartmontools/smartd.initd | |
parent | 8d2f786addf7f1a31f61eae5b8d4b89ff5d27330 (diff) | |
download | packages-18ab65d12e1f62baae5e5e44da269d87f1022356.tar.gz packages-18ab65d12e1f62baae5e5e44da269d87f1022356.tar.bz2 packages-18ab65d12e1f62baae5e5e44da269d87f1022356.tar.xz packages-18ab65d12e1f62baae5e5e44da269d87f1022356.zip |
user/smartmontools: import, take, minor fix ups
Diffstat (limited to 'user/smartmontools/smartd.initd')
-rw-r--r-- | user/smartmontools/smartd.initd | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/user/smartmontools/smartd.initd b/user/smartmontools/smartd.initd new file mode 100644 index 000000000..f37284320 --- /dev/null +++ b/user/smartmontools/smartd.initd @@ -0,0 +1,43 @@ +#!/sbin/openrc-run +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/smartmontools/files/smartd.rc,v 1.9 2011/09/15 07:58:50 polynomial-c Exp $ + +depend() { + need localmount + after bootmisc +} + +extra_started_commands="reload" + +checkconfig() { + if [ ! -f "/etc/smartd.conf" ] ; then + eerror "You should setup your /etc/smartd.conf file!" + eerror "See the smartd.conf(5) manpage." + return 1 + fi + return 0 +} + +start() { + checkconfig || return 1 + + ebegin "Starting S.M.A.R.T. monitoring daemon" + start-stop-daemon --start --exec /usr/sbin/smartd \ + --pidfile /var/run/smartd.pid \ + -- -p /var/run/smartd.pid ${SMARTD_OPTS} + eend $? +} + +stop() { + ebegin "Stopping S.M.A.R.T. monitoring daemon" + start-stop-daemon --stop --exec /usr/sbin/smartd \ + --pidfile /var/run/smartd.pid + eend $? +} + +reload() { + ebegin "Reloading configuration" + start-stop-daemon --signal HUP --pidfile /var/run/smartd.pid smartd + eend $? +} |