Yes, you´re right. I was just reading up on the topic in the ubuntuusers-wiki and found out the same.
Right. I guess so, too. I might also give it a try on my main system. But as Linux Lite doesn´t have it by default I would have to create the rc.local file first.
Your fooslinux link provides some really good information for that, I think.
Thanks a lot, Neville
Cheers from Rosika ![]()
UPDATE:
according to rc.local › Archiv › Wiki › ubuntuusers.de :
The rc.local file has been obsolete since 1983.
It served as a workaround for maintaining even older methods for system initialization the then new, now obsolete SysV-init system.Services and scripts are started since version Ubuntu 15.04 via service units.
From Ubuntu 18.04 LTS onwards /etc/rc.local no longer exists by default.
It is also not recommended to set up such one manually.An alternative option can be an entry
@rebootunder the file setting in /etc/crontab.
(translation via “TranslateLocally for Firefox” add-on)
(bold by me)
I guess the last sentence could provide a potential solution…
.
Many greetings from Rosika ![]()
UPDATE 2:
I guess this would be the easiest way:
crontab -e, and then:
@reboot /path/to/script.sh
The @reboot keyword in the cron job entry specifies that the script should be executed when the system starts up.
After adding the entry to your crontab, the script will run each time your user account logs in. It won’t affect other user accounts on the system.
Also:
Make sure that the script you want to run has the execute permission (chmod +x /path/to/script.sh)
and that the script itself does not have any dependencies on the graphical environment or user session, as cron jobs typically run in a non-graphical environment. ![]()
It´s also possible to introduce a time delay (if you so wish) after system startup
before executing the script using cron. Instead of using the @reboot keyword alone, you can combine it with the sleep command to introduce a delay.
This should cover it:
@reboot sleep 300 && /path/to/script.sh
In this example, sleep 300 introduces a delay of 300 seconds (equivalent to 5 minutes) before executing the script.
That´s just an example, of course. You can add any user-defined delay you want.
Many greetings from Rosika ![]()