Bug#1027166: rc.local should NOT depend on network-online or anything else

Michael Tokarev mjt at tls.msk.ru
Wed Dec 28 18:55:23 GMT 2022


Package: systemd
Version: 252.2-2~bpo11+1
Severity: serious

I just come across a situation where my notebook does not let me in while
I'm in a place where network is not available. This is entirely wrong.
After a painful debugging session, I found the debian-shipped file
/lib/systemd/system/rc-local.service.d/debian.conf , which adds dependency
of rc.local for network-online.

Found the commit which introduced this:

commit 4a26840495a297e50283a1f8def090540d15042d
Author: Martin Pitt <martinpitt at gnome.org>
Date:   Mon Jun 1 15:56:45 2015 +0200

    Make rc-local.service wait for network-online.target (if it gets started)
    
    Add debian/extra/units/rc-local.service.d/wait-online.conf.
    This not specified by LSB, but has been behaving that way in Debian under SysV
    init and upstart.
    
    LP: #1451797

and found the original bugreport from 2015,
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1451797
(and a new one filed in 2021,
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1950906 ).

On all systems, rc.local is empty by default (or doesn't exist), so it does
not depend on anything at all.  Only the user who modifies this file *locally*
knows which dependencies are required, and this user can add their own
/etc/systemd/system/rc-local.d/whatever.conf with the right deps, if needed.

Adding *any* dependencies by default is entirely, utterly wrong. This way,
you force completely innocent, unsuspecting people who used to put some
quick thing into their rc.local to suffer from being unable to login.

It definitely should not be done for all.

Yes, I know rc.local is a workaround. But please don't make this workaround
completely wrong.

*Sigh*.

Thanks,

/mjt



More information about the Pkg-systemd-maintainers mailing list