Need help with a senior moment.

Using a headless Pi Zero and Jessie. I have a Python script that is starting on boot or logon, but for the life of me I can't remember where I set it up.

It's not in /etc/rc.local, it's not in /etc/profile, and it isn't in crontab or /home/pi/.bashrc. Not in init.d and definitely not through systemd.

Where else could I look?

  • Do you remember what you named it? – ElefantPhace Apr 5 '17 at 0:55

Another possibility is that it's being started by cron or anacron. That could be starting it very shortly after boot.

The first step is to figure out if it's starting at or near boot or when you log in. The easiest way to check that is probably to create a second user account, disable automatic login, reboot your system, and log in to the second account to see if the script is running.

If it is running on login, check not only your .bashrc but also your .profile and your .bash_profile, and /etc/bash.bashrc and similar files. If those don't start it, it could be started by something related to your X session; the simple way to check this is to do a non-graphical login, either by starting your Pi in console mode or by ssh'ing in from your second account (after a reboot and having confirmed that it's not running before you log in to your pi account).

If it is being started on boot I might start by creating a systemd unit that checks whether or not the script is running and records that, and then move that unit around in the dependency graph to narrow down where it's starting.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.