Gentoo Archives: gentoo-user

From: "João Miguel" <jmcf125@×××××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Service not started at specified runlevel
Date: Mon, 07 Dec 2015 21:26:25
Message-Id: 20151207212603.GA1714@jmcf125-Acer-Arch.home
In Reply to: Re: [gentoo-user] Service not started at specified runlevel by Alexander Kapshuk
1 I found the solution while writing this message. Still, I don't know why
2 it works. Here goes the steps I followed (so that anyone searching for a
3 solution in those terms can find it):
4
5 > Try running 'strace' on ' rc-service auditd start'. See if that helps pin
6 > down the problem.
7 I did that, but couldn't detect anything wrong in the trace log (though
8 I must say, it's the 1st time I used strace...), comparing to dbus, they
9 do mostly the same system calls, obviously the messages written and
10 memory addresses are different, both warn about the PID file not
11 existing yet, and both work. But auditd is not started at boot despite
12 having been set to start at the default runlevel, and rc-status does not
13 detect it.
14
15 I think the warning messages don't really matter (for this question, the
16 fact is that OpenRC should be more patient), they're the same and appear
17 for many working services.
18
19 Now, rc-status is a link to openrc. Consulting the documentation and
20 thinking of links, wondering what was being done differently for these
21 services, I noticed I hadn't patched /etc/init.d/auditd with the usual
22 shebang line '#!/usr/bin/openrc-run' instead of the /sbin one. I didn't
23 patch long ago because I didn't see the purpose of changing it when
24 /sbin is a link to /usr/bin in Arch Linux.
25
26 Solution:
27 $ rc-status -s |grep audit >/dev/null ; echo $? # not working
28 1
29 # sed -e 's|\#\!/sbin/openrc-run|/usr/bin/openrc-run|' \
30 -i /etc/init.d/auditd
31 $ rc-status -s |grep audit >/dev/null ; echo $? # ok now!
32 0
33
34 Still, with this patch, the link works for /sbin/auditd (I didn't
35 replace it on purpose). Why doesn't the link work in the shebang line?
36 And why does it only not work for rc-status and at boot, but starting
37 the service manually works normally?
38
39 Thanks for the advice, it guided me to the solution eventually, but I'm
40 still curious and OpenRC is still buggy. Why?
41
42 João Miguel

Replies

Subject Author
Re: [gentoo-user] Service not started at specified runlevel Stroller <stroller@××××××××××××××××××.uk>