From a1d1e8033125324482c49860bcebc1e9092b4e2c4922d4b373898a0c4b939fcc Mon Sep 17 00:00:00 2001 From: Darin Perusich Date: Mon, 21 Jul 2014 12:28:00 +0000 Subject: [PATCH] Accepting request 241668 from home:posophe:branches:server:monitoring - Do not provide support for systemd and sysvinit on the same system it's redundant - Add a rc symlink with systemd service file for backward compatibility OBS-URL: https://build.opensuse.org/request/show/241668 OBS-URL: https://build.opensuse.org/package/show/server:monitoring/collectd?expand=0&rev=123 --- collectd.changes | 7 +++++++ collectd.spec | 19 +++++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/collectd.changes b/collectd.changes index 75761bf..37482c3 100644 --- a/collectd.changes +++ b/collectd.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sun Jul 20 19:37:18 UTC 2014 - p.drouand@gmail.com + +- Do not provide support for systemd and sysvinit on the same system + it's redundant +- Add a rc symlink with systemd service file for backward compatibility + ------------------------------------------------------------------- Sat Mar 15 15:21:46 UTC 2014 - bruno@ioda-net.ch diff --git a/collectd.spec b/collectd.spec index 9c9a107..796b40b 100644 --- a/collectd.spec +++ b/collectd.spec @@ -1,4 +1,3 @@ -# vim: set sw=4 ts=4 et nu: # # spec file for package collectd # @@ -271,11 +270,12 @@ BuildRequires: libxtables-devel BuildRequires: systemd %{?systemd_requires} %define has_systemd 1 +%else +PreReq: %insserv_prereq %endif # in case we'd like to split it later: Provides: collectd-perl = %{version}-%{release} PreReq: %fillup_prereq -PreReq: %insserv_prereq # play nice with collectd-beta: Obsoletes: collectd-beta < %{version} Provides: collectd-beta = %{version}-%{release} @@ -676,11 +676,6 @@ export KERNEL_DIR=/usr/src/linux # create /var/lib/collectd to add it to the %files section: %__install -d -m 0755 "%{buildroot}%{_localstatedir}/lib/collectd" -# init script: -%__install -D -m 0755 "%{SOURCE1}" "%{buildroot}/etc/init.d/collectd" -%__install -d -m 0755 "%{buildroot}/usr/sbin" -%__ln_s "../../etc/init.d/collectd" "%{buildroot}/usr/sbin/rccollectd" - # Apache2 configuration for the CGI frontend: %__install -D -m 0644 "%{SOURCE2}" "%{buildroot}/etc/apache2/conf.d/%{name}.conf" %__install -D -m 0755 contrib/collection.cgi "%{buildroot}/srv/www/collectd/collection.cgi" @@ -767,8 +762,15 @@ cat<README.plugins-all This package is empty but depends on all collectd plugin subpackages. EOF +%__install -d -m 0755 "%{buildroot}/usr/sbin" + %if 0%{?has_systemd} %__install -D -m0644 %{SOURCE100} %{buildroot}%{_unitdir}/collectd.service +ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rc%{name} +%else +# init script: +%__install -D -m 0755 "%{SOURCE1}" "%{buildroot}/etc/init.d/collectd" +%__ln_s "../../etc/init.d/collectd" "%{buildroot}/usr/sbin/rccollectd" %endif %preun @@ -844,10 +846,11 @@ EOF %doc %{_mandir}/man5/types.db.5%{ext_man} %doc %{perl_man3dir}/Collectd::Unixsock.%{perl_man3ext}%{ext_man} %dir %{_localstatedir}/lib/collectd -/etc/init.d/collectd /usr/sbin/rccollectd %if 0%{?has_systemd} %{_unitdir}/collectd.service +%else +/etc/init.d/collectd %endif %files web