Skip to content

SystemD

Below outlines an example systemd configuration for switchboard.

[Unit]
Description=SWITCHBOARD demo service
After=network.target
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=always
RestartSec=1
User=pi
ExecStart=switchboard watch --config /home/pi/config.yaml
StandardOutput=append:/var/log/switchboard/log1.log
StandardError=append:/var/log/switchboard/error1.log


[Install]
WantedBy=multi-user.target

Copy the above example and create a file called switchboard.service in /etc/systemd/system folder.

Info

You may need to create the log and error files ahead of time.

Start, Stop, Status and Reload Service

You can stop, start, and reload the service using any of the following commands.

  • Start systemctl start switchboard

  • Reload systemctl daemon-reload switchboard

  • Stop systemctl stop switchboard

  • Status systemctl status switchboard