troglobit / finit

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

Tasks not using the correct /etc/finit/cond/task/ dir #252

Closed hongkongkiwi closed 2 years ago

hongkongkiwi commented 2 years ago

I'm liberally using the name and id format you've defined to group similar tasks/services into categories (e.g. wifi, lte, ssh).

For example I have a task task [12345789] name:ssh :keygen which generates ssh host keys and a service service [12345789] <task/ssh:keygen/success> name:ssh :daemon which relies on the task being complete.

But I found there's a bug in that it appears that task success/failure doesn't use the correct naming. In my case, the cond was never getting set. I investigated the finit cond directory and found this file: /run/finit/cond/task/ssh/success so obviously finit is only taking the name of the service for tasks, unlike for services where it's /run/finit/cond/service/ssh:daemon/running

troglobit commented 2 years ago

You're right, that's a bug! There's a specific function svc_ident() that's supposed to be used for composits like conditions etc. I see now that svc->name has been used (which is the default if neither name: or :ID have been given).

Thanks!