]> git.tuebingen.mpg.de Git - paraslash.git/commit - m4/lls/server_cmd.suite.m4
New server command: ll to change the log level at runtime.
authorAndre Noll <maan@tuebingen.mpg.de>
Tue, 19 Oct 2021 19:41:45 +0000 (21:41 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Tue, 12 Jul 2022 11:52:24 +0000 (13:52 +0200)
commit15fde2fd9f9e668b267ab4cfd9fc10db37804dcf
treee521101aef1e2969b6ede0498cbd25ca8d44fe2c
parent27879fbdef3653aa7ba66eda97dc7cd731f2ce26
New server command: ll to change the log level at runtime.

This makes use of the infrastructure introduced in the previous patch.
However, the implementation of the ll command for para_server is more
involved than its audiod counterpart because in the server case we
have to tell two different processes (server and afs) to change their
log level while the calling process, the command handler, does not
need to set the loglevel because it is about to exit anyway.

For the inter-process communication we introduce a new field in the
mmd shared memory area so that command handlers can read the current
value or set a new value. The log level propagates from there via
daemon_set_loglevel() to the server and afs processes during each
iteration of the scheduler loop where para_log() will pick it up to
set the log level threshold for subsequent log events.

The si command handler currently refers to the argument of the
--loglevel server option to include the log level in its output. With
dynamic log levels this no longer works because it always prints the
value from the command line or the config file rather than the run
time log level. Since the new ll command also prints the loglevel
when it is executed with no arguments, we simply remove this line
from the si output and hope that nobody cares.

The si command handler was the last user of the ENUM_STRING_VAL macro
in command.c. Removing the macro also allows us to make CMD_PTR local
to server.c and to remove the lopsub definitions of the server suite
from command.c. However, we still include the lopsub definitions of
the server *command* suite (server_cmd.lsg.h) of course.

We let any authenticated user run the command with no arguments to
report the current loglevel but require full privileges to change
the loglevel. Thus, the check for sufficient privileges needs to be
performed in the command handler.
afs.c
client.c
command.c
interactive.c
m4/lls/include/com_ll.m4
m4/lls/makefile
m4/lls/server_cmd.suite.m4
server.c
server.h