I need to run a bash script at boot-time as superuser in Xubuntu. I don't know where to start. I have to do something described in a Arch Linux guide. That guide says exactly:
Add following at the end of the file : /etc/rc.sysinit
# Do my action
/etc/rc.d/do_my_action
/bin/dmesg >| /var/log/dmesg.log
But I do not have /etc/rc.sysinit
and /etc/rc.d/
in Xubuntu. I'm sure there are equivalent ones, right?
exit 0
. And if I can ask, on boot whenrc.local
is executed, is the filesystem ready so I can also write a log somewhere for that command I want to run? – lorenzo-s Dec 18 '11 at 02:27/etc/rc.local
cannot found commandmy_script
, that is in/usr/local/bin
and works on my user session. – lorenzo-s Dec 18 '11 at 12:32my_script
from/usr/local/bin
to/usr/bin
. I'm also able to save log in/var/log
usingmy_script &>> /var/log/my_script
. Thank you very much. – lorenzo-s Dec 18 '11 at 12:45/etc/rc.local
remember to add#!/bin/bash
at the beginning. In my case it is not running without it. – Tommimon Jan 06 '23 at 21:37