# static configuration daemonproxy [OPTIONS] -c CONFIG_FILE # control via unix socket daemonproxy [OPTIONS] -S PATH # for interactive experiments daemonproxy [OPTIONS] -i
The purpose of the proxy design is to preserve file descriptors, process hierarchy, and monitoring state in the event that your control script crashes or locks up. Daemonproxy acts as a watchdog for the control script and can restart it, and the control script can then re-sync with the state of daemonproxy.
This option cannot be used when running as PID 1, and is incompatible with --interactive, and suppresses the default logging. (see: log.dest command)
This causes daemonproxy to exec into another program on any condition which would otherwise cause daemonproxy to exit. This includes anything from normal program termination to fatal signals like SIGSEGV.
In practice, ascii control characters shouldn't be needed, and the absence of quoting/escaping makes the protocol easier to implement in your script.
A full protocol reference can be found in the documentation included with daemonproxy. However, here is a quick reference guide:
MIN_INTERVAL counts from the time of the previous start attempt, so if the service has been running longer than MIN_INTERVAL and it exits while a trigger is true, it will be restarted immediately. MIN_INTERVAL cannot be less than 1 second. A MIN_INTERVAL of '-' disables auto-up.
Currently, triggers are 'always', SIGINT, SIGHUP, SIGTERM, SIGUSR1, SIGUSR2, SIGQUIT.
'always' means the service will always start if it is not already running. Using 'always' with a large MIN_INTERVAL can give you a cron-like effect, if you want a periodicaly-run service and don't care what specific time it runs.
Signal triggers cause the service to start if the pending count of that signal is nonzero. (and the service is expected to issue the command ``signal.clear'' to reset the count to zero, to prevent being started again)
WARNING: the file descriptor will be put into non-blocking mode, so it is best not to share this descriptor with other processes, especially processes that might reset it to a blocking state and cause daemonproxy to hang on a blocked logging pipe. (However, if you're one of those types who preferrs your daemons freeze up when the logging is interrupted, then here's your workaround.)
Only one controller socket may exist. If create is called a second time, the previous socket will be unlinked.
If the terminate-guard feature is enabled, then you need an additional argument of the correct code in order for the command to happen.
If the exec-on-exit feature is enabled, daemonproxy will exec() instead of exit(). If daemonproxy is process 1, terminate will fail unless exec-on-exit is enabled.