forked from pool/rrdtool
Accepting request 221484 from home:jsjhb:branches:devel:languages:python
- again fix PIDfile handling for rrdcached in systemd file (ugly now: because of removal of declaration in sysconfig file; it has to be declared twice in service file) - add PIDfile directory using tmpfiles now OBS-URL: https://build.opensuse.org/request/show/221484 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/rrdtool?expand=0&rev=55
This commit is contained in:
parent
c8c3040198
commit
d1186b3013
@ -14,8 +14,6 @@ test -r $RRDCACHED_CONFIG || { echo "$RRDCACHED_CONFIG not existing";
|
|||||||
if [ "$1" = "stop" ]; then exit 0;
|
if [ "$1" = "stop" ]; then exit 0;
|
||||||
else exit 6; fi; }
|
else exit 6; fi; }
|
||||||
|
|
||||||
RRDCACHED_PID='/run/rrdcached.pid'
|
|
||||||
|
|
||||||
# Read config
|
# Read config
|
||||||
. $RRDCACHED_CONFIG
|
. $RRDCACHED_CONFIG
|
||||||
|
|
||||||
@ -24,8 +22,6 @@ function check_and_create_dir(){
|
|||||||
test -d "$DIR" || mkdir -p "$DIR"
|
test -d "$DIR" || mkdir -p "$DIR"
|
||||||
}
|
}
|
||||||
|
|
||||||
check_and_create_dir "$(dirname $RRDCACHED_PID)"
|
|
||||||
chown $RRDCACHED_USER:$RRDCACHED_GROUP "$(dirname $RRDCACHED_PID)"
|
|
||||||
case "$RRDCACHED_ADDRESS" in
|
case "$RRDCACHED_ADDRESS" in
|
||||||
^unix:)
|
^unix:)
|
||||||
SOCKETDIR=$(dirname ${RRDCACHED_ADDRESS/unix:/})
|
SOCKETDIR=$(dirname ${RRDCACHED_ADDRESS/unix:/})
|
||||||
|
@ -16,10 +16,10 @@ Type=forking
|
|||||||
ExecStartPre=-/bin/echo 'Starting RRD data caching service (rrdtools - rrdcached)'
|
ExecStartPre=-/bin/echo 'Starting RRD data caching service (rrdtools - rrdcached)'
|
||||||
ExecStartPre=/bin/sh -c "/usr/share/rrdcached/rrdcached-systemd-pre"
|
ExecStartPre=/bin/sh -c "/usr/share/rrdcached/rrdcached-systemd-pre"
|
||||||
EnvironmentFile=-/etc/sysconfig/rrdcached
|
EnvironmentFile=-/etc/sysconfig/rrdcached
|
||||||
ExecStart=/usr/bin/rrdcached -s $RRDCACHED_GROUP -b "$RRDCACHED_CHROOT_DIR" -p "$RRDCACHED_PID" -l $RRDCACHED_ADDRESS -m $RRDCACHED_SOCKET_MASK -w $RRDCACHED_DISKWRITE -z $RRDCACHED_DELAY -t $RRDCACHED_WRITE_THREADS $RRDCACHED_OPTIONS
|
ExecStart=/usr/bin/rrdcached -s $RRDCACHED_GROUP -b "$RRDCACHED_CHROOT_DIR" -p /run/rrdcached/rrdcached.pid -l $RRDCACHED_ADDRESS -m $RRDCACHED_SOCKET_MASK -w $RRDCACHED_DISKWRITE -z $RRDCACHED_DELAY -t $RRDCACHED_WRITE_THREADS $RRDCACHED_OPTIONS
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=1
|
RestartSec=1
|
||||||
PIDFile=/run/rrdcached.pid
|
PIDFile=/run/rrdcached/rrdcached.pid
|
||||||
TimeoutStopSec=10
|
TimeoutStopSec=10
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Sun Feb 9 08:58:51 UTC 2014 - obs@botter.cc
|
||||||
|
|
||||||
|
- again fix PIDfile handling for rrdcached in systemd file
|
||||||
|
(ugly now: because of removal of declaration in sysconfig file;
|
||||||
|
it has to be declared twice in service file)
|
||||||
|
- add PIDfile directory using tmpfiles now
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Jan 13 08:42:10 UTC 2014 - coolo@suse.com
|
Mon Jan 13 08:42:10 UTC 2014 - coolo@suse.com
|
||||||
|
|
||||||
|
10
rrdtool.spec
10
rrdtool.spec
@ -16,6 +16,8 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
|
%{!?_tmpfilesdir:%global _tmpfilesdir /usr/lib/tmpfiles.d}
|
||||||
|
|
||||||
Name: rrdtool
|
Name: rrdtool
|
||||||
BuildRequires: autoconf
|
BuildRequires: autoconf
|
||||||
BuildRequires: automake
|
BuildRequires: automake
|
||||||
@ -243,7 +245,9 @@ install -Dm644 %{SOURCE2} %{buildroot}%{_localstatedir}/adm/fillup-templates/sys
|
|||||||
# install systemd specific files
|
# install systemd specific files
|
||||||
install -Dm755 %{SOURCE4} %{buildroot}%{_datadir}/rrdcached/rrdcached-systemd-pre
|
install -Dm755 %{SOURCE4} %{buildroot}%{_datadir}/rrdcached/rrdcached-systemd-pre
|
||||||
install -Dm644 %{SOURCE5} %{buildroot}%{_unitdir}/rrdcached.service
|
install -Dm644 %{SOURCE5} %{buildroot}%{_unitdir}/rrdcached.service
|
||||||
mkdir -p %{buildroot}%{_localstatedir}/lib/rrdtool/rrdcached
|
install -d -m 0755 %{buildroot}/%{_tmpfilesdir}
|
||||||
|
echo "d /run/rrdcached 0755 %{rrdcached_user} %{rrdcached_group}" > %{buildroot}/%{_tmpfilesdir}/rrdcached.conf
|
||||||
|
chmod 644 %{buildroot}/%{_tmpfilesdir}/rrdcached.conf
|
||||||
|
|
||||||
%post -p /sbin/ldconfig
|
%post -p /sbin/ldconfig
|
||||||
|
|
||||||
@ -296,11 +300,10 @@ mkdir -p %{buildroot}%{_localstatedir}/lib/rrdtool/rrdcached
|
|||||||
%defattr(-, root, root)
|
%defattr(-, root, root)
|
||||||
%{_bindir}/rrdcached
|
%{_bindir}/rrdcached
|
||||||
%{_localstatedir}/adm/fillup-templates/sysconfig.rrdcached
|
%{_localstatedir}/adm/fillup-templates/sysconfig.rrdcached
|
||||||
%dir %{_localstatedir}/lib/rrdtool
|
|
||||||
%attr(-,%rrdcached_user,%rrdcached_group) %dir %{_localstatedir}/lib/rrdtool/rrdcached
|
|
||||||
%{_datadir}/rrdcached
|
%{_datadir}/rrdcached
|
||||||
%{_datadir}/rrdcached/rrdcached-systemd-pre
|
%{_datadir}/rrdcached/rrdcached-systemd-pre
|
||||||
%{_unitdir}/rrdcached.service
|
%{_unitdir}/rrdcached.service
|
||||||
|
%{_tmpfilesdir}/rrdcached.conf
|
||||||
|
|
||||||
%pre cached
|
%pre cached
|
||||||
getent group %rrdcached_group >/dev/null || groupadd %rrdcached_group
|
getent group %rrdcached_group >/dev/null || groupadd %rrdcached_group
|
||||||
@ -310,6 +313,7 @@ getent passwd %rrdcached_user >/dev/null || useradd -s /sbin/nologin -g %rrdcach
|
|||||||
%post cached
|
%post cached
|
||||||
%service_add_post rrdcached.service
|
%service_add_post rrdcached.service
|
||||||
%fillup_only rrdcached
|
%fillup_only rrdcached
|
||||||
|
systemd-tmpfiles --create %{_tmpfilesdir}/rrdcached.conf
|
||||||
|
|
||||||
%preun cached
|
%preun cached
|
||||||
%service_del_preun rrdcached.service
|
%service_del_preun rrdcached.service
|
||||||
|
Loading…
Reference in New Issue
Block a user