I am not sure if this is a bug, but dietpi soft should have an option like boot up types before running that script at startup to revert it, does it have?
I have a python script running without login at startup, created with the dietpi options (last one) to run anything at startup, now I cant even close it with Ctrl+C, how can I revert it without using a second linux PC to edit files?
thanks in advance
@joyeriastv
You man you use dietpi-postboot with /var/lib/dietpi/postboot.d/* to start your script?
Since postboot is started via systemd unit, is is executed non-interactively outside of terminal. You should only use this for oneshot scripts that themself exit. If you want to start a script that stay running interactively, you should do start on login, e.g. via: /etc/profile.d/*.sh
I'm not aware of a method to run a script interactively on terminal, but before actually login.
Another possibility is to create an own systemd unit to start at desired boot stage. It will be always non-interactive but you are able to stop it via: systemd stop servive_name
โฌ: See below, didn't read carefully before ๐
.
Okay, just read the issue on the forum (I guess this is yours as well?): https://dietpi.com/phpbb/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":
systemctl start|stop|restart dietpi-autostart_custom to handle it, same as all other systemd services. Systemd units by default run non-interactively in background, so they are not attached to the terminal and you cannot interrupt them e.g. via ctrl+c./etc/profile.d/my_script.sh, which will then start interactively (in foreground) on terminal, thus can be interrupted.Will mark as closed, since question has been answered/issue solved. Feel free to reopen, if required.