[Solved] How to stop autoboot python script?

hi there, I used the dietpi-config option to run at start-up a python script that shows in screen data perpetually

the problem is I cant even stop it with Ctlr+C or any others, I may need to modify files to work normaly

how can I do it (not very painful solution like editing the sd card files with external linux, I hope)

Thanks in advance :cry: :open_mouth:

can anyone help? I can send some paypal donation for the support received :cry:

I guess the only solution is inserting the dietpi microsd in another linux pc and then access the file

/var/lib/dietpi/dietpi-autostart/custom.sh

and remove the line with the python script? and how to do it properly next time?

Did you open the issue as well on GitHub: https://github.com/Fourdee/DietPi/issues/2300 ? Please check my answer there.
Copy&Paste from there:

Okay, just read the issue on the forum (I guess this is yours as well?): > [Solved] How to stop autoboot python script?

I understood now that it is not only a question but urgent help request > :wink:> .
If you added the script to autostart via dietpi-config, then it must be dietpi-autostart, which starts the script via systemd unit prior/regardless of login.

To stop it: systemctl stop dietpi-autostart_custom > :smile: >
Generally you can use htop to kill (background) processes as well. The above is the “soft” way for systemd services.
About “how to do properly next time”:

  • If the service is meant to run until it is manually stopped, and it should start on boot, prior or regardless of login, there is not “better” way. Just note that you can use systemctl start|stop|restart dietpi-autostart_custom to handle it, same as all other systemd services. Systemd units run non-interactively in background, so they are not attached to the terminal and you cannot interrupt then e.g. via ctrl+c.
  • Otherwise, if you e.g. want a script to start at login, use /etc/profile.d/my_script.sh, which will then start interactively (in foreground) on terminal, thus can be interrupted.
  • You can also add some conditional exit path for your script code, but depends on what it does and how > :wink:> .

thanks a lot, minutes before your reply I found an old email exachanged with Daniel in which we fixed this issue before

basically we type the root and pass and then between all the mess of text it took the string:

killall python

then it is back to normality :slight_smile:

now the big problem is how to set up the wifi of rpi3 B, so I will start a new thread :slight_smile: