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.localis 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.localcannot found commandmy_script, that is in/usr/local/binand works on my user session. – lorenzo-s Dec 18 '11 at 12:32my_scriptfrom/usr/local/binto/usr/bin. I'm also able to save log in/var/logusingmy_script &>> /var/log/my_script. Thank you very much. – lorenzo-s Dec 18 '11 at 12:45/etc/rc.localremember to add#!/bin/bashat the beginning. In my case it is not running without it. – Tommimon Jan 06 '23 at 21:37