Centos – Other than crontab, what other ways can one add programs to run at boot time

centoscronstartupxfcexfce4-terminal

I am running CentOS 7 with XFCE as my DE. I made a bash script, originally stored in ~/bin (I have since deleted it), which I wanted to have run automatically at startup. I somehow succeeded, but I have tried to remove it from my autostart programs, to no avail.

  • when I run ctrontab -e, I am given an empty file to edit. It is therefore not started through there.

  • when I open Session and Startup -> Application autostart, the only programs are: spice vdagent, tracker application miner, tracker metadata extractor, tracker user guides miner, XFCE polkit, Xfsettingsd, redshift, power manager, network.

  • when I find its PID and look through /proc/PID/, the exe is a link to /usr/bin/xfce4-terminal (note: the script started an xfce4-terminal and ran commands on it, then stayed open after printing its output). I don't know where else I could find useful information about what ran this program. cwd is a link to ~, root is a link to /, the rest are empty files pretty much.

  • the script is no longer in ~/bin, yet is somehow still being run

  • I also, at one point, installed devilspie2 to manage that terminal window, and messed around with it. I have since uninstalled it. I wouldn't expect it to have anything to do with it, but I figured I'd specify this.

where else could it be started from? How would I know?

Best Answer

If you are running systemd you can create a service that will start yourt software and then use systemctl enable [your-service] to start it on boot up. If your using openrc(old init) then you can use a similar method just use rc-update add [service] default

Related Question