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

Debian Stretch (new stable) use a different user for snmpd #108

Closed
eLvErDe opened this issue Jun 27, 2017 · 8 comments
Closed

Debian Stretch (new stable) use a different user for snmpd #108

eLvErDe opened this issue Jun 27, 2017 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@eLvErDe
Copy link

eLvErDe commented Jun 27, 2017

Hi,

Here is the new user for snmpd:

Debian-snmp     Debian-snmp     /usr/sbin/snmpd -Lsd -Lf /dev/null -u Debian-snmp -g Debian-snmp -I -smux mteTrigger mteTriggerConf -f
cat /etc/debian_version 
9.0

Regards, Adam.

@hotid
Copy link

hotid commented Jun 28, 2017

diff --git a/manifests/params.pp b/manifests/params.pp
index 1c9566d..c531828 100644
--- a/manifests/params.pp
+++ b/manifests/params.pp
@@ -472,8 +472,14 @@ class snmp::params {
       $sysconfig                = '/etc/default/snmpd'
       $var_net_snmp             = '/var/lib/snmp'
       $varnetsnmp_perms         = '0755'
-      $varnetsnmp_owner         = 'snmp'
-      $varnetsnmp_group         = 'snmp'
+
+      if (versioncmp($::operatingsystemmajrelease, '9') >= 0) {
+        $varnetsnmp_owner = 'Debian-snmp'
+        $varnetsnmp_group = 'Debian-snmp'
+      } else {
+        $varnetsnmp_owner         = 'snmp'
+        $varnetsnmp_group         = 'snmp'
+      }

       $client_package_name      = 'snmp'
       $client_config            = '/etc/snmp/snmp.conf'

@tamepenguin
Copy link

diff --git a/tmp/origsnmp/manifests/params.pp b/manifests/params.pp
index 1c9566d..15ee810 100644
--- a/tmp/origsnmp/manifests/params.pp
+++ b/manifests/params.pp
@@ -463,17 +463,22 @@ class snmp::params {
       $trap_service_name        = 'snmptrapd'
     }
     'Debian': {
+      if $::operatingsystemmajrelease == "9" {
+        $varnetsnmp_owner = "Debian-snmp"
+        $varnetsnmp_group = "Debian-snmp"
+      } else {
+        $varnetsnmp_owner = "snmp"
+        $varnetsnmp_group = "snmp"
+      }
       $package_name             = 'snmpd'
       $service_config           = '/etc/snmp/snmpd.conf'
       $service_config_perms     = '0600'
       $service_config_dir_group = 'root'
       $service_name             = 'snmpd'
-      $snmpd_options            = '-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid'
+      $snmpd_options            = "-Lsd -Lf /dev/null -u $varnetsnmp_owner -g $varnetsnmp_group -I -smux -p /var/run/snmpd.pid"
       $sysconfig                = '/etc/default/snmpd'
       $var_net_snmp             = '/var/lib/snmp'
       $varnetsnmp_perms         = '0755'
-      $varnetsnmp_owner         = 'snmp'
-      $varnetsnmp_group         = 'snmp'
 
       $client_package_name      = 'snmp'
       $client_config            = '/etc/snmp/snmp.conf'

Altough systemd does not use /etc/default/snmpd in this case, it's confusing to have settings different in different places.
Also, there is apparently a Debian remix without systemd :)

@hostingnuggets
Copy link

Any news regarding this issue?

@razorsedge razorsedge added the enhancement New feature or request label Jul 18, 2017
@razorsedge razorsedge self-assigned this Jul 18, 2017
@razorsedge
Copy link
Contributor

PR in #109

@pawel-kuwalek
Copy link
Contributor

update, PR in #113

@xraystyle
Copy link

@razorsedge Are you still maintaining this project? We're still hoping to get #113 merged in so we can use it without forking this module.

@razorsedge
Copy link
Contributor

Merged into the develop branch.

@razorsedge
Copy link
Contributor

Released with razorsedge/snmp version 3.9.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants