I found the solution while writing this message. Still, I don't know why
it works. Here goes the steps I followed (so that anyone searching for a
solution in those terms can find it):
> Try running 'strace' on ' rc-service auditd start'. See if that helps pin
> down the problem.
I did that, but couldn't detect anything wrong in the trace log (though
I must say, it's the 1st time I used strace...), comparing to dbus, they
do mostly the same system calls, obviously the messages written and
memory addresses are different, both warn about the PID file not
existing yet, and both work. But auditd is not started at boot despite
having been set to start at the default runlevel, and rc-status does not
detect it.
I think the warning messages don't really matter (for this question, the
fact is that OpenRC should be more patient), they're the same and appear
for many working services.
Now, rc-status is a link to openrc. Consulting the documentation and
thinking of links, wondering what was being done differently for these
services, I noticed I hadn't patched /etc/init.d/auditd with the usual
shebang line '#!/usr/bin/openrc-run' instead of the /sbin one. I didn't
patch long ago because I didn't see the purpose of changing it when
/sbin is a link to /usr/bin in Arch Linux.
Solution:
$ rc-status -s |grep audit >/dev/null ; echo $? # not working
1
# sed -e 's|\#\!/sbin/openrc-run|/usr/bin/openrc-run|' \
-i /etc/init.d/auditd
$ rc-status -s |grep audit >/dev/null ; echo $? # ok now!
0
Still, with this patch, the link works for /sbin/auditd (I didn't
replace it on purpose). Why doesn't the link work in the shebang line?
And why does it only not work for rc-status and at boot, but starting
the service manually works normally?
Thanks for the advice, it guided me to the solution eventually, but I'm
still curious and OpenRC is still buggy. Why?
João Miguel