简体   繁体   中英

Find out how or where a program (script) is automatically starting at ubuntu 14 boot?

Running Ubuntu 14.04, and I have a script that is being run automatically when I boot the machine. For the life of me, I can't remember how or where I did this.

I already checked:

  • upstart (which doesn't seem to be available here, anyway)
  • /etc/rc.local
  • crontab (with @reboot)
  • /etc/init
  • /etc/init.d
  • .config/autostart (doesn't exist btw)

It's a script of my own, so it's not some kind of malicious virus or malware or anything. I just can't remember how I did this, and would like to know.

It has a distinct name, eg like ~/MyScriptXYZ.sh so I could search for that, IF I know how or where..?? (I'm a novice linux user)

So I stumbled across this question and I managed to solve it for myself: I was using Ubuntu (chroot) through the Linux Deploy Android app and I also couldn't find it. So to make the answer complete: Use pstree to locate and trace what is currently running and see where it's originating from.

Following Basile Starynkevitch 's advice I managed to solve it by going to: /home/[user]/.config/lxsession/LXDE/autostart and find it the code I added a while ago.

A few other places you can look:

crontab -e as your own user and as root (local user crontab)

/etc/profile.d/ or /etc/profile

~/.profile

~/.bashrc

The last ditch attempt you can do is to cd / && grep -R "MyScriptXYZ" as root - this will take a while but will search all files on your computer for that reference :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM