troglobit / finit

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

can not enable .conf after upgrading to 4.4 #359

Closed w41l closed 12 months ago

w41l commented 12 months ago

After upgrading to finit 4.4 and libite 2.5.3, I can't enable any service.conf file in /etc/finit.d/available using initctl enable:

root@gm15:~# initctl enable saned.conf
initctl: failed enabling saned.conf: No such file or directory

But any other initctl command (disable/edit/create/show/ls/etc) works with no issue:

root@gm15:~# initctl show saned.conf
service [2345] <net/lo/up> pid:/run/saned.pid env:-/etc/default/saned /usr/sbin/saned -l $SANED_OPTS -- SANE daemon

If I add full path like this: initctl enable /etc/finit.d/available/saned.conf

the finit.d path in the error seems correct

root@gm15:~# initctl enable /etc/finit.d/available/saned.conf
initctl: cannot find /etc/finit.d/available//etc/finit.d/available/saned.conf

Any idea?

PS: I'm using slackware, so this finit is my own build

troglobit commented 12 months ago

Hmm, this sounds suspiciously like the regression I though I'd found and fixed before the 4.4 release. I'll see what I can do to reproduce in myLinux and get back to you, this is important!

troglobit commented 12 months ago

Very odd, I cannot reproduce it here. Enabling and disabling works as it should :-( only thing I can reproduce is:

root@anarchy:~# initctl enable /etc/finit.d/available/lldpd.conf
initctl: cannot find /etc/finit.d/available//etc/finit.d/available/lldpd.conf

How did you do the upgrade? Are you building from the tarballs or building from GIT? If it's the latter you have to call ./autogen.sh again and do a proper make distclean before calling ./configure [your-options-here] && make && sudo make install.

w41l commented 12 months ago

I'm using the tarball. I'll try rebuild it using git 4.4 or HEAD. Please wait.

troglobit commented 12 months ago

Interesting. If anything, the tarball should work better ... looking forward to figuring this one out!

w41l commented 12 months ago

After some trying and error I think I resolved this. My installation did not have /etc/finit.d/enabled because in the old version (4.3) initctl created symlink for the /etc/finit.d/available/conf file into /etc/finit.d. After creating /etc/finit.d/enabled and moving all the conf to that dir, I can disable and enable conf again. I believe I did not find this new behavior in the 4.4 ChangeLog.

edit (addition): The finit.conf man page also did not mention this new behavior (or should I say mandatory)

troglobit commented 12 months ago

Sorry, did not even know 4.3 behaved like that! OK, great to hear you found the root cause at least. Documentation could always be improved, I guess. I'll see what I can do about making it clearer in at least finit.conf(5).

Thank you for taking the time to report this. To conclude, I'll have a look at the following two issues that came out of this:

  1. Error calling initctl enable with an absolute path
  2. Clarify/Update finit.conf(5) man page wrt. used directories and behavior
w41l commented 12 months ago

Thanks for the response and I'm closing this issue.