*.rpm Fedora CentOS Redhat

at least in CentOS8, this file exists and is enabled per default (thanks!)

*.deb Debian Ubuntu Mint: disabled rc.local per default

why? oh why? here is how to re-enable it:

since debian 9.5 stretch the user will have to create it manually:

vim /etc/rc.local 
#!/bin/sh -e
# rc.local
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
# In order to enable or disable this script just change the execution
# bits.
# By default this script does nothing.

# log time of startup/when rc.local was run
echo "rc.local was run at startup on $(date '+%Y-%m-%d-%H:%M:%S')" >> /var/log/startup.log;

exit 0

then go:

chmod +x /etc/rc.local;
systemctl daemon-reload;
systemctl start rc-local;
systemctl status rc-local;

status should look something like:


auto start graphical programs

is possible: username is the default-non-root desktop user, sleep 8 waits until desktop is ready, then a little “hack” is required to allow root to use the desktop (the programs are run as username)

sleep 8;

export DISPLAY=':0.0'
cp -v /home/username/.Xauthority /root/.Xauthority

su username -c "/this/script.sh" &
su username -c "/scripts/music.sh" &

the systemctrl service unit way: (more effort)


I saw this solution suggested which involves use of



  1. Create a service:
    sudo vi /etc/systemd/system/rc-local.service
  2. Add your code there:
    Description=/etc/rc.local Compatibility
    ExecStart=/etc/rc.local start


if you wanna autostart services that start before the desktop (non-grafical like mounting stuff) you can put them here:

Autostart files in an LXDE desktop and/or Openbox can be located in at least 5 places, depending upon the distro. These are


The first three are text files that are edited by adding text according to some format, and the last two are directories containing .desktop files for the processes that are to be started. If the lxde-core desktop is installed, then the lxde-autostart usually takes precedence in the command order. In an openbox-only distribution with no session-manager, generally ~/.config/autostart.sh rules. The two autostart files in the user’s home directory (~/) only apply to that user; the 3 in the etc directory apply to all users.

vim /etc/rc.local; # global-system-wide on every debian BEFORE DESKTOP
vim /etc/xdg/lxsession/LXDE/autostart; # for programs that start AFTER DESKTOP (LXDE) has started "autostart"
sudo vim ~/.config/lxsession/LXDE/autostart

@lxpanel --profile LXDE
@pcmanfm --desktop --profile LXDE
@xscreensaver -no-splash
@lxterminal -e /scripts/SetScreen.sh

i don’t know which one worked… but it worked after:

echo "@lxterminal -e /scripts/welcome.sh" >> /etc/xdg/lxsession/LXDE/autostart;
echo "@lxterminal -e /scripts/welcome.sh" >> /etc/xdg/openbox/autostart;
echo "@lxterminal -e /scripts/welcome.sh" >> ~/.config/openbox/autostart.sh;
echo "@lxterminal -e /scripts/welcome.sh" >> ~/.config/autostart;
echo "@lxterminal -e /scripts/welcome.sh" >> /etc/xdg/autostart;

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!