Attempting to set up Raspbian automation is challenging.
Attempting to set up Raspbian automation is challenging.
I'm working with a Plex server on a Raspberry Pi, and all media is stored on networked drives. When I power on the Pi, I need to launch the console and run commands like "sudo mount -a sudo service plexmediaserver restart." Right now I'm trying to automate this so the Pi boots itself and starts the process without manually opening VNC each time. I'm new to Linux and would really appreciate any guidance!
raspbian.sh
Give execute rights and save to ~/.config/autostart-scripts with a .desktop file for all desktops.
You can also locate the systemd service file for plex and configure it to start after a specific system event, such as when certain drives are mounted (and entries exist in fstab). The relevant file will appear with a .service extension. Make sure to enable the service properly so it launches automatically upon boot. One possible issue with Raspberry Pi is its sensitivity to device detection; if the drive isn't detected after OS attempts to mount it, it might cause problems. You should check the logs for more details.