Commit Graph

97 Commits

Author SHA1 Message Date
b9454e9f1c
Repair setproctitle (libbsd)
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2022-04-22 08:07:45 +00:00
2bec10927f
Add signal log notice
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2022-04-22 03:03:08 +00:00
01e774c619
Fix segfault on signal
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2022-04-22 02:50:25 +00:00
94b3b79c56
Add fish wrapper
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2022-04-21 20:18:20 +00:00
bd799c6bb8
Init README
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2022-04-21 18:50:02 +00:00
6d29c032a7
Sys-V init script
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2022-04-21 18:28:53 +00:00
337b353624
Initial Linux port
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2022-04-21 18:26:49 +00:00
June McEnroe
dfee8d5009 Use one MANS variable in Makefile 2022-02-26 05:33:32 +00:00
C. McEnroe
3834500472 Show /var/log/messages after catsit command 2021-09-28 17:04:04 -04:00
C. McEnroe
f5888b8f83 Refer to glob(7) 2021-09-28 16:41:43 -04:00
C. McEnroe
909cbf3029 Allow backslash line continuation in catsit.conf 2021-09-28 16:18:48 -04:00
C. McEnroe
b5437a42f9 Allocate pollfd array rather than using a VLA 2021-09-26 18:11:38 -04:00
C. McEnroe
55c4755943 Use reallocarray(3) 2021-09-26 17:51:03 -04:00
C. McEnroe
f346f61ea0 Don't parse config until after daemonization
And consequently, until after pledge(2) and unveil(2) on OpenBSD.
Replace parsing before daemonization with a simple check that the
file is readable. There's not much that can go wrong in parsing
anyway.
2021-09-26 17:39:08 -04:00
C. McEnroe
bdcb9ab46f OpenBSD: Simplify pledge(2) and unveil(2) strategy 2021-09-26 17:25:58 -04:00
C. McEnroe
3769acfdc7 Fix inverted exec prepend logic
Well that's embarrassing.
2021-09-25 03:31:14 +00:00
C. McEnroe
972922209d Remove freenode 2021-05-19 11:18:26 -04:00
C. McEnroe
207da7ffcf Skip leading whitespace on prepends and commands 2021-03-01 19:41:01 -05:00
C. McEnroe
e9901e30a2 Only prepend exec if command line doesn't contain ;&|() 2021-03-01 19:29:27 -05:00
C. McEnroe
0384c2abd7 Exit with EX_TEMPFAIL when watching files
Reason being that if a file disappears and it takes longer for it
to reappear than the default restart interval, the service would
just get stopped. Treat an initially missing file the same as a
file that gets deleted.
2021-03-01 19:09:40 -05:00
C. McEnroe
f89fe20dde Add -d flag to catsit-watch 2021-02-27 19:34:30 -05:00
C. McEnroe
c7b117f37a Add -a to catsit-watch 2021-02-27 15:44:24 -05:00
C. McEnroe
69c1b1b2ac Add catsit-timer utility 2021-02-25 19:45:56 -05:00
C. McEnroe
fd25c666d5 Add catsit-watch utility 2021-02-25 15:49:37 -05:00
C. McEnroe
8bd0b51140 Drop pledge privileges after daemonization 2021-02-01 14:47:32 -05:00
C. McEnroe
cc8a88c059 Remove use of "%n"
https://cvsweb.openbsd.org/src/lib/libc/stdio/vfprintf.c?rev=1.79&content-type=text/x-cvsweb-markup

I think this is silly, as I've said elsewhere, and it's a shame
because that was clearly the best way to write this. Oh well.
2021-02-01 11:39:25 -05:00
C. McEnroe
da4ccb18f4 Check signals first in the loop
Signals need to be checked first in the loop to catch any that were
delivered between setting up the signals handlers and entering the
loop, i.e. in the time it takes to initially start each of the
services.
2021-02-01 11:36:31 -05:00
C. McEnroe
7769a4f6e9 Log a message when stopping a service waiting to restart
It's a little annoying to have to special-case this, but otherwise there
is no confirmation in the log that the restart won't still happen.
2020-12-15 16:47:12 -05:00
C. McEnroe
b7ebd38698 Refactor unveil calls so errors can be reported properly 2020-11-10 15:15:43 -05:00
C. McEnroe
5b1a5f2876 Do not increment signals
No need to do a read and a write... and it's declared volatile so maybe
that's even worse? I don't even know, but there's no point.
2020-10-27 08:36:25 -04:00
C. McEnroe
363ab9f834 Only look up group if one is named 2020-10-23 11:37:10 -04:00
C. McEnroe
87083ad381 Remove default defines of RUNDIR, ETCDIR 2020-10-23 11:22:17 -04:00
C. McEnroe
8f81318a3f Set shell scripts executable in build 2020-10-23 11:14:02 -04:00
C. McEnroe
d90a43d948 Humanize milliseconds if interval is less than 1s
The intervals are configurable in milliseconds so humanize should be
able to display at that precision.
2020-10-20 20:56:06 -04:00
C. McEnroe
1832301862 Humanize restart interval 2020-10-20 19:56:56 -04:00
C. McEnroe
324f569ce0 Document default catsit.conf location on OpenBSD 2020-08-17 23:59:08 -04:00
C. McEnroe
08783bd1cc Template catsit script with RUNDIR 2020-08-17 23:25:34 -04:00
C. McEnroe
2a7467647e Clean up includes 2020-08-17 22:49:29 -04:00
C. McEnroe
e548219ebf Log service uptime in status 2020-08-17 22:39:54 -04:00
C. McEnroe
533c95c321 Add copy of AGPLv3 2020-08-17 22:20:53 -04:00
C. McEnroe
9612da73e9 Document target platforms
I really want to avoid adding a README...
2020-08-17 18:22:42 -04:00
C. McEnroe
6f74d88067 Remove useless setprogname call 2020-08-17 18:17:41 -04:00
C. McEnroe
325a92645f Add OpenBSD rc script 2020-08-17 17:50:00 -04:00
C. McEnroe
32d048f326 Use BSD make syntax to configure for OpenBSD 2020-08-17 17:22:00 -04:00
C. McEnroe
296e40887b Use pledge(2) and unveil(2) on OpenBSD 2020-08-17 16:38:22 -04:00
C. McEnroe
ebd44fb606 Use a separate fd for the fake fifo writer
From OpenBSD open(2):

> A FIFO should either be opened with O_RDONLY or with O_WRONLY.  The
> behavior for opening a FIFO with O_RDWR is undefined.
2020-08-17 16:21:34 -04:00
C. McEnroe
ea96ef48cb Use a non-blocking lock on the PID file 2020-08-17 16:06:40 -04:00
C. McEnroe
620735523f Truncate PID file after opening and locking 2020-08-17 15:59:45 -04:00
C. McEnroe
00e35a1031 Simplify parseConfig error handling 2020-08-17 15:49:19 -04:00
C. McEnroe
41f9a167e3 Properly handle command line truncation
Unlikely to happen since ARG_MAX is 256K, but...
2020-08-17 12:57:50 -04:00