diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2021-01-08 12:29:17 +0100 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2021-01-08 12:32:43 +0100 |
commit | da5857d23415b733e49a92020f5bd91ab49eab79 (patch) | |
tree | 88e0edd45db6a4442012bd231bd93767c66da4cf | |
parent | 32e056d6a1f52d132a8031c14dafcdec3af87dc9 (diff) |
main/smartmontools: don't force supervise-daemon
supervise-daemon is still experimental and has bad defaults.
Users can enable supervise-daemon, if they want to, simply by declaring
`supervisor=supervise-daemon` in /etc/conf.d/smartd.
See my mail from Tue, 15 Dec 2020 15:33:16 +0100 in alpine-devel
mailing-list in topic "Use of supervise-daemon in Alpine".
(I cannot simply reference it from ML archive because it's broken.)
-rw-r--r-- | main/smartmontools/APKBUILD | 6 | ||||
-rw-r--r-- | main/smartmontools/smartd.confd | 12 | ||||
-rw-r--r-- | main/smartmontools/smartd.initd | 24 |
3 files changed, 28 insertions, 14 deletions
diff --git a/main/smartmontools/APKBUILD b/main/smartmontools/APKBUILD index 354cdffcad2..67bddbc4d49 100644 --- a/main/smartmontools/APKBUILD +++ b/main/smartmontools/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=smartmontools pkgver=7.2 -pkgrel=0 +pkgrel=1 pkgdesc="Control and monitor S.M.A.R.T. enabled hard drives" url="https://www.smartmontools.org/" arch="all" @@ -34,5 +34,5 @@ package() { } sha512sums="d7e724295b5d53797b5e4136eea5f5cc278db81e4016ba65142438b8c68c54f85a32c582c147a1590b9bc8f74a58952bcb57b9923dd69d34582530a0985799ea smartmontools-7.2.tar.gz -a813a68102e76385c09353a5713e82d4b3205cc7bbd69574ade4729c5e68a00c6ada7414fba10e04ebcadad33900ef7886db62ea2bfb6f8bf53e2e5121a369a0 smartd.initd -ff45462944f01c0e7cac99443078b253dcbaed4f99ffab85052b12361d9eec4beec81cab334fbede9148b3dd503d5205add32ef4327a788f02a8b1e37f460437 smartd.confd" +4a2cbdab37cf0d761924854be4a2f2deebed22ca8d8754dee9a5ec44229c608f5fffb19545d2b9c687ab010460acde51d4f5fccd74d6c80dab2b1a7401d59b9f smartd.initd +9088b97fbaac45e677e5ac14bc8a9edb4bd7a924717bb201db92f4a85447bb0e0254e716c8c8e60d4830b96e3221488fc80b30442b2e4a1b57741535aa2c3e7b smartd.confd" diff --git a/main/smartmontools/smartd.confd b/main/smartmontools/smartd.confd index 4b7db4dfd82..7411cb051ed 100644 --- a/main/smartmontools/smartd.confd +++ b/main/smartmontools/smartd.confd @@ -1,4 +1,10 @@ -# /etc/conf.d/smartd: config file for /etc/init.d/smartd +# Configuration file for /etc/init.d/smartd -# Insert any other options needed -SMARTD_OPTS="" +# Path to the configuration file. +#cfgfile=/etc/smartd.conf + +# Additional options to pass to smartd. +#command_args= + +# Uncomment to use process supervisor. +#supervisor=supervise-daemon diff --git a/main/smartmontools/smartd.initd b/main/smartmontools/smartd.initd index 8c35bf1e024..b117aa95688 100644 --- a/main/smartmontools/smartd.initd +++ b/main/smartmontools/smartd.initd @@ -1,23 +1,31 @@ #!/sbin/openrc-run -supervisor=supervise-daemon name=smartd -description="Daemon to monitor the SMART system built into storage devices" +description="Daemon to monitor the S.M.A.R.T. system built into storage devices" description_reload="Reload configuration without exiting" +extra_started_commands="reload" + +: ${cfgfile:="/etc/smartd.conf"} command=/usr/sbin/smartd -command_args="$SMARTD_OPTS" -command_args_foreground="--no-fork" +command_args="--configfile=$cfgfile --no-fork ${command_args:-$SMARTD_OPTS}" +command_background="yes" +pidfile="/run/$RC_SVCNAME.pid" + +required_files="$cfgfile" depend() { need localmount after bootmisc } -extra_started_commands="reload" - reload() { - ebegin "Reloading configuration" - $supervisor $RC_SVCNAME --signal HUP + ebegin "Reloading $name configuration" + + if [ "$supervisor" ]; then + $supervisor "$RC_SVCNAME" --signal HUP + else + start-stop-daemon --signal HUP --pidfile "$pidfile" + fi eend $? } |