-
-
Notifications
You must be signed in to change notification settings - Fork 6
Starting automatically with systemd
Josh Anderson edited this page Feb 11, 2019
·
2 revisions
After installing soma-ctrl, if you want it to start automatically, you'll need to create a script for systemd
Create a file at /etc/systemd/system/somactrl.service with the following contents:
[Unit]
Description=somactrl
BindsTo=bluetooth.service
PartOf=bluetooth.service
After=bluetooth.service
[Service]
ExecStart=/usr/local/bin/somactrl --url <put_url_to_broker_here> -plus-any-other-options
Restart=always
[Install]
WantedBy=multi-user.target bluetooth.service
Replace the path to somactrl with the full path for your machine (you can find it by running which somactrl
) and add any additional arguments you may need there too.
To get this picked up, you'll then need to run sudo systemctl enable somactrl
From then on, the service should be restarted on reboot or if it crashes.
You can then use e.g. sudo systemctl stop/start/restart somactrl
for manual control