• problem with rc.local

    From zeneca@3:770/3 to All on Mon Sep 19 11:17:16 2022
    rc.local seems not be called anymore at boot.
    Annoying
    permissions on rc.locale are read and execute for all.
    rc.local can be executed from comd line by root.

    running service ..
    service rc.local start
    Warning: The unit file, source configuration file or drop-ins of rc.local.service changed on disk. Run 'systemctl daemon-reload' to
    reload units.
    root@raspizw:~# systemctl daemon-reload
    root@raspizw:~#
    root@raspizw:~# service rc.local start
    root@raspizw:~#

    But not started!!

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Computer Nerd Kev@3:770/3 to zeneca on Mon Sep 19 19:50:14 2022
    zeneca <pasIci@ailleur.fr> wrote:
    rc.local seems not be called anymore at boot.
    Annoying
    permissions on rc.locale are read and execute for all.
    rc.local can be executed from comd line by root.

    For Raspbian (before it became RPi OS), this is the sequence
    that I worked out to do it, as my introduction to Systemd.
    Implemented as a Bash script. It convinced me that Systemd
    is overcomplicated and encouraged me to avoid it since.

    #!/bin/bash
    #Enable execution of rc.local on start-up with Systemd:

    chmod a+x /etc/rc.local

    echo "Updating /etc/systemd/system/rc-local.service"
    cat > /etc/systemd/system/rc-local.service <<EOF
    [Unit]

    Description=Runs /etc/rc.local
    After=multi-user.target

    [Service]

    Type=simple
    ExecStart=/etc/rc.local

    [Install]

    WantedBy=rc-local.target
    EOF

    echo "Updating /etc/systemd/system/rc-local.target"
    cat > /etc/systemd/system/rc-local.target <<EOF
    [Unit]
    Description=Run service that runs /etc/rc.local
    Requires=multi-user.target
    After=multi-user.target
    AllowIsolate=yes
    EOF

    if [ -d /etc/systemd/system/rc-local.target.wants ] ; then
    echo "WARNING: /etc/systemd/system/rc-local.target.wants already exists" else
    if mkdir /etc/systemd/system/rc-local.target.wants; then
    ln -s /etc/systemd/system/rc-local.service /etc/systemd/system/rc-local.target.wants/rc-local.service
    systemctl daemon-reload
    systemctl set-default rc-local.target
    echo "Reboot now to enable new system configuration"
    exit 0
    else
    echo "Failed to set up rc.local with Systemd"
    exit 1
    fi
    fi

    --
    __ __
    #_ < |\| |< _#

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)