project-owner / Peppy

Peppy Player Repository
GNU General Public License v3.0
72 stars 14 forks source link

systemd file for Peppy #26

Closed DrTron closed 2 years ago

DrTron commented 2 years ago

All,

with the current method to start Peppy from rc.local, one cannot easily restart Peppy (for configuration changes, for instance) and has to reboot the system to restart Peppy. However, one can easily create a systemd service and start Peppy this way. Here's how:

  1. create file peppy.service in /etc/systemd/system/
  2. paste these lines there:
    
    [Unit]
    Description=Peppy
    After=network.target

[Service] ExecStart=openvt -s -w -- python3 peppy.py WorkingDirectory=/home/pi/Peppy StandardOutput=inherit StandardError=inherit Restart=on-failure

User=pi Group=pi

[Install] WantedBy=multi-user.target


3. Reload systemd with "systemctl daemon-reload"
4. Enable service with "systemctl enable peppy.service" to have the service run on startup
5. Remove the openvt start line from rc.local
6. stop/start/restart Peppy as needed with "systemctl stop|start|restart peppy.service"
project-owner commented 2 years ago

Thanks a lot! It's very helpful. I'll use this stuff for disk images next time.

project-owner commented 2 years ago

The enhancement was implemented in the new release - Seurat Edition.