Rename project to catsit

This commit is contained in:
C. McEnroe 2020-08-15 16:40:15 -04:00
parent 449b0918ce
commit 6fb08baee3
7 changed files with 43 additions and 42 deletions

5
.gitignore vendored
View File

@ -1,5 +1,6 @@
*.o
catsit
catsit.conf
catsitd
config.mk
spawn
spawnd
tags

View File

@ -8,9 +8,9 @@ CFLAGS += -D'ETCDIR="${ETCDIR}"' -D'RUNDIR="${RUNDIR}"'
-include config.mk
BINS = spawn spawnd
BINS = catsit catsitd
MAN8 = ${BINS:=.8}
MAN5 = spawntab.5
MAN5 = catsit.conf.5
OBJS += daemon.o
OBJS += service.o
@ -19,7 +19,7 @@ dev: tags all
all: ${BINS}
spawnd: ${OBJS}
catsitd: ${OBJS}
${CC} ${LDFLAGS} ${OBJS} ${LDLIBS} -o $@
${OBJS}: daemon.h

View File

@ -1,10 +1,10 @@
.Dd August 13, 2020
.Dt SPAWN 8
.Dd August 15, 2020
.Dt CATSIT 8
.Os
.
.Sh NAME
.Nm spawn
.Nd spawnd control
.Nm catsit
.Nd catsitd control
.
.Sh SYNOPSIS
.Nm
@ -17,7 +17,7 @@ The
.Nm
utility controls
the services managed by the
.Xr spawnd 8
.Xr catsitd 8
daemon.
It does so by writing
the remainder of its command line
@ -25,7 +25,7 @@ to a named pipe.
.
.Pp
Communication with
.Xr spawnd 8
.Xr catsitd 8
is unidirectional.
The daemon logs any feedback
with syslog.
@ -70,7 +70,7 @@ so they are not interpreted by the shell.
.
.Sh ENVIRONMENT
.Bl -tag -width Ds
.It Ev SPAWND_PIPE
.It Ev CATSITD_PIPE
The path of the named pipe.
The
.Fl c
@ -79,19 +79,19 @@ flag overrides this variable.
.
.Sh FILES
.Bl -tag -width Ds
.It Pa /var/run/spawnd.pipe
.It Pa /var/run/catsitd.pipe
The default path of the named pipe.
.El
.
.Sh EXAMPLES
.Bd -literal
spawn start pounce/freenode
spawn status '*'
spawn USR1 'pounce/*'
catsit start pounce/freenode
catsit status '*'
catsit USR1 'pounce/*'
.Ed
.
.Sh SEE ALSO
.Xr spawnd 8
.Xr catsitd 8
.
.Sh AUTHORS
.An June Bug Aq Mt june@causal.agency

View File

@ -1,16 +1,16 @@
.Dd August 13, 2020
.Dt SPAWNTAB 5
.Dt CATSIT.CONF 5
.Os
.
.Sh NAME
.Nm spawntab
.Nd spawnd services list
.Nm catsit.conf
.Nd catsitd services list
.
.Sh DESCRIPTION
The
.Nm
file lists the services managed by the
.Xr spawnd 8
.Xr catsitd 8
daemon.
Leading whitespace is ignored.
Each line of the file
@ -65,7 +65,7 @@ pounce/tilde $pounce $conf/tilde.conf
.El
.
.Sh SEE ALSO
.Xr spawnd 8
.Xr catsitd 8
.
.Sh AUTHORS
.An June Bug Aq Mt june@causal.agency

View File

@ -6,18 +6,18 @@ die() {
exit 1
}
: ${SPAWND_PIPE:=/var/run/spawnd.pipe}
: ${CATSITD_PIPE:=/var/run/catsitd.pipe}
while getopts 'c:' opt; do
case "${opt}" in
(c) SPAWND_PIPE=$OPTARG;;
(c) CATSITD_PIPE=$OPTARG;;
(?) exit 1;;
esac
done
shift $((OPTIND - 1))
if ! [ -p "${SPAWND_PIPE}" ]; then
die "${SPAWND_PIPE} is not a named pipe"
if ! [ -p "${CATSITD_PIPE}" ]; then
die "${CATSITD_PIPE} is not a named pipe"
fi
[ $# -lt 1 ] && die 'action required'
@ -31,4 +31,4 @@ if [ "${action}" != "${valid}" ]; then
die "${action} is not a valid action or signal"
fi
echo "$@" > "${SPAWND_PIPE}"
echo "$@" > "${CATSITD_PIPE}"

View File

@ -1,9 +1,9 @@
.Dd August 13, 2020
.Dt SPAWND 8
.Dt CATSITD 8
.Os
.
.Sh NAME
.Nm spawnd
.Nm catsitd
.Nd process supervisor
.
.Sh SYNOPSIS
@ -11,7 +11,7 @@
.Op Fl d
.Op Fl C Ar path
.Op Fl c Ar control
.Op Fl f Ar spawntab
.Op Fl f Ar config
.Op Fl g Ar group
.Op Fl p Ar pidfile
.Op Fl s Ar stopexits
@ -50,14 +50,14 @@ Exponential backoff is applied to restarts.
.
.Pp
The list of services is defined in a
.Xr spawntab 5
.Xr catsit.conf 5
file.
The services managed by
.Nm
can be controlled
through a named pipe.
The
.Xr spawn 8
.Xr catsit 8
utility is a wrapper
around the named pipe,
and its manual page
@ -80,9 +80,9 @@ used for control.
.It Fl d
Do not run as a daemon.
.
.It Fl f Ar spawntab
.It Fl f Ar config
Set the path of the
.Xr spawntab 5
.Xr catsit.conf 5
file.
.
.It Fl g Ar group
@ -136,7 +136,7 @@ daemon receives the
.Dv HUP
signal,
the
.Xr spawntab 5
.Xr catsit.conf 5
file is reloaded.
Modified services
are not automatically restarted,
@ -180,18 +180,18 @@ in
.
.Sh FILES
.Bl -tag -width Ds
.It Pa /usr/local/etc/spawntab
.It Pa /usr/local/etc/catsit.conf
The default path of the
.Xr spawntab 5
.Xr catsit.conf 5
file.
.It Pa /var/run/spawnd.pipe
.It Pa /var/run/catsitd.pipe
The default path of the named pipe
used for control.
.El
.
.Sh SEE ALSO
.Xr spawntab 5 ,
.Xr spawn 8
.Xr catsit.conf 5 ,
.Xr catsit 8
.
.Sh AUTHORS
.An June Bug Aq Mt june@causal.agency

View File

@ -191,8 +191,8 @@ int main(int argc, char *argv[]) {
setAdd(&stopExits, EX_CONFIG);
const char *pidPath = NULL;
const char *configPath = ETCDIR "/spawntab";
const char *fifoPath = RUNDIR "/spawnd.pipe";
const char *configPath = ETCDIR "/catsit.conf";
const char *fifoPath = RUNDIR "/catsitd.pipe";
const char *userName = NULL;
const char *groupName = NULL;