mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-06 23:43:20 +02:00
statd: support for enabling DEBUG() logs with env, like confd
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
committed by
Tobias Waldekranz
parent
16c21f0da8
commit
9d7817356f
@@ -1 +1,3 @@
|
||||
#set DEBUG=1
|
||||
|
||||
service name:statd log [S12345] <pid/confd> statd -f -p /run/statd.pid -n -- Status daemon
|
||||
|
||||
+3
-1
@@ -526,9 +526,11 @@ int main(int argc, char *argv[])
|
||||
struct statd statd = {};
|
||||
int log_opts = LOG_USER;
|
||||
sr_conn_ctx_t *sr_conn;
|
||||
char *env;
|
||||
int err;
|
||||
|
||||
if (argc > 1 && !strcmp(argv[1], "-d")) {
|
||||
env = getenv("DEBUG");
|
||||
if (env || (argc > 1 && !strcmp(argv[1], "-d"))) {
|
||||
log_opts |= LOG_PERROR;
|
||||
debug = 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user