:: Re: [DNG] rc.local removed from Deb…
Top Page
Delete this message
Reply to this message
Author: John Hughes
Date:  
To: dng
Subject: Re: [DNG] rc.local removed from Debian 9, rly?
On 20/11/17 11:30, Jaromil wrote:
> 1- it [ rc.local ] is not created by default


It exists on my stretch systems.  As  Olaf Meeuwissen said it is created
by initscripts.postinst:

    #
    # Create /etc/rc.local on first time install and when upgrading from
    # versions before "2.86.ds1-16"
    #
    if dpkg --compare-versions "$PREV_VER" lt "2.86.ds1-16"
    then
             if [ ! -e /etc/rc.local ]; then
                     cat << EOF > /etc/rc.local
    # rc.local
    #
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will "exit 0" on success or any other
    # value on error.
    #
    # In order to enable or disable this script just change the execution
    # bits.
    #
    # By default this script does nothing.


    exit 0
    EOF
                     # make sure it's enabled by default.
                     chmod 755 /etc/rc.local
             fi
    fi



> 2- it is not executed in Debian Stretch (9) even if existing


I, as you might have guessed, use systemd, so rc.local is started by
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 Mon 2017-10-30 11:03:59 CET; 3
    weeks 1 days ago
       Process: 655 ExecStart=/etc/rc.local start (code=exited,
    status=0/SUCCESS)
         Tasks: 0 (limit: 4915)
        CGroup: /system.slice/rc-local.service



The service rc-local.service is:

    # This unit gets pulled automatically into multi-user.target by
    # systemd-rc-local-generator if /etc/rc.local is executable.
    [Unit]
    Description=/etc/rc.local Compatibility
    ConditionFileIsExecutable=/etc/rc.local
    After=network.target


    [Service]
    Type=forking
    ExecStart=/etc/rc.local start
    TimeoutSec=0
    RemainAfterExit=yes
    GuessMainPID=no
    # This unit gets pulled automatically into multi-user.target by
    # systemd-rc-local-generator if /etc/rc.local is executable.
    [Unit]
    Description=/etc/rc.local Compatibility
    ConditionFileIsExecutable=/etc/rc.local
    After=network.target


    [Service]
    Type=forking
    ExecStart=/etc/rc.local start
    TimeoutSec=0
    RemainAfterExit=yes
    GuessMainPID=no



The source of the generator, systemd-rc-local-generator, is at
https://github.com/systemd/systemd/blob/master/src/rc-local-generator/rc-local-generator.c

> please correct me if I'm wrong. That would help.


I think you're wrong.