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)