diff options
author | Stig Thormodsrud <stig@uffda.(none)> | 2007-10-31 18:49:53 -0700 |
---|---|---|
committer | Stig Thormodsrud <stig@uffda.(none)> | 2007-10-31 18:49:53 -0700 |
commit | e992ddd83ab2002ea6aeb9a4cacf89f9a888c17b (patch) | |
tree | 52c88c9141e41847a515dd3f9e12634d02d423e8 | |
parent | 290a17f504293f80b54bb8960293e6bc0cfacb19 (diff) | |
download | vyatta-cfg-system-e992ddd83ab2002ea6aeb9a4cacf89f9a888c17b.tar.gz vyatta-cfg-system-e992ddd83ab2002ea6aeb9a4cacf89f9a888c17b.zip |
Fix snmp such that it can be configured by non-root user.
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | debian/control | 2 | ||||
-rw-r--r-- | debian/vyatta-cfg-system.postinst.in | 6 | ||||
-rw-r--r-- | scripts/snmp/snmpd.init (renamed from scripts/snmpd.init) | 0 | ||||
-rw-r--r-- | scripts/snmp/vyatta-snmp.pl (renamed from scripts/vyatta-snmp.pl) | 0 | ||||
-rw-r--r-- | templates/protocols/snmp/node.def | 6 |
6 files changed, 10 insertions, 8 deletions
diff --git a/Makefile.am b/Makefile.am index 2cbb92d1..808ac3eb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,8 +14,8 @@ sbin_SCRIPTS += scripts/standalone_root_pw_reset sbin_SCRIPTS += scripts/system/vyatta_update_login_user.pl sbin_SCRIPTS += scripts/system/vyatta_update_logrotate.pl sbin_SCRIPTS += scripts/system/vyatta_update_syslog.pl -sbin_SCRIPTS += scripts/vyatta-snmp.pl -sbin_SCRIPTS += scripts/snmpd.init +sbin_SCRIPTS += scripts/snmp/vyatta-snmp.pl +sbin_SCRIPTS += scripts/snmp/snmpd.init sysconf_DATA += sysconf/hosts sysconf_DATA += sysconf/logrotate_messages diff --git a/debian/control b/debian/control index bc1f5ab0..9e08e100 100644 --- a/debian/control +++ b/debian/control @@ -12,7 +12,7 @@ Depends: bash (>= 3.1), perl (>= 5.8.8), procps (>= 1:3.2.7-3), coreutils (>= 5.97-5.3), - vyatta-cfg, sysv-rc, ifrename, ntp, sysklogd, busybox, ssh, whois, sudo + vyatta-cfg, sysv-rc, ifrename, ntp, sysklogd, busybox, ssh, whois, sudo, snmpd Suggests: util-linux (>= 2.13-5), net-tools, ethtool, diff --git a/debian/vyatta-cfg-system.postinst.in b/debian/vyatta-cfg-system.postinst.in index 0fbdfd76..7edb9960 100644 --- a/debian/vyatta-cfg-system.postinst.in +++ b/debian/vyatta-cfg-system.postinst.in @@ -7,7 +7,7 @@ bindir=@bindir@ sbindir=@sbindir@ # remove init of daemons that we start/stop -for init in ntp ssh; do +for init in ntp ssh snmpd; do update-rc.d -f ${init} remove >/dev/null done @@ -22,7 +22,8 @@ if [ "$sysconfdir" != "/etc" ]; then for conf in hosts motd.tail ntp.conf syslog.conf logrotate.d/messages \ default/ssh ssh/ssh_host_key quagga/daemons quagga/zebra.conf \ quagga/bgpd.conf quagga/ospfd.conf quagga/ospf6d.conf \ - quagga/ripd.conf quagga/ripngd.conf quagga/isisd.conf + quagga/ripd.conf quagga/ripngd.conf quagga/isisd.conf \ + snmp/snmpd.conf snmp/snmptrapd.conf do [ -f /etc/$conf ] && mv -f /etc/$conf /etc/$conf.vyatta-save touch /etc/$conf @@ -40,6 +41,7 @@ if [ "$sysconfdir" != "/etc" ]; then if ! grep -q '%quaggavty ALL=NOPASSWD: ALL' /etc/sudoers; then echo -e "\n%quaggavty ALL=NOPASSWD: ALL" >> /etc/sudoers fi + echo "Defaults env_keep+=VYATTA_*" >> /etc/sudoers # ssh v1. remove the empty key file rm /etc/ssh/ssh_host_key diff --git a/scripts/snmpd.init b/scripts/snmp/snmpd.init index 3e4ef17b..3e4ef17b 100644 --- a/scripts/snmpd.init +++ b/scripts/snmp/snmpd.init diff --git a/scripts/vyatta-snmp.pl b/scripts/snmp/vyatta-snmp.pl index 511e1054..511e1054 100644 --- a/scripts/vyatta-snmp.pl +++ b/scripts/snmp/vyatta-snmp.pl diff --git a/templates/protocols/snmp/node.def b/templates/protocols/snmp/node.def index 269b64ed..4c35e2b0 100644 --- a/templates/protocols/snmp/node.def +++ b/templates/protocols/snmp/node.def @@ -2,8 +2,8 @@ help: "Configure SNMP" create: "/opt/vyatta/sbin/vyatta-snmp.pl --init-snmp" delete: "touch /tmp/snmp.\\$PPID" end: "if [ -f \"/tmp/snmp.\\$PPID\" ]; then \ - /opt/vyatta/sbin/vyatta-snmp.pl --stop-snmp \ - rm -rf /tmp/snmp.\\$PPID; \ + sudo /opt/vyatta/sbin/vyatta-snmp.pl --stop-snmp \ + rm /tmp/snmp.\\$PPID; \ else \ - /opt/vyatta/sbin/vyatta-snmp.pl --update-snmp; \ + sudo /opt/vyatta/sbin/vyatta-snmp.pl --update-snmp; \ fi; " |