D. J. Bernstein UNIX daemontools The setlock program setlock runs another program with a file locked. Interface setlock opts fn child opts is a series of getopt-style options. fn is a single argument. child consists of one or more arguments. setlock opens fn for writing (creating it if it does not exist), obtains an exclusive lock on it, and runs child. Normally the lock disappears when child exit