L-o-n-g delay for rc.local in systemd on Ubuntu.
Xen
list at xenhideout.nl
Wed Aug 9 08:22:06 UTC 2017
Ralf Mardorf schreef op 09-08-2017 9:09:
> On Tue, 08 Aug 2017 18:53:03 +0200, Xen wrote:
>> Ralf Mardorf schreef op 08-08-2017 17:02:
>>> Why don't you let a systemd unit start your extreme lightweight stuff
>>> instead of rc.local?
>>
>> Maybe because he didn't know how to do that.
>>
>> Hint: it is more useful to give people a hint, than to ask why they
>> are not using that hint
>
> So actually even you point out, that I gave a hint, while at the same
> time you reply without providing any useful information at all.
I am not going to have an argument over the back of someone else, but I
just wanted to (and want to) point out that "why not" questions are not
very useful.
Suppose you got your answer.
"Because I didn't know how to."
How would that enlighten you?
Anyway, sorry to interfere, but I just wanted to point that out.
"Hey, all. I've got some stuff in my rc.local, and it takes *forever*
to execute -- three+ minutes. (Note that the machine -- a virtual one
-- is up in something like 20 seconds.) I *need* this stuff, which is
lightweight in the extreme, to execute much earlier in the boot process
than that."
I don't know why something would take forever just because it is in
rc.local.
But as you say, and as I could say:
You can create a systemd "service" file in which "DefaultDependencies"
is "no". Then you can add it to some earlier boot target by using the
"WantedBy" clause in the "[Install]" section. Then you need to enable
the service using "systemctl enable" at which point I believe the
symlink will be made from the appropriate target to your new service.
The question on how to make the new service *stall* the boot sequence is
different. Most of the time you want a service to be type "Oneshot" and
for "RemainAfterExit" to be true, but I don't know.
I don't know why this service has to execute earlier. Or why that would
speed it up.
I never asked ;-).
But I just think assuming knowledge on behalf of the question asker that
to you makes the question incomprehensible, is a bit pointless.
More information about the ubuntu-users
mailing list