:: Re: [DNG] rc.local removed from Deb…
Page principale
Supprimer ce message
Répondre à ce message
Auteur: John Hughes
Date:  
À: dng
Sujet: Re: [DNG] rc.local removed from Debian 9, rly?
On 21/11/17 17:53, Jaromil wrote:
> On Tue, 21 Nov 2017, John Hughes wrote:
>
>>     I followed your link to "gitian-building-setup-gitian-debian.md"

>>
>>     Which says that you need to create the rc.local and reboot.  I see no
>>     mention of systemctl.  Am I looking in the wrong place?
> nono, as I wrote: that script doesn't works anymore, if ran on a
> freshly debootstrapped version of Debian 9. It seemed that rc.local
> wasn't executed anymore. But there is some confusion, since both brctl
> and ifconfig are legitimately deprecated. Assuming you have done
> better checking, then the failure may be caused by them bailing out.


Ok, I'll try a test:

    root@cufic:~# aptitude purge initscripts
    The following packages will be REMOVED:
       initscripts{p}
    0 packages upgraded, 0 newly installed, 1 to remove and 7 not upgraded.
    Need to get 0 B of archives. After unpacking 213 kB will be freed.
    Do you want to continue? [Y/n/?]
    (Reading database ... 188141 files and directories currently installed.)
    Removing initscripts (2.88dsf-59.9) ...
    Processing triggers for systemd (232-25+deb9u1) ...
    Processing triggers for man-db (2.7.6.1-2) ...
    (Reading database ... 188123 files and directories currently installed.)
    Purging configuration files for initscripts (2.88dsf-59.9) ...
    dpkg: warning: while removing initscripts, directory '/var/lib/urandom' not empty so not removed
    Processing triggers for systemd (232-25+deb9u1) ...


    root@cufic:~# ls -l /etc/rc.local
    -rwxr-xr-x 1 root root 306 Jan 31  2017 /etc/rc.local
    root@cufic:~# rm /etc/rc.local
    root@cufic:~# systemctl reboot


    ...


    ... it boots up ...


    john@cufic:~$ systemctl status rc-local.service
    ● rc-local.service - /etc/rc.local Compatibility
        Loaded: loaded (/lib/systemd/system/rc-local.service; static; vendor preset:
       Drop-In: /lib/systemd/system/rc-local.service.d
                └─debian.conf
        Active: inactive (dead)


Seems it wasn't run 'cos rc.local doesn't exist.

Make a rc.local:

    root@cufic:~# cat > /etc/rc.local
    #! /bin/sh


    # Test rc.local


    echo Hello from rc.local


    exit 0
    ^D
    root@cufic:~# chmod a=rx /etc/rc.local
    root@cufic:~# ls -l /etc/rc.local
    -r-xr-xr-x 1 root root 62 Nov 21 18:08 /etc/rc.local
    root@cufic:~# systemctl reboot


    ...


    ... it boots up.


    root@cufic:~# systemctl status rc-local.service
    ● rc-local.service - /etc/rc.local Compatibility
        Loaded: loaded (/lib/systemd/system/rc-local.service; static; vendor preset:
       Drop-In: /lib/systemd/system/rc-local.service.d
                └─debian.conf
        Active: active (exited) since Tue 2017-11-21 18:10:23 CET; 1min 9s ago
       Process: 595 ExecStart=/etc/rc.local start (code=exited, status=0/SUCCESS)
         Tasks: 0 (limit: 4915)
        CGroup: /system.slice/rc-local.service


    Nov 21 18:10:23 cufic systemd[1]: Starting /etc/rc.local Compatibility...
    Nov 21 18:10:23 cufic rc.local[595]: Hello from rc.local
    Nov 21 18:10:23 cufic systemd[1]: Started /etc/rc.local Compatibility.



So, it looks to me if /etc/rc.local exists and is executable then
systemd runs it as I thought.

If it didn't work for the bitcoin guys then the problem is somewhere else.

(Damn but the systemd journal is great :-))

Come to think about it, if the problem was that their rc.local was
failing somewhere then they should be able to see that in the output of
systemctl or journalctl.

Assuming they're using systemd, of course.  :-)