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 | |
download | smartmontools-openrc-276160474517301b53fcf06f4808e6f863de41c4.tar.xz |
Initial commit
-rw-r--r-- | PKGBUILD | 29 | ||||
-rw-r--r-- | smartd.initd | 28 |
2 files changed, 57 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..504d46c --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,29 @@ +# Maintainer: jc_gargma <jc_gargma@iserlohn-fortress.net> + +# # I maintain this because: +# Artix lacks this init script entirely + +pkgname=smartmontools-openrc +pkgver=20181122 +pkgrel=1 +pkgdesc="OpenRC smartd init script" +arch=('any') +url="https://neueland.iserlohn-fortress.net/gitea/jc_gargma" +license=('GPL2') +groups=('openrc-system') +depends=('openrc' 'smartmontools') +backup=('etc/init.d/smartd') +source=("smartd.initd") +sha256sums=('5cd1aef86de44abc4ce2241eaae57acfbcbfa2acdc411f4d97fb9b23058ee526') + +pkgver() { + date +%Y%m%d +} + +_inst_initd(){ + install -Dm755 ${srcdir}/$1.initd ${pkgdir}/etc/init.d/$1 +} + +package() { + _inst_initd 'smartd' +} 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 $? +} |