summary refs log tree commit diff
path: root/catsitd.8
diff options
context:
space:
mode:
Diffstat (limited to 'catsitd.8')
-rw-r--r--catsitd.8197
1 files changed, 197 insertions, 0 deletions
diff --git a/catsitd.8 b/catsitd.8
new file mode 100644
index 0000000..cdb77a0
--- /dev/null
+++ b/catsitd.8
@@ -0,0 +1,197 @@
+.Dd August 13, 2020
+.Dt CATSITD 8
+.Os
+.
+.Sh NAME
+.Nm catsitd
+.Nd process supervisor
+.
+.Sh SYNOPSIS
+.Nm
+.Op Fl d
+.Op Fl C Ar path
+.Op Fl c Ar control
+.Op Fl f Ar config
+.Op Fl g Ar group
+.Op Fl p Ar pidfile
+.Op Fl s Ar stopexits
+.Op Fl t Ar interval
+.Op Fl u Ar user
+.
+.Sh DESCRIPTION
+The
+.Nm
+daemon
+is a supervisor for processes
+with the following behavior:
+.Bl -enum
+.It
+The process runs in the foreground,
+not as a daemon.
+.It
+The process logs to standard output or standard error.
+.It
+The process handles errors by exiting
+and expects to be restarted.
+.It
+The process indicates its reason for exiting with
+.Xr sysexits 3 .
+.El
+.
+.Pp
+The
+.Nm
+daemon spawns processes for a list of
+.Em services ,
+redirects their output to syslog,
+and restarts the processes when they exit
+according to their exit status.
+Exponential backoff is applied to restarts.
+.
+.Pp
+The list of services is defined in a
+.Xr catsit.conf 5
+file.
+The services managed by
+.Nm
+can be controlled
+through a named pipe.
+The
+.Xr catsit 8
+utility is a wrapper
+around the named pipe,
+and its manual page
+describes the control command format.
+.
+.Pp
+The arguments are as follows:
+.Bl -tag -width Ds
+.It Fl C Ar path
+Change directory to
+.Ar path
+before starting services.
+By default the working directory is
+.Pa / .
+.
+.It Fl c Ar control
+Set the path of the named pipe
+used for control.
+.
+.It Fl d
+Do not run as a daemon.
+.
+.It Fl f Ar config
+Set the path of the
+.Xr catsit.conf 5
+file.
+.
+.It Fl g Ar group
+Change group to
+.Ar group
+before starting services.
+If
+.Fl u
+is used,
+the default group is the user's group.
+.
+.It Fl p Ar pidfile
+Write the PID of the
+.Nm
+process to
+.Ar pidfile .
+.
+.It Fl s Ar stopexits
+Set the list of exit statuses
+for which a restart will not be attempted.
+The
+.Ar stopexits
+argument is a comma-separated list of integers.
+The default list contains the values of
+.Dv EX_USAGE ,
+.Dv EX_DATAERR ,
+.Dv EX_NOINPUT ,
+.Dv EX_OSFILE ,
+.Dv EX_CANTCREAT ,
+.Dv EX_CONFIG
+defined in
+.Xr sysexits 3 .
+The exit status 127
+is always treated as a stop exit.
+.
+.It Fl t Ar interval
+Set the initial interval between restarts
+in milliseconds.
+The default interval is 1000.
+.
+.It Fl u Ar user
+Change user to
+.Ar user
+before starting services.
+.El
+.
+.Pp
+When the
+.Nm
+daemon receives the
+.Dv HUP
+signal,
+the
+.Xr catsit.conf 5
+file is reloaded.
+Modified services
+are not automatically restarted,
+newly added services
+are not automatically started,
+and removed services
+are not automatically stopped.
+.
+.Pp
+When the
+.Nm
+daemon receives the
+.Dv TERM
+signal,
+the control named pipe is closed,
+all services are stopped,
+and
+.Nm
+exits.
+.
+.Sh ENVIRONMENT
+Services are started
+with empty environments
+apart from the following:
+.Bl -tag -width Ds
+.It Ev LOGNAME , Ev USER
+Set to the name of the user specified by
+.Fl u .
+.It Ev HOME
+Set to the home directory of the user specified by
+.Fl u .
+.It Ev SHELL
+Set to
+.Pa /bin/sh .
+.It Ev PATH
+Set to the system default defined by
+.Dv _PATH_DEFPATH
+in
+.In paths.h .
+.El
+.
+.Sh FILES
+.Bl -tag -width Ds
+.It Pa /usr/local/etc/catsit.conf
+The default path of the
+.Xr catsit.conf 5
+file.
+.It Pa /var/run/catsitd.pipe
+The default path of the named pipe
+used for control.
+.El
+.
+.Sh SEE ALSO
+.Xr catsit.conf 5 ,
+.Xr catsit 8
+.
+.Sh AUTHORS
+.An June Bug Aq Mt june@causal.agency