Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snmpd_options parameter does not work with Debian 9 #110

Closed
brigriffin opened this issue Sep 24, 2017 · 8 comments · Fixed by #216
Closed

snmpd_options parameter does not work with Debian 9 #110

brigriffin opened this issue Sep 24, 2017 · 8 comments · Fixed by #216
Labels
bug Something isn't working

Comments

@brigriffin
Copy link

The snmpd_options parameter of this module does not work anymore with Debian 9 (stretch). It looks like modifying the SNMPDOPTS environment variable directly in the /etc/defaults/snmpd file as does this module actually do is not taken in account anymore. Since Debian 9 uses systemd, the default SNMP daemon options are set in /lib/systemd/system/snmpd.service (in the ExecStart parameter). So starting from Debian 9 I think this module needs to use the systemd way in order to customise snmpd's options.

@razorsedge razorsedge added the bug Something isn't working label Jan 7, 2018
@alaunay
Copy link

alaunay commented Feb 24, 2018

That is correct... Here we added a workaround, but it would be nice to see the logic directly into the module:

  case $::lsbdistcodename {
    'stretch': {
      augeas { 'systemd-snmpd-conf':
        context => '/files/lib/systemd/system/snmpd.service/Service/ExecStart',
        changes => [
          'set arguments/1 -LS2d',
        ],
        require => Package['snmpd'],
        notify  => [ Exec['systemd-reload'], Service['snmpd'], ],
      }
      exec { 'systemd-reload':
        command     => '/bin/systemctl daemon-reload',
         refreshonly => true,
      }
    }
    default: { }
  }

With the exec due to systemd being unable to read system conf files directly, as it seems.

@hdep
Copy link
Contributor

hdep commented May 6, 2019

Hi,

I have the same issue.
@bastelfreak is there any work in progress on this issue ?

Maybe the fastest way to fix this is to provide for debian 9 a template for /lib/systemd/system/snmpd.service ?

@bastelfreak
Copy link
Member

@hdep can you provide a patch for this? Also the preferred way custom systemd unit files is /etc/systemd/system/ and not /lib/systemd/system.

@Dan33l
Copy link
Member

Dan33l commented May 8, 2019

Since this module is declared Debian9 compatible and with acceptance tests, they should fail. But they pass.

@hep with your patch can you update acceptance tests to tackle this issue ?

@hdep
Copy link
Contributor

hdep commented May 15, 2019

@bastelfreak on debian 9 the file in /etc/systemd is a link to /lib/systemd

$ ls -al /etc/systemd/system/multi-user.target.wants/snmpd.service
lrwxrwxrwx 1 root root 33 janv.  4 10:02 /etc/systemd/system/multi-user.target.wants/snmpd.service -> /lib/systemd/system/snmpd.service

So I can't do that

@hdep
Copy link
Contributor

hdep commented Aug 28, 2019

I give up because I think fixing rpsec should have been done in another PR.
if anyone can fix the bug this will be great.

@hdep
Copy link
Contributor

hdep commented Feb 20, 2020

bug still present in 5.0.0

@hdep
Copy link
Contributor

hdep commented Apr 5, 2020

fixed in #216

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
6 participants