tcpdump mailing list archives

SIGINFO/SIGUSR1 and SIGUSR2


From: Denis Ovsienko <denis () ovsienko info>
Date: Thu, 28 Mar 2024 10:01:15 +0000

Hello all.

There is a rather old pull request at [1], which was supposed to make
use of the then-unused SIGUSR2, but whilst it was waiting, another pull
request used the signal for another code path.

There is a potential way to manage this kind of contention by
naming the available actions and disassociating them from the available
signals.  For example, let's call the existing SIGINFO/SIGUSR1 action
"print_stats", the existing SIGUSR2 action -- "flush_savefile" and the
action proposed in the pull request -- "rotate_savefile".  Perhaps an
easy action would be "ignore" to do nothing instead of the default
something.  Then these command-line options would allow to associate
the signals with the actions:

[--siginfo=<action>] (on platforms with SIGINFO only)
[--sigusr1=<action>]
[--sigusr2=<action>]

In this case the following defaults would provide backward
compatibility:

(on platforms with SIGINFO)
--siginfo=print_stats
--sigusr2=flush_savefile

(on platforms without SIGINFO)
--sigusr1=print_stats
--sigusr2=flush_savefile

Then, if tcpdump prints the defaults and the available actions on
--help, it should be straightforward for the user to change the
response as necessary, including the action from the pull request:

--sigusr2=rotate_savefile

1: https://github.com/the-tcpdump-group/tcpdump/pull/570

-- 
    Denis Ovsienko
_______________________________________________
tcpdump-workers mailing list -- tcpdump-workers () lists tcpdump org
To unsubscribe send an email to tcpdump-workers-leave () lists tcpdump org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s


Current thread: