rascol / PPS-Client

GNU General Public License v2.0
39 stars 9 forks source link

Client won't start after updating to newest release of Raspbian, or with a fresh install of it. #4

Open PatrickJScruggs opened 2 years ago

PatrickJScruggs commented 2 years ago

This is for a Raspi3 model B, running the latest 64-bit version of Raspbian lite. PPS-Client had been working with the same setup, but stopped working after I ran an apt-get update/upgrade. After spending hours messing with different configuration settings, and reinstalling PPS-Client multiple times, I decided to try starting over with a fresh install, but the problem is still occurring.

pi@raspberrypi:~ $ sudo systemctl start pps-client
pi@raspberrypi:~ $ pps-client -v
pps-client is not running. "sudo systemctl start pps-client" to start.
pi@raspberrypi:~ $ sudo systemctl status pps-client
● pps-client.service - PPS-Client systemd service.
     Loaded: loaded (/etc/systemd/system/pps-client.service; enabled; vendor preset: enabled)
     Active: activating (start-pre) since Tue 2022-02-01 18:41:34 UTC; 1s ago
Cntrl PID: 4142 (sleep)
      Tasks: 1 (limit: 780)
        CPU: 5ms
     CGroup: /system.slice/pps-client.service
             └─4142 /bin/sleep 3

Feb 01 18:41:34 raspberrypi systemd[1]: Starting PPS-Client systemd service....
pi@raspberrypi:~ $ pps-client -v
pps-client is not running. "sudo systemctl start pps-client" to start.

contents of /var/log/pps-client.log

2022-02-01 18:22:23 Can't set pthread_attr_setstacksize(): No such file or directory
2022-02-01 18:22:46 Can't set pthread_attr_setstacksize(): No such file or directory
2022-02-01 18:23:09 Can't set pthread_attr_setstacksize(): No such file or directory
2022-02-01 18:23:22 Can't set pthread_attr_setstacksize(): No such file or directory
2022-02-01 18:23:39 Can't set pthread_attr_setstacksize(): No such file or directory
2022-02-01 18:23:42 Can't set pthread_attr_setstacksize(): No such file or directory
2022-02-01 18:23:46 Can't set pthread_attr_setstacksize(): No such file or directory

... and so on.

PatrickJScruggs commented 2 years ago

I went poking through the code and saw that there's a call to pthread_attr_setstacksize() in both client/pps-sntp.cpp and client/pps-serial.cpp.

To try and figure out which one was throwing there error, I enabled time-of-day to be set by GPS NMEA sentences over serial in /etc/pps-client.conf, and that fixed the problem. So, I'm assuming the issue has something to do with client/pps-sntp.cpp.

So, that solves the problem for me, but I'll leave this issue open for now since I still don't know why I can't run the client with it getting the time-of-day from NIST.

puchol commented 2 years ago

I have fixed this by increasing the minimum pthread stack size, it was too low for IA-64 architectures. See https://github.com/puchol/PPS-Client/commit/52341ab5e1b9aba0b6026a9d320caef2ccd3ca08