Accepting request 162588 from network:messaging:amqp
- Change init script to properly daemonize (patch by jdsn) (bnc#807540) - Added systemd .service file OBS-URL: https://build.opensuse.org/request/show/162588 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rabbitmq-server?expand=0&rev=8
This commit is contained in:
commit
bbe1e97ea6
@ -1,3 +1,13 @@
|
||||
------------------------------------------------------------------
|
||||
Wed Apr 3 12:00:36 UTC 2013 - dmueller@suse.com
|
||||
|
||||
- Change init script to properly daemonize (patch by jdsn) (bnc#807540)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Mar 17 10:04:09 UTC 2013 - matwey.kornilov@gmail.com
|
||||
|
||||
- Added systemd .service file
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Mar 13 11:28:33 CET 2013 - berendt@b1-systems.de
|
||||
|
||||
|
@ -53,8 +53,8 @@ start_rabbitmq () {
|
||||
if [ $? -eq 0 ] ; then
|
||||
return 0
|
||||
else
|
||||
setsid sh -c "RABBITMQ_PID_FILE=$PID_FILE $DAEMON > \
|
||||
${INIT_LOG_DIR}/startup_log 2> ${INIT_LOG_DIR}/startup_err" &
|
||||
export RABBITMQ_PID_FILE=$PID_FILE
|
||||
startproc -l ${INIT_LOG_DIR}/startup_log -p $PID_FILE $DAEMON
|
||||
$CONTROL wait $PID_FILE >/dev/null 2>&1
|
||||
rc=$?
|
||||
case "$rc" in
|
||||
|
17
rabbitmq-server.service
Normal file
17
rabbitmq-server.service
Normal file
@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=RabbitMQ broker
|
||||
After=syslog.target network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=rabbitmq
|
||||
Group=rabbitmq
|
||||
Environment=RABBITMQ_PID_FILE=/var/run/rabbitmq/pid
|
||||
WorkingDirectory=/var/lib/rabbitmq
|
||||
ExecStart=/usr/sbin/rabbitmq-server
|
||||
ExecStartPost=/usr/sbin/rabbitmqctl wait /var/run/rabbitmq/pid
|
||||
ExecStop=/usr/sbin/rabbitmqctl stop
|
||||
ExecStopPost=/usr/bin/rm /var/run/rabbitmq/pid
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package rabbitmq-server
|
||||
#
|
||||
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -37,6 +37,7 @@ Source2: rabbitmq-script-wrapper
|
||||
Source3: rabbitmq-server.logrotate
|
||||
Source4: rabbitmq-server.ocf
|
||||
Source5: rabbitmq-server.sysconfig
|
||||
Source6: rabbitmq-server.service
|
||||
Patch0: no-nmap.patch
|
||||
Patch1: no-remove-common.patch
|
||||
BuildRequires: erlang
|
||||
@ -57,6 +58,11 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
Requires(pre): pwdutils
|
||||
Requires(pre): %fillup_prereq
|
||||
Requires(pre): %insserv_prereq
|
||||
%if 0%{?suse_version} > 1140
|
||||
BuildRequires: systemd
|
||||
%{?systemd_requires}
|
||||
%define have_systemd 1
|
||||
%endif
|
||||
# Do not use noarch since the Erlang packaging does not really allow that
|
||||
#BuildArch: noarch
|
||||
|
||||
@ -111,6 +117,9 @@ mkdir -p %{buildroot}%{_sbindir}
|
||||
ln -sf %{_initddir}/rabbitmq-server %{buildroot}%{_sbindir}/rcrabbitmq-server
|
||||
mkdir -p %{buildroot}%{_localstatedir}/adm/fillup-templates/
|
||||
install -p -D -m 644 %{SOURCE5} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.rabbitmq-server
|
||||
%if 0%{?have_systemd}
|
||||
install -p -D -m 644 %{SOURCE6} %{buildroot}%{_unitdir}/%{name}.service
|
||||
%endif
|
||||
|
||||
# Install wrapper scripts
|
||||
%define _rabbit_wrapper %{_builddir}/`basename %{SOURCE2}`
|
||||
@ -155,17 +164,29 @@ getent passwd rabbitmq >/dev/null || useradd -r -g rabbitmq \
|
||||
-d %{_localstatedir}/lib/rabbitmq \
|
||||
-s /sbin/nologin \
|
||||
-c "user for RabbitMQ messaging server" rabbitmq
|
||||
%if 0%{?have_systemd}
|
||||
%service_add_pre %{name}.service
|
||||
%endif
|
||||
exit 0
|
||||
|
||||
%post
|
||||
%fillup_and_insserv rabbitmq-server
|
||||
%if 0%{?have_systemd}
|
||||
%service_add_post %{name}.service
|
||||
%endif
|
||||
|
||||
%preun
|
||||
%stop_on_removal rabbitmq-server
|
||||
%if 0%{?have_systemd}
|
||||
%service_del_preun %{name}.service
|
||||
%endif
|
||||
|
||||
%postun
|
||||
%restart_on_update rabbitmq-server
|
||||
%insserv_cleanup
|
||||
%if 0%{?have_systemd}
|
||||
%service_del_postun %{name}.service
|
||||
%endif
|
||||
|
||||
%files -f ../filelist.%{name}.rpm
|
||||
%defattr(-,root,root,-)
|
||||
@ -178,6 +199,9 @@ exit 0
|
||||
%{_rabbit_erllibdir}
|
||||
%{_initddir}/rabbitmq-server
|
||||
%{_sbindir}/rcrabbitmq-server
|
||||
%if 0%{?have_systemd}
|
||||
%{_unitdir}/%{name}.service
|
||||
%endif
|
||||
%dir /usr/lib/ocf
|
||||
%dir /usr/lib/ocf/resource.d
|
||||
%dir /usr/lib/ocf/resource.d/rabbitmq
|
||||
|
Loading…
Reference in New Issue
Block a user