Support SIGUSR2 to stop and start logging for an existing server. Also

we currently only have two log levels so just use -v and -vv rather than
-v and -vvvv, and clarify the man page entry for -v.
This commit is contained in:
nicm
2017-06-04 08:25:57 +00:00
parent 184039044a
commit adf5628087
6 changed files with 51 additions and 6 deletions

View File

@ -151,7 +151,7 @@ server_start(struct event_base *base, int lockfd, char *lockfile)
}
close(pair[0]);
if (log_get_level() > 3)
if (log_get_level() > 1)
tty_create_log();
if (pledge("stdio rpath wpath cpath fattr unix getpw recvfd proc exec "
"tty ps", NULL) != 0)
@ -365,6 +365,9 @@ server_signal(int sig)
}
server_add_accept(0);
break;
case SIGUSR2:
proc_toggle_log(server_proc);
break;
}
}