From 276160474517301b53fcf06f4808e6f863de41c4 Mon Sep 17 00:00:00 2001 From: jc_gargma Date: Thu, 22 Nov 2018 20:40:54 -0800 Subject: Initial commit --- PKGBUILD | 29 +++++++++++++++++++++++++++++ smartd.initd | 28 ++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 PKGBUILD create mode 100644 smartd.initd diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..504d46c --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,29 @@ +# Maintainer: jc_gargma + +# # 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 $? +} -- cgit v1.2.1