longrun-make contains boilerplate code required to create the source directory of a longrun service based on strings.
longrun-make workingdir name type script dependencies
type can only be one of log | srv.
dependencies can only be one of "dependency1 dependency2 ..." | none.
workingdir/name-type.
workingdir/name-type/type
(literal "type") and writes the line longrun to it.
workingdir/name-type/notification-fd
and writes the line 3 to it.
workingdir/name-type/run
and writes script to it.
type is log and the file
workingdir/name-type/consumer-for
does not contain the string name:
workingdir/name-type/consumer-for
using
s6-setlock.
name-srv to the file
workingdir/name-type/consumer-for
creating it if it does not exist.
workingdir/name-type/pipeline-name,
truncating it if it does exist and adds the string name.
type is srv:
workingdir/name-type/producer-for
is created, truncated and the string name-log is added.
dependencies is not none:
workingdir/name-type/dependencies.d
is created.
"dependency1 dependency2 ..." in
dependencies separated by spaces,
a file
workingdir/name-type/dependencies.d/dependency
is created.
longrun-make is, by means of locking and checking for duplicates, specifically designed to allow parallel creation of logging source directories.