Skip to content
Snippets Groups Projects
Commit 08f5ba14 authored by chrfranke's avatar chrfranke
Browse files

Cygwin: Check for 'syslogd' and 'syslog-ng' in initd script.

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@3003 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent 55c518a3
No related branches found
No related tags found
No related merge requests found
...@@ -43,6 +43,8 @@ NOTES FOR FUTURE RELEASES: see TODO file. ...@@ -43,6 +43,8 @@ NOTES FOR FUTURE RELEASES: see TODO file.
<DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE> <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 [CF] Windows: Disable Win9x/ME specific code if no longer supported
by compiler. by compiler.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# smartmontools init file for smartd # smartmontools init file for smartd
# Copyright (C) 2002-8 Bruce Allen <smartmontools-support@lists.sourceforge.net> # 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: # For RedHat and cousins:
# chkconfig: 2345 40 40 # chkconfig: 2345 40 40
...@@ -439,15 +439,30 @@ http://smartmontools.sourceforge.net/" ...@@ -439,15 +439,30 @@ http://smartmontools.sourceforge.net/"
install) install)
shift shift
[ $# -eq 0 ] || smartd_opts="$*" [ $# -eq 0 ] || smartd_opts="$*"
dep= dep=; dep2=
if cygrunsrv -L 2>/dev/null | grep "^syslogd$" >/dev/null 2>&1; then 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
if [ -z "$dep2" ]; then
:
else else
echo "Warning: syslogd service not installed, smartd will write to windows event log."; dep=
echo "Warning: both syslogd and syslog-ng installed, dependency not set."
fi
fi fi
echo "Installing service ${smartd_svcname}${smartd_opts+ with options '$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 \ 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" -e CYGWIN="$CYGWIN" -p $SMARTD_BIN -a "-n -p ${PID_FILE}${smartd_opts:+ }$smartd_opts"
RETVAL=$? RETVAL=$?
;; ;;
remove) remove)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment