From 276160474517301b53fcf06f4808e6f863de41c4 Mon Sep 17 00:00:00 2001 From: jc_gargma Date: Thu, 22 Nov 2018 20:40:54 -0800 Subject: Initial commit --- smartd.initd | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 smartd.initd (limited to 'smartd.initd') 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 $? +} -- cgit v1.2.1