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

service.c: set condition 'done' for oneshot tasks #207

Merged

Conversation

liuming50
Copy link
Contributor

We like to know when a oneshot task is done, so as to start the
services that depending on it, set a oneshot condition 'done' for
that case.

Signed-off-by: Robert Andersson robert.m.andersson@atlascopco.com
Signed-off-by: Ming Liu liu.ming50@gmail.com

@troglobit
Copy link
Owner

Interesting. It would be great if this also included an official way of accessing this information instead of poking around in the internals. Meaning, could you please add a way of inspecting this through initctl status foo as well?

Also, and possibly more importantly. A one-shot task per spec. runs once per runlevel it's allowed to run in, so when changing runelevel the task is run once again. Maybe this file should be removed for all tasks that are restarted?

@liuming50
Copy link
Contributor Author

Interesting. It would be great if this also included an official way of accessing this information instead of poking around in the internals. Meaning, could you please add a way of inspecting this through initctl status foo as well?

Also, and possibly more importantly. A one-shot task per spec. runs once per runlevel it's allowed to run in, so when changing runelevel the task is run once again. Maybe this file should be removed for all tasks that are restarted?

Thanks for the review, will rework a V2.

@troglobit
Copy link
Owner

Any progress on this? I'm gearing up for release 4.2 very soon ... :)

@troglobit
Copy link
Owner

Finit v4.2 was released during the weekend. Maybe we can get this into the next release cycle? 🙏

@liuming50
Copy link
Contributor Author

@troglobit sorry for the delayed feedback, we are currently being blocked by #216, so have not managed time work on this.

@liuming50 liuming50 force-pushed the set-condition-done-for-oneshot-tasks branch 2 times, most recently from 9fe9597 to a669c94 Compare February 5, 2022 13:27
@liuming50
Copy link
Contributor Author

@troglobit

Please kindly help me review this V2.

If I understood you correctly, when SM enters SVC_DONE_STATE, we set done condition, and when it enters SVC_HALTED_STATE, we clear the done condition. So I think the svc_set_state function is still the proper place to put the logic in.

@liuming50 liuming50 force-pushed the set-condition-done-for-oneshot-tasks branch from a669c94 to 2d12067 Compare February 5, 2022 14:22
We like to know when a runtask (run/task/sysv)is done, so as to start
the services that depending on it, set a oneshot condition 'done' for
that case and clear it when runtask services enter HALTED state.

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
@liuming50 liuming50 force-pushed the set-condition-done-for-oneshot-tasks branch from 2d12067 to f0f358a Compare February 5, 2022 17:20
@troglobit
Copy link
Owner

Much better, thank you! :)

@troglobit troglobit merged commit 33b4540 into troglobit:master Feb 7, 2022
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