Update of /cvsroot/sblim/cmpi-syslog/syslog-service/util
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27140/syslog-service/util
Modified Files:
syslog-service.sh syslogserviceutil.c
Log Message:
patchset and version bump for 0.9.0 release
Index: syslogserviceutil.c
===================================================================
RCS file: /cvsroot/sblim/cmpi-syslog/syslog-service/util/syslogserviceutil.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- syslogserviceutil.c 8 Jun 2011 22:17:24 -0000 1.9
+++ syslogserviceutil.c 24 Jul 2013 16:55:35 -0000 1.10
@@ -79,7 +79,7 @@
svname);
if (strcmp(svname, "syslogd")==0) svc->syslogd = pid;
if (strcmp(svname, "klogd")==0) svc->klogd = pid;
- if (strcmp(svname, "rsyslogd")==0) {
+ if (strcmp(svname, "rsyslog")==0) {
/* rsyslog acts as both syslog and klogd */
svc->syslogd = svc->klogd = pid;
}
@@ -154,11 +154,15 @@
goto err;
if (!(fcmdout = fopen(cmdout,"r")))
goto err;
+/* there's no output from systemctl */
+/*
if (fgets(result,resultlen,fcmdout)) {
fclose(fcmdout);
return 0;
}
+*/
fclose(fcmdout);
+ return 0;
}
err:
Index: syslog-service.sh
===================================================================
RCS file: /cvsroot/sblim/cmpi-syslog/syslog-service/util/syslog-service.sh,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- syslog-service.sh 8 Jun 2011 22:17:24 -0000 1.6
+++ syslog-service.sh 24 Jul 2013 16:55:35 -0000 1.7
@@ -23,45 +23,55 @@
if [ -f /etc/redhat-release ]
then
-if [ -x /etc/init.d/syslog ];
+if [ -x /etc/init.d/syslog ]
+then
+ initscript=syslog
+elif [ -x /etc/init.d/rsyslog ]
+then
+ initscript=rsyslog
+else
+ initscript=""
+fi
+
+if [ -n "$initscript" ]
then
case "$1" in
start)
- /etc/init.d/syslog start
+ /etc/init.d/$initscript start
;;
stop)
- /etc/init.d/syslog stop
+ /etc/init.d/$initscript stop
;;
restart|reload)
- /etc/init.d/syslog restart
+ /etc/init.d/$initscript restart
;;
condrestart)
- /etc/init.d/syslog condrestart
+ /etc/init.d/$initscript condrestart
;;
status)
- /etc/init.d/syslog status | awk '{print $3 " " $1}' | tr -d '=)='
+ /etc/init.d/$initscript status | awk '{print $3 " " $1}' | tr -d '=)='
;;
*)
echo "Unsupported method for RedHat!"
exit 0
esac
-elif [ -x /etc/init.d/rsyslog ];
+elif [ -f /lib/systemd/system/rsyslog.service ];
then
case "$1" in
start)
- /etc/init.d/rsyslog start
+ systemctl start rsyslog.service
;;
stop)
- /etc/init.d/rsyslog stop
+ systemctl stop rsyslog.service
;;
restart|reload)
- /etc/init.d/rsyslog restart
+ systemctl restart rsyslog.service
;;
condrestart)
- /etc/init.d/rsyslog condrestart
+ systemctl condrestart rsyslog.service
;;
status)
- output=`/etc/init.d/rsyslog status`
+ output=`systemctl status rsyslog.service`
if echo "$output" | grep Active: | grep inactive > /dev/null 2>&1; then
echo "stopped"
else
|