Launchtool

launchtool is a tool that runs a user-supplied command and can supervise its execution in many ways, such as controlling its environment, blocking signals, logging its output, changing user and group permissions, limiting resource usage, restarting it if it fails, running it continuously and turn it into a daemon.

It is fully configurable, both through the commandline and using configuration files. Configuration files can be made executable and start with #!/usr/bin/launchtool -C, to create daemons using simpler commands.

News

Released launchtool 0.8

I have released version 0.8 of launchtool. Changes are minor, mostly fixes to the autotools packaging.

It is a good opportunity to document my intentions for future development: launchtool is a bit like start-stop-daemon. The differences are:

  • launchtool is more featureful;
  • start-stop-daemon is more tested.

Ideally, everything should be reorganised so that one can use start-stop-daemon instead of launchtool, without losing features.

The best way to do so, is to remove from launchtool those features that are in start-stop-daemon, and turn what remains into an application wrapper that handles restart policies and logging.

Features that are already in start-stop-daemon:

   -k, --kill[=signal]
   --check
   -d, --daemon, “daemon”
   -n, --no-daemon
   --pidfile, “pidfile”
   --no-pidfile
   --piddir=dir, “piddir”
   --chroot=dir, “root dir”
   --chdir=dir, “start dir”
   -u, --user=user, “user”
   -g, --group=group, “group”
   --umask=mask, “umask”

Features that can be implemented in a simple wrapper/supervisor command:

   -L, --infinite-runs, “infinite runs”
   --no-infinite-runs
   --wait-times=t1,t2,... , “wait times”
   --good-running-time=seconds, “good running time”
   --forwarded-signals=sig1,sig2,... , “forwarded signals”
   --blocked-signals=sig1,sig2,... , “blocked signals”
   --limit-cpu=seconds, “cpu limit”
   --limit-file-size=1024b-blocks, “file size limit”
   --limit-data-memory=1024b-blocks, “data memory limit”
   --limit-process-count=count, “process count limit”
   --limit-open-files=count, “open files limit”
   --limit-core-size=1024b-blocks, “core size limit”
   --restrict-environment, “restrict environment”
   --no-restrict-environment
   --allowed-env-vars=var1,var2,... , “allowed env vars”
   --log-launchtool-output=target, “launchtool output”
   --log-launchtool-errors=target, “launchtool errors”
   --log-child-output=target, “command output”
   --log-child-errors=target, “command errors”
   --silent-restart-status=value, “silent restart status”
   --silent-restart-time=seconds, “silent restart time”
   --stats, “stats”
   --no-stats

I do not know when I will have time to dedicate to launchtool. Most of the work should be rather straightforward, as it's based on the existing code.

Also, most of the code in common/ has now been cleaned up and is now maintained in the wibble library, so launchtool's code can be made to shrink considerably.

My time to work on it is limited, but I welcome patches, offers of group maintenance or offers to take over maintainership.

Posted Wed 08 Jul 2009 14:23:30 CEST Tags: sw/launchtool