[csw-devel] SF.net SVN: gar:[21537] csw/mgar/pkg/netsnmp/trunk

cgrzemba at users.sourceforge.net cgrzemba at users.sourceforge.net
Mon Jul 22 13:20:00 CEST 2013


Revision: 21537
          http://gar.svn.sourceforge.net/gar/?rev=21537&view=rev
Author:   cgrzemba
Date:     2013-07-22 11:19:59 +0000 (Mon, 22 Jul 2013)
Log Message:
-----------
netsnmp/trunk: fix init script

Modified Paths:
--------------
    csw/mgar/pkg/netsnmp/trunk/Makefile

Added Paths:
-----------
    csw/mgar/pkg/netsnmp/trunk/files/0001-fixing-init-scripts.patch

Removed Paths:
-------------
    csw/mgar/pkg/netsnmp/trunk/files/0001-remove-linux-specials.patch

Modified: csw/mgar/pkg/netsnmp/trunk/Makefile
===================================================================
--- csw/mgar/pkg/netsnmp/trunk/Makefile	2013-07-22 10:02:40 UTC (rev 21536)
+++ csw/mgar/pkg/netsnmp/trunk/Makefile	2013-07-22 11:19:59 UTC (rev 21537)
@@ -30,7 +30,7 @@
 # Patch for python module
 PATCHFILES += Makefile.in.diff
 PATCHFILES += setup-py.patch
-PATCHFILES += 0001-remove-linux-specials.patch
+PATCHFILES += 0001-fixing-init-scripts.patch
 
 VENDOR_URL = http://www.net-snmp.org/
 
@@ -38,8 +38,8 @@
 BUILD_DEP_PKGS = CSWpysetuptools
 PACKAGING_PLATFORMS += solaris10-sparc solaris10-i386
 
-INITSMF = $(sysconfdir)/init.d/snmpd
-INITSMF += $(sysconfdir)/init.d/snmptrapd
+INITSMF = $(sysconfdir)/init.d/netsnmpd
+INITSMF += $(sysconfdir)/init.d/netsnmptrapd
 
 PACKAGES += CSWnetsnmp-dev
 CATALOGNAME_CSWnetsnmp-dev = netsnmp_dev
@@ -198,8 +198,8 @@
 post-install:
 	ginstall -d $(DESTDIR)/$(sysconfdir)/init.d
 	ginstall -d $(DESTDIR)/$(sysconfdir)/snmp
-	ginstall -m 755	$(WORKSRC)/dist/snmpd-init.d $(DESTDIR)/$(sysconfdir)/init.d/snmpd
-	ginstall -m 755	$(WORKSRC)/dist/snmptrapd-init.d $(DESTDIR)/$(sysconfdir)/init.d/snmptrapd
+	ginstall -m 755	$(WORKSRC)/dist/snmpd-init.d $(DESTDIR)/$(sysconfdir)/init.d/netsnmpd
+	ginstall -m 755	$(WORKSRC)/dist/snmptrapd-init.d $(DESTDIR)/$(sysconfdir)/init.d/netsnmptrapd
 	ginstall -m 755	$(WORKSRC)/EXAMPLE.conf $(DESTDIR)/$(sysconfdir)/snmp/snmpd.conf
 	@$(MAKECOOKIE)
 

Added: csw/mgar/pkg/netsnmp/trunk/files/0001-fixing-init-scripts.patch
===================================================================
--- csw/mgar/pkg/netsnmp/trunk/files/0001-fixing-init-scripts.patch	                        (rev 0)
+++ csw/mgar/pkg/netsnmp/trunk/files/0001-fixing-init-scripts.patch	2013-07-22 11:19:59 UTC (rev 21537)
@@ -0,0 +1,170 @@
+From a3fb8b0eaa2b8105120b689240cb64f66e80c89b Mon Sep 17 00:00:00 2001
+From: Carsten Grzemba <cgrzemba at opencsw.org>
+Date: Mon, 22 Jul 2013 12:13:13 +0200
+Subject: [PATCH] fixing init scripts
+
+---
+ dist/snmpd-init.d     | 43 +++++++++++++++++++++----------------------
+ dist/snmptrapd-init.d | 31 ++++++++++---------------------
+ 2 files changed, 31 insertions(+), 43 deletions(-)
+
+diff --git a/dist/snmpd-init.d b/dist/snmpd-init.d
+index bd15b00..9e25f6c 100755
+--- a/dist/snmpd-init.d
++++ b/dist/snmpd-init.d
+@@ -6,38 +6,29 @@
+ # chkconfig: - 26 74
+ # description: snmpd is net-snmp SNMP daemon.
+ 
+-# Source function library.
+-. /etc/rc.d/init.d/functions
+-
+-# Source networking configuration.
+-. /etc/sysconfig/network
+-
+-# Check that networking is up.
+-[ "${NETWORKING}" = "no" ] && exit 0
+-
+ RETVAL=0
+-name="snmpd"
+-prog="/usr/local/sbin/snmpd"
+-
+-[ -x $prog -a -f /usr/local/share/snmp/snmpd.conf ] || exit 0
++prog="/opt/csw/sbin/snmpd"
++name=`basename $prog`
+ 
+ start() {
++	[ -x $prog -a -f /etc/opt/csw/snmp/snmpd.conf ] || exit 1
++
+         # Start daemons.
+-        echo -n $"Starting $name: "
+-        daemon $prog
++        echo -n "Starting $name: "
++        $prog
+ 	RETVAL=$?
+         echo
+-        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$name
++        [ $RETVAL -eq 0 ] && touch /var/run/daemon/$name
+ 	return $RETVAL
+ }
+ 
+ stop() {
+         # Stop daemons.
+-        echo -n $"Shutting down $name: "
+-	killproc $prog
++        echo -n "Shutting down $name: "
++	pkill -z `zonename` -x $name
+ 	RETVAL=$?
+         echo
+-        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$name
++        [ $RETVAL -eq 0 ] && rm -f /var/run/daemon/$name
+ 	return $RETVAL
+ }
+ 
+@@ -50,8 +41,16 @@ case "$1" in
+ 	stop
+         ;;
+   status)
+-	status $name
++        [ -x $prog ] || (RETVAL=$?; echo "$prog not executable")
++        [ -f /etc/opt/csw/snmp/snmpd.conf ] || (RETVAL=$?; echo "configfile missing")
++
++	pgrep -l -z `zonename` -x $name
+ 	RETVAL=$?
++        if [ $RETVAL -eq 0 ]; then
++                echo "$name running"
++        else
++                echo "$name not running"
++        fi
+ 	;;
+   restart|reload)
+ 	stop
+@@ -59,14 +58,14 @@ case "$1" in
+ 	RETVAL=$?
+ 	;;
+   condrestart)
+-	if [ -f /var/lock/subsys/$name ]; then
++	if [ -f /var/run/daemon/$name ]; then
+ 	    stop
+ 	    start
+ 	    RETVAL=$?
+ 	fi
+ 	;;
+   *)
+-        echo $"Usage: $0 {start|stop|restart|condrestart|status}"
++        echo "Usage: $0 {start|stop|restart|condrestart|status}"
+         exit 1
+ esac
+ 
+diff --git a/dist/snmptrapd-init.d b/dist/snmptrapd-init.d
+index 8225242..160ce5b 100644
+--- a/dist/snmptrapd-init.d
++++ b/dist/snmptrapd-init.d
+@@ -6,38 +6,27 @@
+ # chkconfig: - 25 75
+ # description: snmptrapd is net-snmp SNMPTRAP daemon.
+ 
+-# Source function library.
+-. /etc/rc.d/init.d/functions
+-
+-# Source networking configuration.
+-. /etc/sysconfig/network
+-
+-# Check that networking is up.
+-[ "${NETWORKING}" = "no" ] && exit 0
+-
+ RETVAL=0
+-name="snmptrapd"
+-prog="/usr/local/sbin/snmptrapd"
+-
+-[ -x $prog ] || exit 0
++prog="/opt/csw/sbin/snmptrapd"
++name=`basename $prog`
+ 
+ start() {
+         # Start daemons.
+-        echo -n $"Starting $name: "
+-        daemon $prog
++        echo -n "Starting $name: "
++        $prog
+ 	RETVAL=$?
+         echo
+-        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$name
++        [ $RETVAL -eq 0 ] && touch /var/run/daemon/$name
+ 	return $RETVAL
+ }
+ 
+ stop() {
+         # Stop daemons.
+-        echo -n $"Shutting down $name: "
+-	killproc $prog
++        echo -n "Shutting down $name: "
++	pkill -z `zonename` -x $name
+ 	RETVAL=$?
+         echo
+-        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$name
++        [ $RETVAL -eq 0 ] && rm -f /var/run/daemon/$name
+ 	return $RETVAL
+ }
+ 
+@@ -50,7 +39,7 @@ case "$1" in
+ 	stop
+         ;;
+   status)
+-	status $name
++	pgrep -l -z `zonename` -x $name
+ 	RETVAL=$?
+ 	;;
+   restart|reload)
+@@ -59,7 +48,7 @@ case "$1" in
+ 	RETVAL=$?
+ 	;;
+   condrestart)
+-	if [ -f /var/lock/subsys/$name ]; then
++	if [ -f /var/run/daemon/$name ]; then
+ 	    stop
+ 	    start
+ 	    RETVAL=$?
+-- 
+1.8.3.1
+

Deleted: csw/mgar/pkg/netsnmp/trunk/files/0001-remove-linux-specials.patch
===================================================================
--- csw/mgar/pkg/netsnmp/trunk/files/0001-remove-linux-specials.patch	2013-07-22 10:02:40 UTC (rev 21536)
+++ csw/mgar/pkg/netsnmp/trunk/files/0001-remove-linux-specials.patch	2013-07-22 11:19:59 UTC (rev 21537)
@@ -1,96 +0,0 @@
-From 449bf468f7d928c06c1ce893b36ba100e92abd1b Mon Sep 17 00:00:00 2001
-From: Carsten Grzemba <cgrzemba at opencsw.org>
-Date: Thu, 18 Jul 2013 16:59:00 +0200
-Subject: [PATCH] remove-linux-specials
-
----
- dist/snmpd-init.d     | 17 ++++-------------
- dist/snmptrapd-init.d | 15 +++------------
- 2 files changed, 7 insertions(+), 25 deletions(-)
-
-diff --git a/dist/snmpd-init.d b/dist/snmpd-init.d
-index bd15b00..ba4140b 100755
---- a/dist/snmpd-init.d
-+++ b/dist/snmpd-init.d
-@@ -6,25 +6,16 @@
- # chkconfig: - 26 74
- # description: snmpd is net-snmp SNMP daemon.
- 
--# Source function library.
--. /etc/rc.d/init.d/functions
--
--# Source networking configuration.
--. /etc/sysconfig/network
--
--# Check that networking is up.
--[ "${NETWORKING}" = "no" ] && exit 0
--
- RETVAL=0
- name="snmpd"
--prog="/usr/local/sbin/snmpd"
-+prog="/opt/csw/sbin/snmpd"
- 
--[ -x $prog -a -f /usr/local/share/snmp/snmpd.conf ] || exit 0
-+[ -x $prog -a -f /etc/opt/csw/snmp/snmpd.conf ] || exit 0
- 
- start() {
-         # Start daemons.
-         echo -n $"Starting $name: "
--        daemon $prog
-+        $prog
- 	RETVAL=$?
-         echo
-         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$name
-@@ -34,7 +25,7 @@ start() {
- stop() {
-         # Stop daemons.
-         echo -n $"Shutting down $name: "
--	killproc $prog
-+	pkill `basename $prog`
- 	RETVAL=$?
-         echo
-         [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$name
-diff --git a/dist/snmptrapd-init.d b/dist/snmptrapd-init.d
-index 8225242..b61debc 100644
---- a/dist/snmptrapd-init.d
-+++ b/dist/snmptrapd-init.d
-@@ -6,25 +6,16 @@
- # chkconfig: - 25 75
- # description: snmptrapd is net-snmp SNMPTRAP daemon.
- 
--# Source function library.
--. /etc/rc.d/init.d/functions
--
--# Source networking configuration.
--. /etc/sysconfig/network
--
--# Check that networking is up.
--[ "${NETWORKING}" = "no" ] && exit 0
--
- RETVAL=0
- name="snmptrapd"
--prog="/usr/local/sbin/snmptrapd"
-+prog="/opt/csw/sbin/snmptrapd"
- 
- [ -x $prog ] || exit 0
- 
- start() {
-         # Start daemons.
-         echo -n $"Starting $name: "
--        daemon $prog
-+        $prog
- 	RETVAL=$?
-         echo
-         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$name
-@@ -34,7 +25,7 @@ start() {
- stop() {
-         # Stop daemons.
-         echo -n $"Shutting down $name: "
--	killproc $prog
-+	pkill `basename $prog`
- 	RETVAL=$?
-         echo
-         [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$name
--- 
-1.8.3.1
-

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list