Summary: A collection of tools for managing UNIX services Name: daemontools Version: 0.76 Release: 1%{?dist} License: See djb@pobox.com Group: Utilities/System Source0: http://cr.yp.to/daemontools/daemontools-%{version}.tar.gz BuildRoot: /tmp/daemontools-buildroot URL: http://cr.yp.to/daemontools.html Packager: John Simpson %description daemontools is a collection of tools for managing UNIX services. supervise monitors a service. It starts the service and restarts the service if it dies. Setting up a new service is easy: all supervise needs is a directory with a run script that runs the service. multilog saves error messages to one or more logs. It optionally timestamps each line and, for each log, includes or excludes lines matching specified patterns. It automatically rotates logs to limit the amount of disk space used. If the disk fills up, it pauses and tries again, without losing any data. %prep %setup -n admin/daemontools-0.76/src echo gcc %{optflags} -I. >conf-cc echo gcc %{optflags} -I. -s >conf-ld echo %{buildroot}/usr/local >home mkdir sys echo '#include ' >sys/time.h echo '#include ' >>sys/time.h sed -e 's/extern int errno;/#include /' error.h.tmp mv error.h.tmp error.h %build make %install rm -fr %{buildroot} mkdir -p %{buildroot}/usr/local/bin while read command; do install -m 0755 $command %{buildroot}/usr/local/bin/$command done <../package/commands %clean rm -rf %{buildroot} %post ############################################################################### # # post-install script ######################################## # Check /service directory if [[ -d /service ]] then echo '/service already exists' else echo 'Creating /service' mkdir -m 0755 /service fi ######################################## # upstart in /etc/init (CentOS 6, others) if [[ -d /etc/init ]] then echo 'Found upstart in /etc/init' if [[ -f /etc/init/daemontools.conf ]] then echo '/etc/init/daemontools.conf already exists' else echo 'Adding daemontools to upstart' cat > /etc/init/daemontools.conf < /etc/event.d/daemontools.conf </dev/null then echo 'inittab contains an svscanboot line. I assume that svscan is already running.' else echo 'Adding svscanboot to inittab...' rm -f /etc/inittab'{new}' cp /etc/inittab /etc/inittab'{new}' cat >> /etc/inittab'{new}' </dev/null then echo 'rc.local contains an svscanboot line. I assume that svscan is already running.' else echo 'Adding svscanboot to /etc/rc.local...' rm -f /etc/rc.local'{new}' cp /etc/rc.local /etc/rc.local'{new}' cat >> /etc/rc.local'{new}' </dev/null then echo 'Removing svscanboot from /etc/inittab' grep -v svscanboot /etc/inittab > /etc/inittab'{new}' chmod 0644 /etc/inittab'{new}' mv -f /etc/inittab'{new}' /etc/inittab kill -HUP 1 fi fi ######################################## # if it's in /etc/rc.local, remove it and try to manually kill it if [[ -f /etc/rc.local ]] then if grep svscanboot /etc/rc.local >/dev/null then echo 'Removing svscanboot from /etc/rc.local' grep -v svscanboot /etc/rc.local > /etc/rc.local'{new}' chmod 0644 /etc/rc.local'{new}' mv -f /etc/rc.local'{new}' /etc/rc.local X=`ps -o pid= -C svscanboot` if [[ -n "$X" ]] then echo "Killing svscanboot [$X]" kill $X fi X=`ps -o pid= -C svscan` if [[ -n "$X" ]] then echo "Killing svscan [$X]" kill $X fi fi fi # end of pre-uninstall script # ############################################################################### %files /usr/local/bin/* %changelog * Mon Jan 6 2014 John Simpson - Added post-install and pre-uninstall scripts for upstart/init/rc.local * Fri Feb 9 2007 Bruce Guenter - Updated to version 0.76 finally. * Thu May 5 2001 Bruce Guenter - Added a hack to allow building on glibc 2.2 systems (such as RedHat 7.x) * Fri Dec 1 2000 Bruce Guenter - Reverted to a completely plain, unmodified install. * Mon Mar 6 2000 Bruce Guenter - Updated to version 0.70. * Mon Dec 6 1999 Bruce Guenter - Modified svscan init script to start all services as "down" on startup, and to clean up properly on exit. - Removed /var/lock/svc directory.