I need to create a systemd service to start some owfs-daemon automatically.
I can manually start the daemon with
sudo /opt/owfs/bin/owfs --i2c=ALL:ALL --allow_other /mnt/1wire/. Then there are folders and files with the different temperatures created in
/mnt/1wire. It is not possible to start the owfs-daemon as a normal user.
Now I tried to create some systemd service to start it automatically (see following code).
[Unit] Description=1-wire service After=syslog.target After=network.target [Service] Type=simple ExecStart=/opt/owfs/bin/owfs --i2c=ALL:ALL --allow_other /mnt/1wire/ # Give a reasonable amount of time for the server to start up/shut down TimeoutSec=300 [Install] WantedBy=multi-user.target
I installed the service and I can also start it by with
sudo systemctl start owfs.service. But there are no files created in
sudo systemctl status owfs.service shows following output.
● owfs.service - 1-wire service Loaded: loaded (/lib/systemd/system/owfs.service; enabled) Active: inactive (dead) since Sat 2016-02-27 13:11:13 UTC; 20s ago Process: 1025 ExecStart=/usr/local/bin/temperature/owfs.sh (code=exited, status=0/SUCCESS) Main PID: 1025 (code=exited, status=0/SUCCESS) Feb 27 13:11:13 raspberrypi systemd: Started 1-wire service.
I think the service is not started as root user. Wich modifications do need to make in my service file to correctly start the owfs-daemon?
EDIT: Here is the service file which is working with owfs.
[Unit] Description=1-wire service [Service] Type=forking ExecStart=/opt/owfs/bin/owfs --i2c=ALL:ALL --allow_other /mnt/1wire/ # Give a reasonable amount of time for the server to start up/shut down TimeoutSec=300