Re: s6 ordering and run-once?

From: Wayne Marshall <>
Date: Tue, 16 Jun 2015 19:30:45 -0700

On Tue, 16 Jun 2015 20:58:35 -0400
Steve Litt <> wrote:

> > > Does anyone know how to do a run-once service without putting an
> > > infinite sleep loop at the end?

In perp you would simply touch(1) a file named "flag.once" in the
service definition directory. See the section STARTUP MODIFICATION in
the perpd(8) man page for the full story:

> What do you do if a oneshot requires that a longrun is already
> running?

In perp you would simply use the perpok(8) utility to test for the
required service, and use the runpause(8) utility to hack oneshot into
a persistent process (_not_ using the "flag.once" flagfile in this

Here is a complete perp runscript example for oneshot, as would be found
in the file /etc/perp/oneshot/rc.main:

exec 2>&1

if test $1 = 'start' ; then
  if ! perpok -u3 longrun ; then
    echo "dependency failure: longrun not running..."
    exit 1
    echo "starting oneshot..."
    exec runpause -L 'oneshot' 0 /bin/true

if test $1 = 'reset' ; then
  echo "resetting oneshot..."

### eof

The relevant manual pages:



Received on Wed Jun 17 2015 - 02:30:45 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:19 UTC