Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mark_service sends SIGHUP but openrc-run still marks based on exit status #741

Closed
markhindley opened this issue Sep 13, 2024 · 2 comments
Closed
Assignees

Comments

@markhindley
Copy link
Contributor

Hi,

I have been trying to mark the status of a service from within start(). Minimal example:

start() {
true
mark_service_stopped
}

However the status remains started.

Looking at src/mark_service/mark_service.c, it appears the intention is to send SIGHUP and that prevent setting the status based on the start() exit status.

Looking at src/openrc-run/openrc-run.c, the only place I can see the flag set by the SIGHUP handler is L1295 and that just aborts the option handling loop.

Or are the comments in mark_service.c obsolete and there is a different way to achieve this?

Thanks

Mark

@markhindley
Copy link
Contributor Author

Hi,

I have looked at this some more. The openrc-run.8 manpage implies that mark_service_* should work within the initscript.

I have a patch that fixes the behaviour. Since SIGHUP is already handled and utilised, I have opted for SIGUSR1 for the mark_service_* handling.

Thanks

Mark

When-manually-marking-service-status-use-SIGUSR1-to-skip-default.txt

@markhindley
Copy link
Contributor Author

Companion PR #746 created, as requested.

@navi-desu navi-desu self-assigned this Sep 22, 2024
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

No branches or pull requests

2 participants