- regenerate smartd.conf on every startup if the config file is

autogenerated (#190065)
This commit is contained in:
Tomáš Mráz 2006-05-02 13:47:46 +00:00
parent a2e4329f0d
commit 3e097ffd41
3 changed files with 17 additions and 5 deletions

View File

@ -5,7 +5,9 @@ import kudzu
import os import os
drives=kudzu.probe(kudzu.CLASS_HD,kudzu.BUS_IDE|kudzu.BUS_SCSI,kudzu.PROBE_ALL) drives=kudzu.probe(kudzu.CLASS_HD,kudzu.BUS_IDE|kudzu.BUS_SCSI,kudzu.PROBE_ALL)
print """# /etc/smartd.conf print """# *SMARTD*AUTOGENERATED* /etc/smartd.conf
# Remove the line above if you have edited the file and you do not want
# it to be overwritten on the next smartd startup.
# Sample configuration file for smartd. See man 5 smartd.conf. # Sample configuration file for smartd. See man 5 smartd.conf.
# Home page is: http://smartmontools.sourceforge.net # Home page is: http://smartmontools.sourceforge.net

View File

@ -2,7 +2,7 @@
# smartmontools init file for smartd # smartmontools init file for smartd
# Copyright (C) 2002-4 Bruce Allen <smartmontools-support@lists.sourceforge.net> # Copyright (C) 2002-4 Bruce Allen <smartmontools-support@lists.sourceforge.net>
# $Id: smartd.initd,v 1.1 2005/01/07 06:02:58 davej Exp $ # $Id: smartd.initd,v 1.2 2006/05/02 13:47:46 tmraz Exp $
# For RedHat and cousins: # For RedHat and cousins:
# chkconfig: 2345 40 40 # chkconfig: 2345 40 40
@ -32,8 +32,14 @@ SMARTD_BIN=/usr/sbin/smartd
. /etc/rc.d/init.d/functions . /etc/rc.d/init.d/functions
[ -r /etc/sysconfig/smartmontools ] && . /etc/sysconfig/smartmontools [ -r /etc/sysconfig/smartmontools ] && . /etc/sysconfig/smartmontools
[ ! -f /etc/smartd.conf ] && smartd-conf.py > /etc/smartd.conf case "$1" in
start | reload | restart)
GEN_CONF="*SMARTD*AUTOGENERATED*"
[ ! -f /etc/smartd.conf ] || read DUMMY GEN_CONF DUMMY </etc/smartd.conf \
&& [ $GEN_CONF == "*SMARTD*AUTOGENERATED*" ] && smartd-conf.py >/etc/smartd.conf
;;
esac
RETVAL=0 RETVAL=0

View File

@ -1,7 +1,7 @@
Summary: Tools for monitoring SMART capable hard disks Summary: Tools for monitoring SMART capable hard disks
Name: smartmontools Name: smartmontools
Version: 5.33 Version: 5.33
Release: 7 Release: 8
Epoch: 1 Epoch: 1
Group: System Environment/Base Group: System Environment/Base
License: GPL License: GPL
@ -72,6 +72,10 @@ exit 0
%changelog %changelog
* Tue May 2 2006 Tomas Mraz <tmraz@redhat.com> - 1:5.33-8
- regenerate smartd.conf on every startup if the config file
is autogenerated (#190065)
* Fri Mar 24 2006 Tomas Mraz <tmraz@redhat.com> - 1:5.33-7 * Fri Mar 24 2006 Tomas Mraz <tmraz@redhat.com> - 1:5.33-7
- add missing quotes to /etc/sysconfig/smartmontools - add missing quotes to /etc/sysconfig/smartmontools