Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I start Net-SNMP from systemd, there is no error message but the daemon does not run:

% sudo systemctl start snmpd

When I start it from the command line, it runs:

% sudo /usr/sbin/snmpd

and answers to SNMP queries.

If I add the debug flags (-LSdd), I see that the daemon launched by systemd is killed immediately after:

Apr  7 15:37:50 localhost snmpd[1298]: NET-SNMP version 5.7.2
Apr  7 15:37:50 localhost snmpd[1298]: Received TERM or STOP signal...  shutting down...

The service file is the default one of the Arch Linux package:

Description=Simple Network Management Protocol (SNMP) Daemon

ExecReload=/bin/kill -HUP $MAINPID


If I add RemainAfterExit=yes in the service file, snmpd works but the machine no longer starts properly (no DHCP client, for instance)

The system is an up-to-date Arch Linux, the version of the package is:

Name           : net-snmp
Version        : 5.7.2-3

There is an old Arch Linux bug report apparently for this very bug:

share|improve this question
This service file apparently works fine:… Now, I would appreciate explanations about why it works and why the default one does not :-) – bortzmeyer Apr 7 '13 at 15:09
up vote 3 down vote accepted

The problem comes from the fork of snmpd during start.

My service file (for Exherbo) forces snmpd to not use fork() (-f) and run the service with Type=simple.

Type=forking is the good way for the default behavior of snmpd, but it is incomplete.

It is highly recommended to specify PIDFile when using Type=forking because systemd is not always able to know which process to monitor after the first process exits.

Just add this:

ExecStart=/usr/sbin/snmpd -p /var/run/

This change will also fix ExecReload.

share|improve this answer
Tested and it works. Thanks. – bortzmeyer Apr 7 '13 at 16:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.