summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-10-20 19:55:11 -0400
committerJune McEnroe <june@causal.agency>2020-10-20 19:56:56 -0400
commit18323018624001103368257578a5fcbaf9252986 (patch)
treef36ae896bddcef19543ca9f43dfb7150ea7e4683
parentDocument default catsit.conf location on OpenBSD (diff)
downloadcatsit-18323018624001103368257578a5fcbaf9252986.tar.gz
catsit-18323018624001103368257578a5fcbaf9252986.zip
Humanize restart interval
-rw-r--r--service.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/service.c b/service.c
index 0607f80..5f817bf 100644
--- a/service.c
+++ b/service.c
@@ -155,8 +155,8 @@ void serviceStatus(struct Service *service) {
 		struct timespec timeleft;
 		timespecsub(&service->restartDeadline, &now, &timeleft);
 		syslog(
-			LOG_NOTICE, "%s[] is restarting in %ds",
-			service->name, (int)timeleft.tv_sec
+			LOG_NOTICE, "%s[] is restarting in %s",
+			service->name, humanize(timeleft)
 		);
 	} else if (service->state == Stop && service->intent == Restart) {
 		syslog(LOG_NOTICE, "%s[] is restarting", service->name);
@@ -349,8 +349,8 @@ void serviceReap(pid_t pid, int status) {
 		}
 		setDeadline(service);
 		syslog(
-			LOG_NOTICE, "%s[%d] restarting in %ds",
-			service->name, pid, (int)service->restartInterval.tv_sec
+			LOG_NOTICE, "%s[%d] restarting in %s",
+			service->name, pid, humanize(service->restartInterval)
 		);
 	} else {
 		syslog(LOG_NOTICE, "%s[%d] stopped", service->name, pid);
in mdocJune McEnroe 2019-02-18Match statics and typedefs as TagJune McEnroe 2019-02-18Clean up htmlHeaderJune McEnroe 2019-02-18Remove hi line numberingJune McEnroe 2019-02-18Add Tag class to hiJune McEnroe 2019-02-17Generate HTML with hi -n -f html -o anchorJune McEnroe 2019-02-17Add hi -f html -o anchor for line number linksJune McEnroe 2019-02-17Simplify temp trap in upJune McEnroe 2019-02-17Add line numbers to hiJune McEnroe 2019-02-17Always split spans after newlinesJune McEnroe 2019-02-15Color format specifiers light cyan in vimJune McEnroe 2019-02-15Highlight Interp as yellowJune McEnroe 2019-02-15Highlight strings in sh command substitutionsJune McEnroe 2019-02-15Add nmap gpJune McEnroe 2019-02-14Avoid newline when copying URL to pasteboardJune McEnroe 2019-02-13Add forgotten "sixth" book of H2G2June McEnroee='2019-01-11 12:41:54 -0500'>2019-01-11Don't make depend automaticallyJune McEnroe