diff --git a/smartmontools/CHANGELOG b/smartmontools/CHANGELOG index 8dc20b5a78bf50dcdfa85b9528003a6a17d2532d..e2f1aab2cf6a6e1c4c5164cad9aeeb2d6921ef34 100644 --- a/smartmontools/CHANGELOG +++ b/smartmontools/CHANGELOG @@ -43,6 +43,8 @@ NOTES FOR FUTURE RELEASES: see TODO file. <DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE> + [CF] Cygwin: Check for 'syslogd' and 'syslog-ng' in initd script. + [CF] Windows: Disable Win9x/ME specific code if no longer supported by compiler. diff --git a/smartmontools/smartd.initd.in b/smartmontools/smartd.initd.in index 2cd36adb5d437b585e669f3690222b5a5251dc88..29dcaaa85959b227a66f2d513e550e6157e7691b 100755 --- a/smartmontools/smartd.initd.in +++ b/smartmontools/smartd.initd.in @@ -2,7 +2,7 @@ # smartmontools init file for smartd # Copyright (C) 2002-8 Bruce Allen <smartmontools-support@lists.sourceforge.net> -# $Id: smartd.initd.in,v 1.38 2008/03/04 22:09:47 ballen4705 Exp $ +# $Id$ # For RedHat and cousins: # chkconfig: 2345 40 40 @@ -439,15 +439,30 @@ http://smartmontools.sourceforge.net/" install) shift [ $# -eq 0 ] || smartd_opts="$*" - dep= + dep=; dep2= if cygrunsrv -L 2>/dev/null | grep "^syslogd$" >/dev/null 2>&1; then - dep="-y syslogd" + dep="syslogd" + fi + if cygrunsrv -L 2>/dev/null | grep "^syslog-ng" >/dev/null 2>&1; then + dep2="syslog-ng" + fi + if [ -z "$dep" ]; then + if [ -z "$dep2" ]; then + echo "Warning: no syslog service installed, smartd will write to windows event log."; + else + dep="$dep2" + fi else - echo "Warning: syslogd service not installed, smartd will write to windows event log."; + if [ -z "$dep2" ]; then + : + else + dep= + echo "Warning: both syslogd and syslog-ng installed, dependency not set." + fi fi - echo "Installing service ${smartd_svcname}${smartd_opts+ with options '$smartd_opts'}:" - cygrunsrv -I "$smartd_svcname" -d "$smartd_svcdisp" -f "$smartd_svcdesc" $dep \ - -e CYGWIN="$CYGWIN" -p $SMARTD_BIN -a "-n -p ${PID_FILE}${smartd_opts+ }$smartd_opts" + echo "Installing service ${smartd_svcname}${dep:+ (depending on '$dep')}${smartd_opts:+ with options '$smartd_opts'}:" + cygrunsrv -I "$smartd_svcname" -d "$smartd_svcdisp" -f "$smartd_svcdesc" ${dep:+-y} $dep \ + -e CYGWIN="$CYGWIN" -p $SMARTD_BIN -a "-n -p ${PID_FILE}${smartd_opts:+ }$smartd_opts" RETVAL=$? ;; remove)