diff options
author | June McEnroe <june@causal.agency> | 2020-10-20 19:55:11 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2020-10-20 19:56:56 -0400 |
commit | 18323018624001103368257578a5fcbaf9252986 (patch) | |
tree | f36ae896bddcef19543ca9f43dfb7150ea7e4683 | |
parent | Document default catsit.conf location on OpenBSD (diff) | |
download | catsit-18323018624001103368257578a5fcbaf9252986.tar.gz catsit-18323018624001103368257578a5fcbaf9252986.zip |
Humanize restart interval
Diffstat (limited to '')
-rw-r--r-- | service.c | 8 |
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); |