Sorry this is a long post!
Tried a few things today and I found that if I start the SBFspot Upload Daemon from the command line everything works however after a reboot the Daemon doesn’t restart automatically. Details below:
pi@raspberrypi:/usr/local/bin/sbfspot.3 $ sudo systemctl start SBFspotUpload
pi@raspberrypi:/usr/local/bin/sbfspot.3 $ sudo systemctl status SBFspotUpload
● SBFspotUpload.service - SBFspot Upload Daemon
Loaded: loaded (/usr/local/bin/sbfspot.3/SBFspotUpload.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2018-06-22 12:54:09 BST; 29s ago
Process: 5630 ExecStart=/usr/local/bin/sbfspot.3/SBFspotUploadDaemon -c /usr/local/bin/sbfspot.3/SBFspotUpload.cfg -p
Main PID: 5631 (SBFspotUploadDa)
CGroup: /system.slice/SBFspotUpload.service
└─5631 /usr/local/bin/sbfspot.3/SBFspotUploadDaemon -c /usr/local/bin/sbfspot.3/SBFspotUpload.cfg -p /run/use
Jun 22 12:54:09 raspberrypi systemd[1]: Starting SBFspot Upload Daemon…
Jun 22 12:54:09 raspberrypi systemd[1]: Started SBFspot Upload Daemon.
pi@raspberrypi:/usr/local/bin/sbfspot.3 $ ls /run/user/1000
bus gnupg gvfs menu-cached-:0 pcmanfm-socket–0 sbfspotupload.pid systemd
pi@raspberrypi:/usr/local/bin/sbfspot.3 $ cat /run/user/1000/sbfspotupload.pid
5631
So pid file exists
pi@raspberrypi:~/smadata/logs $ cat SBFspotUpload20180622.log
[06:36:45] INFO: Starting SBFspotUploadDaemon Version 1.1.0
[06:36:45] ERROR: Could not open pid file /run/user/1000/sbfspotupload.pid : No such file or directory
[12:54:09] INFO: Starting SBFspotUploadDaemon Version 1.1.0
[12:54:09] INFO: Starting Daemon…
[12:54:11] INFO: Uploading 100 datapoints, starting with 20180620,16:35,837435,744,283.48,45.7,6.571 => OK (200)
[12:55:30] INFO: Uploading 100 datapoints, starting with 20180621,09:15,841327,1116,287.14,32.8,5.139 => OK (200)
[12:56:31] INFO: Uploading 100 datapoints, starting with 20180621,17:35,852163,912,282.95,42.8,4.277 => OK (200)
[12:57:30] INFO: Uploading 31 datapoints, starting with 20180622,10:25,856598,1596,266.53,44.4,6.376 => OK (200)
[13:00:30] INFO: Uploading datapoint: 20180622,13:00,861118,1812,253.8,53.9,7.621 => OK (200)
So working
Following shutdown and restart …
pi@raspberrypi:~ $ sudo systemctl status SBFspotUpload
● SBFspotUpload.service - SBFspot Upload Daemon
Loaded: loaded (/usr/local/bin/sbfspot.3/SBFspotUpload.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2018-06-22 13:06:28 BST; 1min 32s ago
Process: 386 ExecStart=/usr/local/bin/sbfspot.3/SBFspotUploadDaemon -c /usr/local/bin/sbfspot.3/SBFspotUpload.cfg -p /
Jun 22 13:06:28 raspberrypi systemd[1]: Starting SBFspot Upload Daemon…
Jun 22 13:06:28 raspberrypi systemd[1]: SBFspotUpload.service: Control process exited, code=exited status=1
Jun 22 13:06:28 raspberrypi systemd[1]: Failed to start SBFspot Upload Daemon.
Jun 22 13:06:28 raspberrypi systemd[1]: SBFspotUpload.service: Unit entered failed state.
Jun 22 13:06:28 raspberrypi systemd[1]: SBFspotUpload.service: Failed with result ‘exit-code’.
pi@raspberrypi:~ $ ls /run/user/1000
bus gnupg gvfs menu-cached-:0 pcmanfm-socket–0 systemd
So Daemon not started and no pid file
pi@raspberrypi:~ $ sudo systemctl start SBFspotUpload
pi@raspberrypi:~ $ sudo systemctl status SBFspotUpload
● SBFspotUpload.service - SBFspot Upload Daemon
Loaded: loaded (/usr/local/bin/sbfspot.3/SBFspotUpload.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2018-06-22 13:10:54 BST; 6s ago
Process: 945 ExecStart=/usr/local/bin/sbfspot.3/SBFspotUploadDaemon -c /usr/local/bin/sbfspot.3/SBFspotUpload.cfg -p /
Main PID: 946 (SBFspotUploadDa)
CGroup: /system.slice/SBFspotUpload.service
└─946 /usr/local/bin/sbfspot.3/SBFspotUploadDaemon -c /usr/local/bin/sbfspot.3/SBFspotUpload.cfg -p /run/user
Jun 22 13:10:54 raspberrypi systemd[1]: Starting SBFspot Upload Daemon…
Jun 22 13:10:54 raspberrypi systemd[1]: Started SBFspot Upload Daemon.
pi@raspberrypi:~ $ ls /run/user/1000
bus gnupg gvfs menu-cached-:0 pcmanfm-socket–0 sbfspotupload.pid systemd
Working again
Then I tried re-enabling the service but it still didn’t survive a reboot.
pi@raspberrypi:~ $ sudo systemctl enable /usr/local/bin/sbfspot.3/SBFspotUpload.service
Shutdown and restart
pi@raspberrypi:~ $ sudo systemctl status SBFspotUpload
● SBFspotUpload.service - SBFspot Upload Daemon
Loaded: loaded (/usr/local/bin/sbfspot.3/SBFspotUpload.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2018-06-22 13:48:13 BST; 2min 36s ago
Process: 402 ExecStart=/usr/local/bin/sbfspot.3/SBFspotUploadDaemon -c /usr/local/bin/sbfspot.3/SBFspotUpload.cfg -p /
Jun 22 13:48:13 raspberrypi systemd[1]: Starting SBFspot Upload Daemon…
Jun 22 13:48:13 raspberrypi systemd[1]: SBFspotUpload.service: Control process exited, code=exited status=1
Jun 22 13:48:13 raspberrypi systemd[1]: Failed to start SBFspot Upload Daemon.
Jun 22 13:48:13 raspberrypi systemd[1]: SBFspotUpload.service: Unit entered failed state.
Jun 22 13:48:13 raspberrypi systemd[1]: SBFspotUpload.service: Failed with result ‘exit-code’.
Manual start - working again
pi@raspberrypi:~ $ sudo systemctl start SBFspotUpload
pi@raspberrypi:~ $ sudo systemctl status SBFspotUpload
● SBFspotUpload.service - SBFspot Upload Daemon
Loaded: loaded (/usr/local/bin/sbfspot.3/SBFspotUpload.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2018-06-22 13:51:17 BST; 4s ago
Process: 912 ExecStart=/usr/local/bin/sbfspot.3/SBFspotUploadDaemon -c /usr/local/bin/sbfspot.3/SBFspotUpload.cfg -p /
Main PID: 913 (SBFspotUploadDa)
CGroup: /system.slice/SBFspotUpload.service
└─913 /usr/local/bin/sbfspot.3/SBFspotUploadDaemon -c /usr/local/bin/sbfspot.3/SBFspotUpload.cfg -p /run/user
Jun 22 13:51:17 raspberrypi systemd[1]: Starting SBFspot Upload Daemon…
Jun 22 13:51:17 raspberrypi systemd[1]: Started SBFspot Upload Daemon.
I’m a bit out of my depth here, really appreciate your help.