From bf5d9a42fb1b195453a665f177bc52f5502afff2 Mon Sep 17 00:00:00 2001 From: serek Date: Sat, 9 Dec 2000 20:56:17 +0000 Subject: [PATCH] - new version; added rc files designed by serek; removed outdated sources. Changed files: daemontools.init -> 1.1 daemontools.spec -> 1.7 daemontools.sysconfig -> 1.1 --- daemontools.init | 74 +++++++++++++++++++++++++++++ daemontools.spec | 108 +++++++++++++++++++++++++----------------- daemontools.sysconfig | 2 + 3 files changed, 141 insertions(+), 43 deletions(-) create mode 100644 daemontools.init create mode 100644 daemontools.sysconfig diff --git a/daemontools.init b/daemontools.init new file mode 100644 index 0000000..0c4a23f --- /dev/null +++ b/daemontools.init @@ -0,0 +1,74 @@ +#!/bin/sh +# +# svscan svscan (scan and run services) +# +# chkconfig: 345 66 45 +# +# description: svscan (scan and run services) is a server part of the daemontools suite. +# +# id: $Id$ +# + +# Source function library +. /etc/rc.d/init.d/functions + +# Get network config +. /etc/sysconfig/network + +# Get service config +[ -f /etc/sysconfig/svscan ] && . /etc/sysconfig/svscan + +# Check that networking is up. +if is_no "${NETWORKING}"; then + msg_Network_Down svscan + exit 1 +fi + + +# See how we were called. +case "$1" in + start) + # Check if the service is already running? + if [ ! -f /var/lock/subsys/svscan ]; then + msg_starting svscan; busy + # we can't get status report from background job + # but we can only do simple file check + if [ -w $SVSCAN_DIR ]; then + svscan $SVSCAN_DIR & + ok + RETVAL=0 + else + fail + echo "Missing service directory!" + echo "Create $SVSCAN_DIR first." + RETVAL=1 + fi + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/svscan + else + msg_Already_Running svscan + fi + ;; + stop) + if [ -f /var/lock/subsys/service ]; then + msg_stopping svscan + killproc svscan + rm -f /var/run/svscan.pid /var/lock/subsys/svscan >/dev/null 2>&1 + else + msg_Not_Running svscan + exit 1 + fi + ;; + restart) + $0 stop + $0 start + ;; + status) + status svscan + exit $? + ;; + *) + msg_Usage "$0 {start|stop|status|restart}" + exit 1 +esac + +exit $RETVAL diff --git a/daemontools.spec b/daemontools.spec index 271bd82..fcc5c3a 100644 --- a/daemontools.spec +++ b/daemontools.spec @@ -1,70 +1,92 @@ -Summary: DJB daemontools +Summary: D. J. Bernstein daemontools Name: daemontools -Version: 0.53 -Release: 1 +Version: 0.70 +Release: 2 Copyright: D. J. Bernstein Group: Networking/Admin Group(pl): Sieciowe/Administacyjne -Source0: ftp://koobera.math.uic.edu/www/software/%{name}-%{version}.tar.gz +Source0: http://cr.yp.to/%{name}/%{name}-%{version}.tar.gz +Source1: ftp://ftp.innominate.org/pub/pape/djb/%{name}-%{version}-man.tar.gz +Source2: %{name}.sysconfig +Source3: %{name}.init BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description -supervise monitors a service. It starts the service and restarts the -service if it dies. The companion svc program stops, pauses, or -restarts the service on sysadmin request. The svstat program prints a -one-line status report. +daemontools is a collection of tools for managing UNIX services. -cyclog writes a log to disk. It automatically synchronizes the log -every 100KB (by default) to guarantee data integrity after a crash. It -automatically rotates the log to keep it below 1MB (by default). If -the disk fills up, cyclog pauses and then tries again, without losing -any data. +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. -accustamp puts a precise timestamp on each line of input. The -timestamp is a numeric TAI timestamp with microsecond precision. The -companion tailocal program converts TAI timestamps to local time. - -usually watches a log for lines that do not match specified patterns, -copying those lines to stderr. The companion errorsto program -redirects stderr to a file. - -setuser runs a program under a user's uid and gid. Unlike su, setuser -does not gain privileges; it does not check passwords, and it cannot -be run except by root. +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 +tar zxf %{SOURCE1} + %setup -q %build -echo %{_bindir} >conf-bin -echo %{_mandir} >conf-man +echo %{_bindir} >conf-home -make; make man +make %install rm -rf $RPM_BUILD_ROOT -install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1} -install accustamp $RPM_BUILD_ROOT%{_bindir} -install cyclog $RPM_BUILD_ROOT%{_bindir} -install errorsto $RPM_BUILD_ROOT%{_bindir} -install fifo $RPM_BUILD_ROOT%{_bindir} -install supervise $RPM_BUILD_ROOT%{_bindir} -install svc $RPM_BUILD_ROOT%{_bindir} -install svstat $RPM_BUILD_ROOT%{_bindir} -install tailocal $RPM_BUILD_ROOT%{_bindir} -install testfilelock $RPM_BUILD_ROOT%{_bindir} -install usually $RPM_BUILD_ROOT%{_bindir} -install setuser $RPM_BUILD_ROOT%{_bindir} -install *.1 $RPM_BUILD_ROOT%{_mandir}/man1 +install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man8} +install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} +install -d $RPM_BUILD_ROOT/var/run/service +install -d $RPM_BUILD_ROOT/var/lib/service -gzip -9nf BLURB CHANGES INSTALL README THANKS TODO VERSION $RPM_BUILD_ROOT%{_mandir}/man1/*.1 +install envdir $RPM_BUILD_ROOT%{_sbindir} +install envuidgid $RPM_BUILD_ROOT%{_sbindir} +install fghack $RPM_BUILD_ROOT%{_sbindir} +install multilog $RPM_BUILD_ROOT%{_sbindir} +install setlock $RPM_BUILD_ROOT%{_sbindir} +install setuidgid $RPM_BUILD_ROOT%{_sbindir} +install softlimit $RPM_BUILD_ROOT%{_sbindir} +install supervise $RPM_BUILD_ROOT%{_sbindir} +install svc $RPM_BUILD_ROOT%{_sbindir} +install svok $RPM_BUILD_ROOT%{_sbindir} +install svscan $RPM_BUILD_ROOT%{_sbindir} +install svstat $RPM_BUILD_ROOT%{_sbindir} +install tai64n $RPM_BUILD_ROOT%{_sbindir} +install tai64nlocal $RPM_BUILD_ROOT%{_sbindir} +install ../%{name}-%{version}-man/*.8 $RPM_BUILD_ROOT%{_mandir}/man8 +install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/svscan +install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/svscan + +gzip -9nf CHANGES README TODO VERSION $RPM_BUILD_ROOT%{_mandir}/man8/*.8 %clean rm -rf $RPM_BUILD_ROOT +#rm -rf ../%{name}-%{version}-man + +%post +/sbin/chkconfig --add svscan +if [ -f /var/lock/subsys/svscan ]; then + /etc/rc.d/init.d/svscan restart >&2 +else + echo "Execute \"/etc/rc.d/init.d/svscan\" to start svscan daemon." +fi + +%preun +if [ "$1" = "0" ]; then + if [ -f /var/lock/subsys/svscan ]; then + /etc/rc.d/init.d/svscan stop >&2 + fi + /sbin/chkconfig --del svscan +fi %files %defattr(644,root,root,755) -%doc {BLURB,CHANGES,INSTALL,README,THANKS,TODO,VERSION}.gz +%doc {CHANGES,README,TODO,VERSION}.gz %attr(644,root,root) %{_mandir}/* -%attr(755,root,root) %{_bindir}/* +%attr(755,root,root) %{_sbindir}/* +%attr(700,root,root) /var/run/service +%attr(700,root,root) /var/lib/service +%attr(754,root,root) /etc/rc.d/init.d/svscan +%config(noreplace) %verify(not size mtime md5) /etc/sysconfig/svscan diff --git a/daemontools.sysconfig b/daemontools.sysconfig new file mode 100644 index 0000000..40e2cbd --- /dev/null +++ b/daemontools.sysconfig @@ -0,0 +1,2 @@ +# location of svscan service (directory): +SVSCAN_DIR="/var/run/service" -- 2.44.0