MichaIng / DietPi

Lightweight justice for your single-board computer!
https://dietpi.com/
GNU General Public License v2.0
4.85k stars 495 forks source link

Issue with Auto-Start Option 17: Custom Script Not Executed #7241

Open loss-and-quick opened 3 days ago

loss-and-quick commented 3 days ago

Creating a bug report/issue

Required Information

Additional Information (if applicable)

Steps to reproduce

  1. Choose option 17 in autostart menu
  2. Edit /var/lib/dietpi/dietpi-autostart/custom.sh

Expected behaviour

Actual behaviour

Extra details

loss-and-quick commented 3 days ago

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

#!/bin/bash
# DietPi-AutoStart custom script
# Location: /var/lib/dietpi/dietpi-autostart/custom.sh
(poetry run -C /home/dietpi/earing python3 -u earing/earing/main.py | while IFS= read -r line; do echo "earning: $line"; done | logdy-core forward 8123) &
touch /home/dietpi/test
exit 0
MichaIng commented 3 days ago

Many thanks for your report.

What do you see on the console after auto-login? There should be this line:

[ INFO ] Starting DietPi-AutoStart custom script...

followed by the output of the custom.sh script.

loss-and-quick commented 2 days ago

@MichaIng I'm sorry, but I switched to Alpine. When the problem arose, I searched all the files in the DietPi source code at /var/lib/dietpi/dietpi-autostart/custom.sh and realized that option 17 is not implemented at all. Specifically, when selecting option 17, a console-getty service is created, along with another similar one with comparable content, and nothing else is created. Additionally, there is nothing in the DietPi logs related to autostart.

I suspect that option 17 is fundamentally unimplemented.

MichaIng commented 2 days ago

It is implemented here, like all autologin + foreground options 😉: https://github.com/MichaIng/DietPi/blob/master/dietpi/dietpi-login#L85

loss-and-quick commented 2 days ago

It is implemented here, like all autologin + foreground options 😉: https://github.com/MichaIng/DietPi/blob/master/dietpi/dietpi-login#L85

But I tried to search in system using grep, and didn't find anything like that

I figured only that agetty creates shell...

MichaIng commented 2 days ago

That should be in /boot/dietpi/dietpi-login, which is loaded from /etc/bashrc.d/dietpi.bash, which is loaded from /etc/bash.bashrc, which is loaded on every interactive bash session, which is loaded (by default) on agetty logins.