Hide Forgot
Description of problem: /lib/systemd/system/snmpd.service hard codes arguments instead of sourcing an /etc/sysconfig file. Version-Release number of selected component (if applicable): net-snmp-5.7.1-2.fc16.x86_64 How reproducible: Always Steps to Reproduce: 1. Start snmpd service Actual results: Starts with "-LS0-6d -f" as arguments. Expected results: Starts with $OPTIONS or some other sourced variable from /etc/sysconfig/snmpd (or whatever) that has arguments of my choosing. Additional info:
I thought following simple /etc/systemd/services/snmpd.service could work, but I got bitten by systemd, it does not like two ExecStart options :( [Service] ExecStart=/usr/sbin/snmpd -LS0-5d -f .include /lib/systemd/system/snmpd.service Can't you copy /lib/systemd/system/snmpd.service to /etc/systemd/system/snmpd.service and edit it there? /etc/sysconfig kind of sucks. IMHO most users don't really need to edit snmpd options.
If /etc/systemd is supposed to be taking over the role of /etc/sysconfig as well as /etc/init.d that is fine, but I haven't read anything that leads me to believe that. I'm happy moving on to the new hotness of systemd, but losing configurability should not be part of that migration. Copying the file to /etc/systemd/system and replacing it with: [Unit] Description=Simple Network Management Protocol (SNMP) Daemon. After=syslog.target network.target [Service] Type=notify Environment=SNMPDLOG="-LS0-6d" EnvironmentFile=-/etc/sysconfig/snmpd ExecStart=/usr/sbin/snmpd $SNMPDLOG $SNMPDARGS -f ExecReload=/bin/kill -HUP $MAINPID [Install] WantedBy=multi-user.target has been a reasonable workaround for me but doing so leaves me stranded if net-snmp actually does update their /lib/systemd service file.
(In reply to comment #2) > Copying the file to /etc/systemd/system and replacing it with: > > [Unit] > Description=Simple Network Management Protocol (SNMP) Daemon. > After=syslog.target network.target > > [Service] > Type=notify > Environment=SNMPDLOG="-LS0-6d" > EnvironmentFile=-/etc/sysconfig/snmpd > ExecStart=/usr/sbin/snmpd $SNMPDLOG $SNMPDARGS -f > ExecReload=/bin/kill -HUP $MAINPID > > [Install] > WantedBy=multi-user.target > > > has been a reasonable workaround for me but doing so leaves me stranded if > net-snmp actually does update their /lib/systemd service file. This should work well through F16 lifecycle - I do not plan to update service file there unless absolutely necessary. I added /etc/systemd/snmpd to rawhide.