diff --git a/pen.changes b/pen.changes index dee0670..e93de89 100644 --- a/pen.changes +++ b/pen.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Mar 12 14:48:32 UTC 2019 - josef.moellers@suse.com + +- Added systemd support. + [bsc#1116032, pen.service] + ------------------------------------------------------------------- Tue Feb 10 18:02:56 UTC 2015 - sfalken@opensuse.org diff --git a/pen.service b/pen.service new file mode 100644 index 0000000..9d9f3db --- /dev/null +++ b/pen.service @@ -0,0 +1,9 @@ +[Unit] +Description=A simple load balancer for tcp based protocols +After=time-sync.target nss-lookup.target syslog.socket remote-fs.target +[Service] +Type=forking +ExecStart=/usr/share/pen/scripts/rcpen start +ExecStop=/usr/share/pen/scripts/rcpen stop +[Install] +WantedBy=multi-user.system diff --git a/pen.spec b/pen.spec index 20ef8a8..7889e0c 100644 --- a/pen.spec +++ b/pen.spec @@ -1,7 +1,7 @@ # # spec file for package pen # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -27,6 +27,7 @@ Source0: http://siag.nu/pub/pen/%{name}-%{version}.tar.gz Source1: %{name}.cfg Source2: init.%{name} Source3: runpen.sh +Source4: pen.service PreReq: %insserv_prereq %fillup_prereq BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -72,32 +73,38 @@ mkdir -p $RPM_BUILD_ROOT/%_sbindir #make DESTDIR="$RPM_BUILD_ROOT" install %makeinstall # Install pen init script -mkdir -p $RPM_BUILD_ROOT/etc/init.d -install -m 0744 %SOURCE2 $RPM_BUILD_ROOT/etc/init.d/%{name} +install -d $RPM_BUILD_ROOT%{_datadir}/pen/scripts +install -m 0744 %SOURCE2 $RPM_BUILD_ROOT%{_datadir}/pen/scripts/rcpen +install -d $RPM_BUILD_ROOT%{_unitdir} +install -m 0444 %SOURCE4 $RPM_BUILD_ROOT%{_unitdir}/pen.service install -m 0744 %SOURCE3 $RPM_BUILD_ROOT/usr/bin/runpen.sh +install -d $RPM_BUILD_ROOT/etc install -m 0644 %SOURCE1 $RPM_BUILD_ROOT/etc/%{name}.cfg -ln -sf ../../etc/init.d/%{name} $RPM_BUILD_ROOT/usr/sbin/rc%{name} +ln -sf service $RPM_BUILD_ROOT/usr/sbin/rcpen mkdir -p ${RPM_BUILD_ROOT}%{_docdir} mv $RPM_BUILD_ROOT/usr/doc/pen ${RPM_BUILD_ROOT}%{_docdir} %clean rm -rf ${RPM_BUILD_ROOT} -%post -%{fillup_and_insserv -n pen pen} +%pre +%service_add_pre pen.service -%postun -%restart_on_update %{name} -%insserv_cleanup +%post +%service_add_post pen.service %preun -%stop_on_removal %{name} +%service_del_preun pen.service + +%postun +%service_del_postun pen.service %files %defattr(-,root,root) %{_docdir}/* %{_mandir}/man1/*.1.gz -/etc/init.d/%{name} +%{_datadir}/pen +%{_unitdir}/pen.service /usr/bin/%{name} /usr/bin/runpen.sh /usr/bin/mergelogs