Bug 282694 - utility `daemon(8)` never exits (process SIGTERM) if child process restarts indefinitely
Summary: utility `daemon(8)` never exits (process SIGTERM) if child process restarts i...
Status: Closed DUPLICATE of bug 277959
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 14.1-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-11 16:28 UTC by freebsd
Modified: 2024-11-12 15:32 UTC (History)
1 user (show)

See Also:


Attachments
basic minimal rc.d script for illustration purposes (351 bytes, application/x-sh)
2024-11-11 16:28 UTC, freebsd
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description freebsd 2024-11-11 16:28:09 UTC
Created attachment 255099 [details]
basic minimal rc.d script for illustration purposes

Hi there,
attachment `testd.sh` minimal rc.d script that starts `daemon` for `env` which always exits (just to illustrate), `-r` restarts `env` but `daemon` doesn't reacts to SIGTERM in that mode which is the signal sent on `service testd stop`, so it's hanging on waiting for PID indefinite:
```
~# service testd onestop
Stopping testd.
Waiting for PIDS: 19035^C
```

think there is a race condition for when `daemon` receives SIGTERM but in a state when there is no child yet
Comment 1 Rudolph 2024-11-12 14:22:03 UTC
This could be related to bug #277959
Comment 2 freebsd 2024-11-12 15:32:29 UTC
(In reply to Rudolph from comment #1)
That's it, thanks for the link!
Comment 3 freebsd 2024-11-12 15:32:50 UTC

*** This bug has been marked as a duplicate of bug 277959 ***