Page MenuHomeFreeBSD

kill: fix 'kill -0'
AbandonedPublic

Authored by ivy on Jun 20 2025, 5:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 25, 4:48 PM
Unknown Object (File)
Oct 27 2025, 2:59 PM
Unknown Object (File)
Oct 26 2025, 8:08 PM
Unknown Object (File)
Oct 26 2025, 8:08 PM
Unknown Object (File)
Oct 26 2025, 2:24 PM
Unknown Object (File)
Sep 29 2025, 5:27 PM
Unknown Object (File)
Sep 11 2025, 5:47 AM
Unknown Object (File)
Sep 10 2025, 6:11 AM
Subscribers
None

Details

Summary

The switch to str2sig() added handling for 'kill -s 0', but not
'kill -0', which is required by POSIX (as well as /etc/rc.subr).

This caused rc.d scripts with the 'stop' or 'restart' command to
not correctly wait for the service to stop.

Fixes: 36679f7d7b56 ("kill: Use POSIX str2sig()")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 64994
Build 61877: arc lint + arc unit

Event Timeline

ivy requested review of this revision.Jun 20 2025, 5:04 PM
bin/kill/kill.c
102

Does e.g. "0000" qualify as zero?

bin/kill/kill.c
102

according to POSIX (https://pubs.opengroup.org/onlinepubs/9799919799/utilities/kill.html), -s should only accept the literal string "0", but it could be read to suggest that "kill -0000" should be accepted. i'm not sure this is worth complicating the code to fix that, given that no one would ever do it.

This revision is now accepted and ready to land.Jun 20 2025, 5:26 PM