/etc/rc.local
There are more elegant ways (eg. as argued here) to connect to the web at startup, but let's use web connection as an easy rc.local example app, then pick your own application(s) to put into rc.local.# nano /etc/rc.local... or some like to just "+x" it.
#!/bin/bash
echo "router connect"
wpa_supplicant -iwlan0 -Dwext -B -c /etc/wpasupplicant/wpa_supplicant.conf
exit 0
# chmod 755 /etc/rc.local
/etc/systemd/system/rc-local.service
Next, create a systemd service file to call rc.local. As well noted here, the file must include a "wanted by" line.
# nano /etc/systemd/system/rc-local.service... and then enable the service in systemd...
[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99
[Install]
WantedBy=multi-user.target
# systemctl enable rc-local.service
The next time the system boots, it subsequently runs the rc.local file and connects to the router.
No comments:
Post a Comment