SHA256
1
0
forked from pool/collectd

Accepting request 138701 from server:monitoring

- Add systemd rules. (forwarded request 131808 from elvigia)

OBS-URL: https://build.opensuse.org/request/show/138701
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/collectd?expand=0&rev=12
This commit is contained in:
Stephan Kulow 2012-10-26 14:59:33 +00:00 committed by Git OBS Bridge
commit 2a207b36c2
3 changed files with 48 additions and 0 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Aug 27 21:39:32 UTC 2012 - crrodriguez@opensuse.org
- Add systemd rules.
-------------------------------------------------------------------
Mon Jul 30 14:09:52 UTC 2012 - chris@computersalat.de

14
collectd.service Normal file
View File

@ -0,0 +1,14 @@
[Unit]
Description=System statistics collection daemon
After=local-fs.target network.target
Requires=local-fs.target network.target
[Service]
ExecStart=/usr/sbin/collectd -C /etc/collectd.conf -f
Restart=always
RestartSec=10
StandardOutput=syslog
StandardError=syslog
[Install]
WantedBy=multi-user.target

View File

@ -131,6 +131,7 @@ Source10: http://devresources.linux-foundation.org/dev/iproute2/download/i
# see https://bugzilla.novell.com/show_bug.cgi?id=388026
Source20: collectd-pthread.pc
Source99: collectd-rpmlintrc
Source100: collectd.service
Patch4: collectd-lib64.patch
Patch7: collectd-fix-config.patch
Patch9: collectd-version.patch
@ -262,6 +263,9 @@ BuildRequires: libxtables-devel
%endif
%if %suse_version >= 1210
%{perl_requires}
BuildRequires: systemd
%{?systemd_requires}
%define has_systemd 1
%endif
# in case we'd like to split it later:
Provides: collectd-perl = %{version}-%{release}
@ -789,16 +793,38 @@ cat<<EOF >README.plugins-all
This package is empty but depends on all collectd plugin subpackages.
EOF
%if 0%{?has_systemd}
%__install -D -m0644 %{SOURCE100} %{buildroot}%{_unitdir}/collectd.service
%endif
%preun
%stop_on_removal collectd
%if 0%{?has_systemd}
%service_del_preun %{name}.service
%endif
%postun
%restart_on_update collectd
%insserv_cleanup
%if 0%{?has_systemd}
%service_del_postun %{name}.service
%endif
%pre
%if 0%{?has_systemd}
%service_add_pre %{name}.service
%endif
%post
%{fillup_only collectd}
%if 0%{?has_systemd}
%service_add_post %{name}.service
%endif
%post -n libcollectdclient0 -p /sbin/ldconfig
%postun -n libcollectdclient0 -p /sbin/ldconfig
@ -844,6 +870,9 @@ EOF
%dir %{_localstatedir}/lib/collectd
/etc/init.d/collectd
/usr/sbin/rccollectd
%if 0%{?has_systemd}
%{_unitdir}/collectd.service
%endif
%files web
%defattr(-,root,root)