From 3468c59c5cc382a66621bace78648479dc853db0 Mon Sep 17 00:00:00 2001 From: Chen Qi Date: Thu, 25 Sep 2014 16:48:37 +0800 Subject: smartmontools: fix for its SysV init script Changes include: 1. Make it run at runlevel 2, 3, 4 and 5 by default. 2. Add /etc/default/smartmontools, just as Ubuntu does. Signed-off-by: Chen Qi Signed-off-by: Martin Jansa --- meta-oe/recipes-extended/smartmontools/files/initd.smartd | 8 ++++++-- .../recipes-extended/smartmontools/files/smartmontools.default | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 meta-oe/recipes-extended/smartmontools/files/smartmontools.default (limited to 'meta-oe/recipes-extended/smartmontools/files') diff --git a/meta-oe/recipes-extended/smartmontools/files/initd.smartd b/meta-oe/recipes-extended/smartmontools/files/initd.smartd index 29c27e4756..54adcb406b 100755 --- a/meta-oe/recipes-extended/smartmontools/files/initd.smartd +++ b/meta-oe/recipes-extended/smartmontools/files/initd.smartd @@ -16,8 +16,8 @@ # Should-Start: sendmail # Required-Stop: $syslog $remote_fs # Should-Stop: sendmail -# Default-Start: -# Default-Stop: 0 1 2 3 4 5 6 +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 # Short-Description: Monitors disk and tape health via S.M.A.R.T. # Description: Start S.M.A.R.T. disk and tape monitor. ### END INIT INFO @@ -52,6 +52,10 @@ smartd_opts="--pidfile $SMARTDPID $smartd_opts" case "$1" in start) + if [ "$start_smartd" != "yes" ]; then + [ "$VERBOSE" != "no" ] && echo "Not starting S.M.A.R.T. daemon smartd, disabled via /etc/default/smartmontools" + exit 0 + fi echo -n "Starting S.M.A.R.T. daemon: smartd" if start-stop-daemon --start --quiet --pidfile $SMARTDPID \ --exec $SMARTD_BIN -- $smartd_opts; then diff --git a/meta-oe/recipes-extended/smartmontools/files/smartmontools.default b/meta-oe/recipes-extended/smartmontools/files/smartmontools.default new file mode 100644 index 0000000000..602e00beb1 --- /dev/null +++ b/meta-oe/recipes-extended/smartmontools/files/smartmontools.default @@ -0,0 +1,6 @@ +# uncomment to start smartd on system startup for SysV init script +# For systemd service file, use `systemctl enable smartd'. +#start_smartd=yes + +# uncomment to pass additional options to smartd on startup +#smartd_opts="--interval=1800" -- cgit v1.2.3-54-g00ecf