Conversation
Users starting Finit based systems using U-Boot or Barebox may otherwise not get a visible cursor at their prompt. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
When reloading a specific service with 'initctl reload foo', the pid/foo and service/foo/ready conditions were never cleared, so dependent services were not notified of the reload. Clear the service's pid condition and, for pid/none notify types, the ready condition before reloading. The conditions are then reasserted by the pidfile inotify handler when the service touches its PID file after processing SIGHUP. For s6/systemd services the ready condition is left intact since their readiness notification may not re-trigger on SIGHUP. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Verify that 'initctl reload foo' properly triggers dependent services by checking that bar gets a new PID after the reload. Also change the second test case from service/foo/running to service/foo/ready which is the actual condition set by pidfile.so. Fix a race in slay where the target process could exit between the PID lookup and kill -9, causing spurious test failures in tight kill loops (e.g., start-kill-service.sh). Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes the initctl reload NAME command to properly de-assert and reassert service conditions, ensuring dependent services are reloaded or restarted as expected. The core fix adds logic to the reload function in src/api.c that clears service conditions before sending SIGHUP, allowing dependent services to observe the condition change and react accordingly.
Changes:
- Added condition clearing logic to the reload handler in the init control API
- Added comprehensive test coverage for per-service reload with dependent services
- Updated documentation to clarify condition reassertion behavior on reload
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/api.c | Core fix: clears service conditions before reload, with special handling for different notification types (PID, systemd, s6) |
| test/src/serv.c | Updated test service to recreate test resources on reload before touching PID file |
| test/depserv.sh | Added test case for verifying dependent services restart when a service is reloaded; tests both pid and ready conditions |
| test/skel/bin/slay | Added error suppression to kill command for test robustness |
| src/sm.c | Removed cursor hiding code during shutdown (unrelated change) |
| doc/conditions.md | Documented that per-service reload clears and reasserts conditions |
| doc/ChangeLog.md | Added changelog entry for the fix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ensure
initctl reload fooactually de-asserts its conditions so dependent services are properly reloaded/restarted.