diff options
author | jc_gargma <jc_gargma@iserlohn-fortress.net> | 2018-11-22 20:40:54 -0800 |
---|---|---|
committer | jc_gargma <jc_gargma@iserlohn-fortress.net> | 2018-11-22 20:40:54 -0800 |
commit | 276160474517301b53fcf06f4808e6f863de41c4 (patch) | |
tree | 4cc31741feb951f3f0d26f6adb6b446fdea762b2 /smartd.initd | |
download | smartmontools-openrc-276160474517301b53fcf06f4808e6f863de41c4.tar.xz |
Initial commit
Diffstat (limited to 'smartd.initd')
-rw-r--r-- | smartd.initd | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/smartd.initd b/smartd.initd new file mode 100644 index 0000000..e49777a --- /dev/null +++ b/smartd.initd @@ -0,0 +1,28 @@ +#!/usr/bin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +pidfile="/run/smartd.pid" +command="/usr/bin/smartd" +command_args="-p ${pidfile} ${SMARTD_OPTS}" +extra_started_commands="reload" + +depend() { + need localmount + after bootmisc +} + +start_pre() { + 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 +} + +reload() { + ebegin "Reloading configuration" + start-stop-daemon --signal HUP --pidfile ${pidfile} ${command##*/} + eend $? +} |