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


and remove the line with the python script? and how to do it properly next time?/var/lib/dietpi/dietpi-autostart/custom.sh
Okay, just read the issue on the forum (I guess this is yours as well?): viewtopic.php?f=11&t=5285
I understood now that it is not only a question but urgent help request.
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`![]()
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.
Code: Select all
killall python