Summary: A collection of tools for managing UNIX services Name: daemontools-encore Version: 1.10 Release: 3.sme%{dist} License: Public domain Group: Utilities/System URL: http://untroubled.org/daemontools-encore/ Source: http://untroubled.org/daemontools-encore/%{name}-%{version}.tar.gz Source2: daemontools-svscanboot Source3: daemontools.service Buildroot: %_tmppath/%{name}-%{version} Obsoletes: daemontools Provides: daemontools BuildRequires: /usr/bin/perl %description daemontools-encore is a collection of tools for managing UNIX services. It is derived from the public-domain release of daemontools by D. J. Bernstein, which can be found at http://cr.yp.to/daemontools.html daemontools-encore adds numerous enhancements above what daemontools could do while maintaining backwards compatibility with daemontools. See the CHANGES file for more details on what features have been added. I realize there are other supervisory systems that will handle some or all of the tasks that this package does better. I am providing this package as a service to those who prefer the semantics and handling that daemontools provides. %prep %setup perl -i -pe 'if ($. == 1) { s!^!%{buildroot}!; s!local/!! }' conf-bin perl -i -pe 'if ($. == 1) { s!^!%{buildroot}!; s!local!share! }' conf-man %build make %install mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_mandir} DESTDIR=%{buildroot} make install %if %{rhel} >= 7 mkdir -p %{buildroot}/usr/lib/systemd/system install -m 0644 %{SOURCE3} %{buildroot}/usr/lib/systemd/system %endif %if %{rhel} == 6 mkdir -p %{buildroot}%{_sysconfdir}/init install -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/init/svscanboot.conf %endif mkdir -p %{buildroot}/service %post %if %{rhel} >= 7 if [ -e /usr/bin/systemctl ] ; then systemctl enable daemontools systemctl start daemontools fi %endif %if %{rhel} == 6 /sbin/initctl start svscanboot || true %endif %if %{rhel} < 6 # Add svscanboot to inittab if [ ! -f /etc/inittab ]; then echo "No /etc/inittab found - required svscanboot line not added!" exit 1 elif grep svscanboot /etc/inittab >/dev/null; then echo "svscanboot line found in /etc/inittab - I assume svscan is already running" else rm -f /etc/inittab.rpmnew cp /etc/inittab /etc/inittab.rpmnew || exit 1 echo >> /etc/inittab.rpmnew echo '# Start daemontools svscan' >> /etc/inittab.rpmnew echo 'SV:123456:respawn:/usr/bin/svscanboot' >> /etc/inittab.rpmnew mv -f /etc/inittab.rpmnew /etc/inittab kill -HUP 1 echo "Added svscanboot to /etc/inittab - init should start svscan now." fi %endif # symink executables to legacy SME directory for prog in envdir envuidgid fghack multilog pgrphack readproctitle setlock setuidgid softlimit supervise svc svok svscan svscanboot svstat ; do /bin/ln -s /bin/$prog /usr/local/bin/$prog done %postun if [ "$1" -eq 0 ]; then %if %{rhel} >= 7 if [ -e /usr/bin/systemctl ] ; then systemctl stop daemontools systemctl disable daemontools fi %endif %if %{rhel} == 6 /sbin/initctl stop svscanboot %endif %if %{rhel} < 6 # Remove svscanboot entry from inittab if grep svscanboot /etc/inittab >/dev/null; then grep -v svscan /etc/inittab > /etc/inittab.rpmnew mv -f /etc/inittab.rpmnew /etc/inittab kill -HUP 1 echo "Removed svscanboot from /etc/inittab." fi %endif fi %files %defattr(-,root,root) %attr(0755,root,root) /usr/bin/* /usr/share/man/man8/* %if %{rhel} >= 7 /usr/lib/systemd/system/daemontools.service %endif %if %{rhel} == 6 %{_sysconfdir}/init/*conf %endif %dir %attr(0755,root,root) /service %doc README CHANGES CHANGES.djb LICENSE TODO %changelog * Thu Jan 16 2025 Trevor Batley 1.10-3 - check that systemctl exists in post install - symlink executables to legacy sme directory * Wed Feb 04 2015 Gavin Carr 1.10-1 - Initial package.