AutoStart: Kiosk Mode AND Custom script? Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
Post Reply
EdE
Posts: 3
Joined: Fri Apr 02, 2021 10:21 am

AutoStart: Kiosk Mode AND Custom script?

Post by EdE »

Greetings,

I am setting up DietPi in Kiosk mode and have everything running properly. (the Pi comes up in Kiosk mode, utilizing the 7" touch screen, hitting YouTube website for testing)

I've also installed Node.js and have a local website that runs in the background through a Custom Autostart script using Forever.

The catch is I can't do both at the same time. I either have to choose "Chromium" as the AutoStart Option, or "Custom" script. (I want the kiosk mode to point to the local website) Is there a simple command to add to my custom script that will launch the Kiosk Mode script or is there another best practice I should follow to achieve this?

TIA.

--Ed
User avatar
Joulinar
Posts: 5619
Joined: Sat Nov 16, 2019 12:49 am

Re: AutoStart: Kiosk Mode AND Custom script?

Post by Joulinar »

You could try to start your Webserver using a systemd service. This way the Webserver is started independent from any login process and could run in parallel to your kiosk mode.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
EdE
Posts: 3
Joined: Fri Apr 02, 2021 10:21 am

Re: AutoStart: Kiosk Mode AND Custom script?

Post by EdE »

Thanks for the suggestion. In looking at systemd service, I noticed the following file:

/etc/systemd/system​/​dietpi-autostart_custom.service

which runs my custom script:

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

So I just duplicated that file to:

/etc/systemd/system​/​webserver.service

and enabled it:

systemctl enable webserver.service

Then I went back into dietpi-config and set AutoStart to Chromium and it all works!

Later.

--Ed
User avatar
Joulinar
Posts: 5619
Joined: Sat Nov 16, 2019 12:49 am

Re: AutoStart: Kiosk Mode AND Custom script?

Post by Joulinar »

good that it i working this way.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply