troglobit / finit

Fast init for Linux. Cookies included
https://troglobit.com/projects/finit/
MIT License
632 stars 63 forks source link

Add static/init conditions into initctl cond get #265

Closed hongkongkiwi closed 2 years ago

hongkongkiwi commented 2 years ago

Is it possible to update initctl cond get to support full condition paths as well as user conditions? I'm currently setting them as per your instructions by #185 but I had to write a wrapper script to get the status, it would be nice to stick with initctl for this. I think this would work without breaking any backwards compatibility and it would be useful for third party scripts (e.g. pre scripts).

e.g. these would all work:

initctl cond get "net/eth0/exist"
initctl cond get "usr/mycondition"
initctl cond get "mycondition"
troglobit commented 2 years ago

Yes, I'll have a look at it. Should be fairly straight forward, but this weekend time is limited and the little I have will be on the 4.3 release.

troglobit commented 2 years ago

Fixed! :)

hongkongkiwi commented 2 years ago

Works well.... do you think initctl set should support this with a flag? or you prefer to keep static conditions as something you need manually create?

troglobit commented 2 years ago

Great to hear! :)

No, set is for user conditions only. The complexity of the flux state prevent dynamic type of conditions from being handled by initctl. That requires a plugin to manage re-asserting conditions after a initctl reload.