[Bug 1192319] [NEW] snmpd init script uses start-stop-daemon without pidfile argument

Nic Bernstein nic at onlight.com
Tue Jun 18 20:17:17 UTC 2013


Public bug reported:

The snmpd.init file in Precise, Quantal, Raring and Saucy invokes start-
stop-daemon without the --pidfile argument.  This causes all instances
of snmpd to die when used on an LXC parent host, for example.

>From the man page for start-stop-daemon:
       Note: unless --pidfile is specified, start-stop-daemon behaves  similar
       to  killall(1).   start-stop-daemon will scan the process table looking
       for any processes which match the process name,  uid,  and/or  gid  (if
       specified). Any matching process will prevent --start from starting the
       daemon. All matching processes will be sent the TERM signal (or the one
       specified  via --signal or --retry) if --stop is specified. For daemons
       which have long-lived children which need to live through a --stop, you
       must specify a pidfile.

In an LXC environment, all the container processes appear in the parent
host's process table, thus "service snmpd {restart|stop}" will kill all
running snmpd instances, even those in child containers.

In Precise, Quantal and Raring (5.4.3~dfsg-...), this is typical of how the process is stopped:
   start-stop-daemon --quiet --stop --oknodo --exec /usr/sbin/snmpd

In saucy (5.7.2~dfsg-4ubuntu1) this is typical of how the process is stopped:
   start-stop-daemon --quiet --stop --oknodo --exec /usr/sbin/snmpd && [ ! -f $SNMP_PID ] || rm $SNMP_PID

In all cases, --pidfile should be used to constrain the action of start-
stop-daemon.

Observed empirically in snmpd-5.4.3~dfsg-2.4ubuntu1.1, observed in
source packages for 5.4.3~dfsg-2.7ubuntu and 5.7.2~dfsg-4ubuntu1 on
launchpad.

** Affects: net-snmp (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: init.d snmpd start-stop-daemon

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to net-snmp in Ubuntu.
https://bugs.launchpad.net/bugs/1192319

Title:
  snmpd init script uses start-stop-daemon without pidfile argument

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/net-snmp/+bug/1192319/+subscriptions



More information about the Ubuntu-server-bugs mailing list