Commit a1dc06cf authored by Henrik Triem's avatar Henrik Triem

Merge branch 'remove-service-and-init-files' into 'master'

Remove service & init files

See merge request !1
parents f015e3bf 71acadc8
Pipeline #7935 passed with stages
in 4 minutes and 38 seconds
# If you need to change max open file limit
# for example, when you change maxclient in configuration
# you can change the value below
# see "man limits.conf" for information
redis soft nofile 10240
redis hard nofile 10240
# If you need to change max open file limit
# for example, when you change maxclient in configuration
# you can change the LimitNOFILE value below
# see "man systemd.exec" for information
[Service]
LimitNOFILE=10240
#!/bin/sh
#
# redis init file for starting up the redis-sentinel daemon
#
# chkconfig: - 21 79
# description: Starts and stops the redis-sentinel daemon.
#
### BEGIN INIT INFO
# Provides: redis-sentinel
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Short-Description: start and stop Sentinel server
# Description: A persistent key-value database
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
name="redis-sentinel"
exec="/usr/bin/$name"
shut="/usr/libexec/redis-shutdown"
pidfile="/var/run/redis/sentinel.pid"
SENTINEL_CONFIG="/etc/redis-sentinel.conf"
[ -e /etc/sysconfig/redis-sentinel ] && . /etc/sysconfig/redis-sentinel
lockfile=/var/lock/subsys/redis
start() {
[ -f $SENTINEL_CONFIG ] || exit 6
[ -x $exec ] || exit 5
echo -n $"Starting $name: "
daemon --user ${REDIS_USER-redis} "$exec $SENTINEL_CONFIG --daemonize yes --pidfile $pidfile"
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $name: "
[ -x $shut ] && $shut $name
retval=$?
if [ -f $pidfile ]
then
# shutdown haven't work, try old way
killproc -p $pidfile $name
retval=$?
else
success "$name shutdown"
fi
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
start
}
rh_status() {
status -p $pidfile $name
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart}"
exit 2
esac
exit $?
[Unit]
Description=Redis Sentinel for Icinga
After=network.target
After=network-online.target
Wants=network-online.target
[Service]
ExecStart=/usr/bin/icinga-redis-sentinel /etc/icinga-redis/redis-sentinel.conf --supervised systemd
ExecStop=/usr/libexec/icinga-redis-shutdown redis-sentinel
Type=notify
User=icinga-redis
Group=icinga-redis
RuntimeDirectory=icinga-redis
RuntimeDirectoryMode=0755
[Install]
WantedBy=multi-user.target
#!/bin/sh
#
# redis init file for starting up the redis daemon
#
# chkconfig: - 20 80
# description: Starts and stops the redis daemon.
#
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Short-Description: start and stop Redis server
# Description: A persistent key-value database
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
name="redis-server"
exec="/usr/bin/$name"
shut="/usr/libexec/redis-shutdown"
pidfile="/var/run/redis/redis.pid"
REDIS_CONFIG="/etc/redis.conf"
[ -e /etc/sysconfig/redis ] && . /etc/sysconfig/redis
lockfile=/var/lock/subsys/redis
start() {
[ -f $REDIS_CONFIG ] || exit 6
[ -x $exec ] || exit 5
echo -n $"Starting $name: "
daemon --user ${REDIS_USER-redis} "$exec $REDIS_CONFIG --daemonize yes --pidfile $pidfile"
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $name: "
[ -x $shut ] && $shut
retval=$?
if [ -f $pidfile ]
then
# shutdown haven't work, try old way
killproc -p $pidfile $name
retval=$?
else
success "$name shutdown"
fi
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
start
}
rh_status() {
status -p $pidfile $name
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart}"
exit 2
esac
exit $?
[Unit]
Description=Redis persistent key-value database for Icinga
After=network.target
After=network-online.target
Wants=network-online.target
[Service]
ExecStart=/usr/bin/icinga-redis-server /etc/icinga-redis/redis.conf --supervised systemd
ExecStop=/usr/libexec/icinga-redis-shutdown
Type=notify
User=icinga-redis
Group=icinga-redis
RuntimeDirectory=icinga-redis
RuntimeDirectoryMode=0755
[Install]
WantedBy=multi-user.target
......@@ -32,15 +32,9 @@ License: BSD and MIT
URL: https://redis.io
Source0: http://download.redis.io/releases/%{src_name}-%{version}.tar.gz
Source1: %{src_name}.logrotate
Source2: %{src_name}-sentinel.service
Source3: %{src_name}.service
Source4: %{src_name}-sentinel.init
Source5: %{src_name}.init
Source6: %{src_name}-shutdown
Source7: %{src_name}-limit-systemd
Source8: %{src_name}-limit-init
Source9: macros.%{src_name}
# Source10: https://github.com/antirez/%%{src_name}-doc/archive/%%{doc_commit}/%{src_name}-doc-%%{short_doc_commit}.tar.gz
Source2: %{src_name}-shutdown
Source3: macros.%{src_name}
# Source4: https://github.com/antirez/%%{src_name}-doc/archive/%%{doc_commit}/%{src_name}-doc-%%{short_doc_commit}.tar.gz
# To refresh patches:
# tar xf redis-xxx.tar.gz && cd redis-xxx && git init && git add . && git commit -m "%%{version} baseline"
......@@ -183,15 +177,6 @@ install -pd %{buildroot}%{_sysconfdir}/%{name}
install -pDm640 %{src_name}.conf %{buildroot}%{_sysconfdir}/%{name}/%{src_name}.conf
# install -pDm640 sentinel.conf %%{buildroot}%%{_sysconfdir}/%%{name}/%%{src_name}-sentinel.conf
# Install systemd unit files.
mkdir -p %{buildroot}%{_unitdir}
install -pm644 %{S:3} %{buildroot}%{_unitdir}/%{name}.service
# install -pm644 %%{S:2} %%{buildroot}%%{_unitdir}/%%{name}-sentinel.service
# Install systemd limit files (requires systemd >= 204)
install -p -D -m 644 %{S:7} %{buildroot}%{_sysconfdir}/systemd/system/%{name}.service.d/limit.conf
# install -p -D -m 644 %%{S:7} %%{buildroot}%%{_sysconfdir}/systemd/system/%%{name}-sentinel.service.d/limit.conf
# Fix non-standard-executable-perm error.
for bin in $(cd %{buildroot}%{_bindir}; ls redis*); do
# Rename bin file and add prefix if set
......@@ -206,7 +191,7 @@ if [ -n %{?pkg_prefix} ]; then
fi
# Install redis-shutdown
install -pDm755 %{S:6} %{buildroot}%{_libexecdir}/%{name}-shutdown
install -pDm755 %{S:2} %{buildroot}%{_libexecdir}/%{name}-shutdown
# Install redis module header
# install -pDm644 src/%%{name}module.h %%{buildroot}%%{_includedir}/%%{name}module.h
......@@ -233,7 +218,7 @@ done
# Install rpm macros for redis modules
# mkdir -p %%{buildroot}%%{macrosdir}
# install -pDm644 %%{S:9} %%{buildroot}%%{macrosdir}/macros.%%{name}
# install -pDm644 %%{S:3} %%{buildroot}%%{macrosdir}/macros.%%{name}
%check
%if 0%{?with_tests}
......@@ -254,18 +239,6 @@ useradd -r -g %{name} -d %{_sharedstatedir}/%{name} -s /sbin/nologin \
-c 'Redis Database Server' %{name} &> /dev/null
exit 0
%post
%systemd_post %{name}.service
# %%systemd_post %%{name}-sentinel.service
%preun
%systemd_preun %{name}.service
# %%systemd_preun %%{name}-sentinel.service
%postun
%systemd_postun_with_restart %{name}.service
# %%systemd_postun_with_restart %%{name}-sentinel.service
%files
%{!?_licensedir:%global license %%doc}
%license COPYING
......@@ -284,12 +257,6 @@ exit 0
%{_libexecdir}/%{name}-*
%{_mandir}/man1/%{name}*
%{_mandir}/man5/%{name}*
%{_unitdir}/%{name}.service
# %%{_unitdir}/%%{name}-sentinel.service
%dir %{_sysconfdir}/systemd/system/%{name}.service.d
%config(noreplace) %{_sysconfdir}/systemd/system/%{name}.service.d/limit.conf
# %dir %%{_sysconfdir}/systemd/system/%%{name}-sentinel.service.d
# %%config(noreplace) %%{_sysconfdir}/systemd/system/%%{name}-sentinel.service.d/limit.conf
%dir %attr(0755, %{name}, %{name}) %ghost %{_localstatedir}/run/%{name}
# %%files devel
......@@ -305,6 +272,9 @@ exit 0
%changelog
* Mon Dec 16 2019 Noah Hilverling <noah.hilverling@icinga.com> - 5.0.7-2
- Remove service and init files
* Thu Nov 28 2019 Markus Frosch <markus.frosch@icinga.com> - 5.0.7-1
- Update to 5.0.7
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment