#!/bin/sh # Bourne shell daemon for `run` scripts used with # D. J. Bernstein's daemontools. # # Specifically designed for programs or scripts # that run, process, and exit repeatedly. # This provides a higher frequency than # what cron can provide. # # Written by: Jeremy Brand # http://www.nirvani.net/software/ # # Version 1.0.1 # # Copy this file into /service/your_program/mydaemon # Then, exec ./mydaemon from the ./run script. # Need to catch this signal for `svc -d` trap 'exit 0' TERM while :; do # Something (let your process run and exit) # Sleep (usually sleep a while before starting again) done