Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 491768 - net-analyzer/net-snmp-5.7.2-r1 - add systemd support
Summary: net-analyzer/net-snmp-5.7.2-r1 - add systemd support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: install-systemd-unit
  Show dependency tree
 
Reported: 2013-11-20 13:28 UTC by Joerg Neikes
Modified: 2013-11-23 09:04 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
net-snmp-5.7.2-r1.ebuild (net-snmp-5.7.2-r1.ebuild,4.12 KB, text/plain)
2013-11-20 13:28 UTC, Joerg Neikes
Details
snmpd.service (snmpd.service,185 bytes, text/plain)
2013-11-20 13:29 UTC, Joerg Neikes
Details
net-snmp-5.7.2-r1.ebuild (net-snmp-5.7.2-r1.ebuild,4.12 KB, text/plain)
2013-11-20 13:37 UTC, Joerg Neikes
Details
net-snmp-5.7.2-r1.ebuild (net-snmp-5.7.2-r1.ebuild,4.12 KB, text/plain)
2013-11-20 13:38 UTC, Joerg Neikes
Details
snmpd.conf (snmpd.conf,658 bytes, text/plain)
2013-11-20 13:39 UTC, Joerg Neikes
Details
net-snmp-5.7.2-r1.ebuild (net-snmp-5.7.2-r1.ebuild,4.31 KB, text/plain)
2013-11-20 13:39 UTC, Joerg Neikes
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joerg Neikes 2013-11-20 13:28:38 UTC
Created attachment 363642 [details]
net-snmp-5.7.2-r1.ebuild

emerge --info
Portage 2.2.7 (default/linux/amd64/13.0, gcc-4.7.3, glibc-2.17, 3.12.0-gentoo x86_64)
=================================================================
System uname: Linux-3.12.0-gentoo-x86_64-Intel-R-_Core-TM-2_Duo_CPU_E7600_@_3.06GHz-with-gentoo-2.2
KiB Mem:     2033628 total,    552812 free
KiB Swap:    4000180 total,   3999796 free
Timestamp of tree: Tue, 19 Nov 2013 15:45:01 +0000
ld GNU ld (GNU Binutils) 2.23.2
distcc 3.1 x86_64-pc-linux-gnu [disabled]
ccache version 3.1.9 [enabled]
app-shells/bash:          4.2_p45
dev-java/java-config:     2.2.0
dev-lang/python:          2.5.4-r5, 2.6.8-r3, 2.7.5-r4, 3.1.5-r1, 3.2.5-r3, 3.3.2-r2
dev-util/ccache:          3.1.9-r3
dev-util/cmake:           2.8.12.1-r1
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.6, 1.12.6, 1.13.4, 1.14
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.4.7, 4.5.4, 4.6.4, 4.7.3-r1, 4.8.2
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.11 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo scarabeus sunrise xpol
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe -U_FORTIFY_SOURCE"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.4/ext-active/ /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=core2 -O2 -pipe -U_FORTIFY_SOURCE"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs ccache config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="DE"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/scarabeus /var/lib/layman/sunrise /var/lib/layman/xpol-overlay"
USE="X a52 aac acl ads aff alsa amd64 apache apache2 apng bcmath berkdb branding bzip2 bzlib cairo calendar cddb cli config-file cracklib crypt ctype curl curlwrappers custom-optimization cxx dba dbase dbx dio dns dri dvb dvd emacs encode ewf exif ffmpeg flatfile fontconfig fortran ftp gdbm gif gmp gnutls gtk http-forms http-server iconv idn imap ipv6 jack java jpeg jpeg2k kerberos l7filter ldap libass lirc lxde mad maildir matroska mhash midi mime mmx mng modules mp3 mpeg mssql mudflap multilib mysql ncurses nls nptl nptlonly nsplugin nss ogg opengl openmp openssl pam pcre pdf pdflib php pic png posix postgres quicktime raw readline realtime samba secure-delete session sharedext simplexml smp snmp soap sockets spell sse sse2 ssl ssse3 svg sysvipc tcpd tidy tiff timidity truetype unicode usb vhost vorbis wma xinerama xml xml2 xmlrpc xmp xpm xsl xulrunner zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="prefork" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de dk fi jp it tr nl fr" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-3 php5-4 php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="jython2_5 python2_5 python2_6 python2_7 python3_1 python3_2 python3_3" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" VIDEO_CARDS="vesa vga intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="2.5 2.6 2.7 3.1 3.2 3.3"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC
Comment 1 Joerg Neikes 2013-11-20 13:29:56 UTC
Created attachment 363644 [details]
snmpd.service

added snmpd.service to net-snmp-5.7.2.
Comment 2 Joerg Neikes 2013-11-20 13:37:49 UTC
Created attachment 363646 [details]
net-snmp-5.7.2-r1.ebuild
Comment 3 Joerg Neikes 2013-11-20 13:38:17 UTC
Created attachment 363648 [details]
net-snmp-5.7.2-r1.ebuild
Comment 4 Joerg Neikes 2013-11-20 13:39:14 UTC
Created attachment 363650 [details]
snmpd.conf
Comment 5 Joerg Neikes 2013-11-20 13:39:36 UTC
Created attachment 363652 [details]
net-snmp-5.7.2-r1.ebuild
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2013-11-20 14:24:25 UTC
Comment on attachment 363652 [details]
net-snmp-5.7.2-r1.ebuild

--- net-snmp-5.7.2.ebuild       2013-09-20 18:59:48.000000000 +0200
+++ -   2013-11-20 15:23:17.647014694 +0100
@@ -9,7 +9,7 @@
 WANT_AUTOMAKE=none
 PATCHSET=1
 
-inherit autotools distutils-r1 eutils perl-module
+inherit autotools distutils-r1 eutils perl-module systemd
 
 MY_P="${P/_rc/.rc}"
 
@@ -144,4 +144,16 @@
                        "${D}"/usr/share/snmp/*.conf \
                        "${D}"/**/*.pl
        fi
+       # systemd support
+       systemd_newunit "${FILESDIR}/snmpd.service" "snmpd.service"
 }
+
+pkg_postinst() {
+               elog "For using systemd"
+               elog "   systemctl enable snmpd.service"
+               elog "and outcommand"

Do what?

+               elog "# SNMPD_FLAGS=\"-p /var/run/snmpd.pid\""
+               elog "in /etc/conf.d/snmpd"
+               echo
+}
+
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2013-11-20 14:25:49 UTC
Comment on attachment 363650 [details]
snmpd.conf

--- files/snmpd.conf    2012-08-03 13:48:10.000000000 +0200
+++ -   2013-11-20 15:25:17.246376909 +0100
@@ -5,6 +5,9 @@
 # Initial (empty) options.
 SNMPD_FLAGS=""
 
+# needed for systemd
+# SNMPD_FLAGS="-p /var/run/snmpd.pid"

Didn't we switch from /var/run to /run precisely because of systemd?

+
 # Enable connection logging.
 #SNMPD_FLAGS="${SNMPD_FLAGS} -a"
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-11-20 17:34:49 UTC
Comment on attachment 363644 [details]
snmpd.service

>[Unit]
>Description=Simple Network Management Protokoll Deamon
>
>[Service]
>Type=forking
>ExecStart=/usr/sbin/snmpd 

Any reason not to run it in non-detaching mode as Type=simple?

>ExecStop=/bin/kill -TERM $MAINPID

Why this? This is precisely what systemd does by default.
Comment 9 Pacho Ramos gentoo-dev 2013-11-23 09:04:13 UTC
+*net-snmp-5.7.2-r1 (23 Nov 2013)
+
+  23 Nov 2013; Pacho Ramos <pacho@gentoo.org> +files/snmpd.service,
+  +files/snmptrapd.service, +net-snmp-5.7.2-r1.ebuild:
+  Add unit file (#491768 by Joerg Neikes)
+