Skip to content

Conversation

@simosund
Copy link
Contributor

PPing previously only shut down gracefully on SIGINT, but did not handle SIGTERM which is the most common signal for killing a process non-interactively. Here I address that by simply adding the same signal-handler for the SIGTERM signal.

It may be worth considering if there are additional signals that should also be handled similarly, ex SIGHUP or SIGQUIT.

While not directly related, while I still remeber it @tohojo also suggested detecting if pping was already running on the interface, and then handle that. Is the correct way to do that to check for BPF-programs with the same name already attached to the interface and if found simply abort and inform the user that pping is already running?

Also intercept SIGTERM (in addition the the previously intercepted
SIGINT) and perform graceful shutdown.

Perhaps it also makes sense to perform graceful shutdown on some
additional signals, like SIGHUP and SIGQUIT?

Signed-off-by: Simon Sundberg <simon.sundberg@kau.se>
@tohojo
Copy link
Member

tohojo commented Jan 31, 2022

Yeah, just checking if a program with the same name is already attached should probably be fine for checking for already-running instances. It's unlikely that an unrelated application will install a program with the same name, after all...

@tohojo tohojo merged commit 007c0b6 into xdp-project:master Jan 31, 2022
@simosund simosund deleted the pping_graceful_shutdown branch March 22, 2022 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants