[Pkg-net-snmp-commits] r286 - branches/net-snmp54/debian branches/net-snmp54-dev/debian trunk/debian
Jochen Friedrich
jochen at alioth.debian.org
Fri Nov 6 13:12:49 UTC 2009
Author: jochen
Date: 2009-11-06 13:12:49 +0000 (Fri, 06 Nov 2009)
New Revision: 286
Modified:
branches/net-snmp54-dev/debian/snmpd.default
branches/net-snmp54-dev/debian/snmpd.postinst
branches/net-snmp54-dev/debian/snmpd.postrm
branches/net-snmp54/debian/snmpd.default
branches/net-snmp54/debian/snmpd.postinst
branches/net-snmp54/debian/snmpd.postrm
trunk/debian/snmpd.default
trunk/debian/snmpd.postinst
trunk/debian/snmpd.postrm
Log:
Run snmpd as group snmp. Patch from Russell Coker <russell at coker.com.au>.
Modified: branches/net-snmp54/debian/snmpd.default
===================================================================
--- branches/net-snmp54/debian/snmpd.default 2009-11-03 17:20:42 UTC (rev 285)
+++ branches/net-snmp54/debian/snmpd.default 2009-11-06 13:12:49 UTC (rev 286)
@@ -8,7 +8,7 @@
SNMPDRUN=yes
# snmpd options (use syslog, close stdin/out/err).
-SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'
+SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'
# snmptrapd control (yes means start daemon). As of net-snmp version
# 5.0, master agentx support must be enabled in snmpd before snmptrapd
Modified: branches/net-snmp54/debian/snmpd.postinst
===================================================================
--- branches/net-snmp54/debian/snmpd.postinst 2009-11-03 17:20:42 UTC (rev 285)
+++ branches/net-snmp54/debian/snmpd.postinst 2009-11-06 13:12:49 UTC (rev 286)
@@ -3,8 +3,8 @@
set -e
if [ "x$1" = xconfigure ]; then
- adduser --quiet --system --no-create-home --home /var/lib/snmp snmp
- chown -R snmp /var/lib/snmp
+ adduser --quiet --system --group --no-create-home --home /var/lib/snmp snmp
+ chown -R snmp:snmp /var/lib/snmp
fi
. /usr/share/debconf/confmodule
Modified: branches/net-snmp54/debian/snmpd.postrm
===================================================================
--- branches/net-snmp54/debian/snmpd.postrm 2009-11-03 17:20:42 UTC (rev 285)
+++ branches/net-snmp54/debian/snmpd.postrm 2009-11-06 13:12:49 UTC (rev 286)
@@ -10,11 +10,20 @@
rm -f /var/run/agentx
rm -f /var/run/snmpd.pid
rm -f /var/run/snmptrapd.pid
- if [ -x /usr/sbin/deluser ]; then
- deluser --quiet --system snmp
- else
- echo "Can't remove user snmp. Please remove this user by hand."
+ if getent passwd snmp >/dev/null; then
+ if [ -x /usr/sbin/deluser ]; then
+ deluser --quiet --system snmp
+ else
+ echo "Can't remove user snmp. Please remove this user by hand."
+ fi
fi
+ if getent group snmp >/dev/null; then
+ if [ -x /usr/sbin/delgroup ]; then
+ delgroup --quiet --system snmp
+ else
+ echo "Can't remove group snmp. Please remove this group by hand."
+ fi
+ fi
fi
exit 0
Modified: branches/net-snmp54-dev/debian/snmpd.default
===================================================================
--- branches/net-snmp54-dev/debian/snmpd.default 2009-11-03 17:20:42 UTC (rev 285)
+++ branches/net-snmp54-dev/debian/snmpd.default 2009-11-06 13:12:49 UTC (rev 286)
@@ -8,7 +8,7 @@
SNMPDRUN=yes
# snmpd options (use syslog, close stdin/out/err).
-SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'
+SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'
# snmptrapd control (yes means start daemon). As of net-snmp version
# 5.0, master agentx support must be enabled in snmpd before snmptrapd
Modified: branches/net-snmp54-dev/debian/snmpd.postinst
===================================================================
--- branches/net-snmp54-dev/debian/snmpd.postinst 2009-11-03 17:20:42 UTC (rev 285)
+++ branches/net-snmp54-dev/debian/snmpd.postinst 2009-11-06 13:12:49 UTC (rev 286)
@@ -3,8 +3,8 @@
set -e
if [ "x$1" = xconfigure ]; then
- adduser --quiet --system --no-create-home --home /var/lib/snmp snmp
- chown -R snmp /var/lib/snmp
+ adduser --quiet --system --group --no-create-home --home /var/lib/snmp snmp
+ chown -R snmp:snmp /var/lib/snmp
fi
. /usr/share/debconf/confmodule
Modified: branches/net-snmp54-dev/debian/snmpd.postrm
===================================================================
--- branches/net-snmp54-dev/debian/snmpd.postrm 2009-11-03 17:20:42 UTC (rev 285)
+++ branches/net-snmp54-dev/debian/snmpd.postrm 2009-11-06 13:12:49 UTC (rev 286)
@@ -10,11 +10,20 @@
rm -f /var/run/agentx
rm -f /var/run/snmpd.pid
rm -f /var/run/snmptrapd.pid
- if [ -x /usr/sbin/deluser ]; then
- deluser --quiet --system snmp
- else
- echo "Can't remove user snmp. Please remove this user by hand."
+ if getent passwd snmp >/dev/null; then
+ if [ -x /usr/sbin/deluser ]; then
+ deluser --quiet --system snmp
+ else
+ echo "Can't remove user snmp. Please remove this user by hand."
+ fi
fi
+ if getent group snmp >/dev/null; then
+ if [ -x /usr/sbin/delgroup ]; then
+ delgroup --quiet --system snmp
+ else
+ echo "Can't remove group snmp. Please remove this group by hand."
+ fi
+ fi
fi
exit 0
Modified: trunk/debian/snmpd.default
===================================================================
--- trunk/debian/snmpd.default 2009-11-03 17:20:42 UTC (rev 285)
+++ trunk/debian/snmpd.default 2009-11-06 13:12:49 UTC (rev 286)
@@ -8,7 +8,7 @@
SNMPDRUN=yes
# snmpd options (use syslog, close stdin/out/err).
-SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'
+SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'
# snmptrapd control (yes means start daemon). As of net-snmp version
# 5.0, master agentx support must be enabled in snmpd before snmptrapd
@@ -18,3 +18,5 @@
# snmptrapd options (use syslog).
TRAPDOPTS='-Lsd -p /var/run/snmptrapd.pid'
+# create symlink on Debian legacy location to official RFC path
+SNMPDCOMPAT=yes
Modified: trunk/debian/snmpd.postinst
===================================================================
--- trunk/debian/snmpd.postinst 2009-11-03 17:20:42 UTC (rev 285)
+++ trunk/debian/snmpd.postinst 2009-11-06 13:12:49 UTC (rev 286)
@@ -3,15 +3,10 @@
set -e
if [ "x$1" = xconfigure ]; then
- adduser --quiet --system --no-create-home --home /var/lib/snmp snmp
- chown -R snmp /var/lib/snmp
+ adduser --quiet --system --group --no-create-home --home /var/lib/snmp snmp
+ chown -R snmp:snmp /var/lib/snmp
fi
-if [ -S /var/run/agentx ]; then
- rm -f /var/run/agentx
- ln -sf /var/agentx/socket /var/run/agentx
-fi
-
. /usr/share/debconf/confmodule
db_version 2.0
Modified: trunk/debian/snmpd.postrm
===================================================================
--- trunk/debian/snmpd.postrm 2009-11-03 17:20:42 UTC (rev 285)
+++ trunk/debian/snmpd.postrm 2009-11-06 13:12:49 UTC (rev 286)
@@ -10,11 +10,20 @@
rm -f /var/run/agentx
rm -f /var/run/snmpd.pid
rm -f /var/run/snmptrapd.pid
- if [ -x /usr/sbin/deluser ]; then
- deluser --quiet --system snmp
- else
- echo "Can't remove user snmp. Please remove this user by hand."
+ if getent passwd snmp >/dev/null; then
+ if [ -x /usr/sbin/deluser ]; then
+ deluser --quiet --system snmp
+ else
+ echo "Can't remove user snmp. Please remove this user by hand."
+ fi
fi
+ if getent group snmp >/dev/null; then
+ if [ -x /usr/sbin/delgroup ]; then
+ delgroup --quiet --system snmp
+ else
+ echo "Can't remove group snmp. Please remove this group by hand."
+ fi
+ fi
fi
exit 0
More information about the Pkg-net-snmp-commits
mailing list