[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
JADP - systemd, gpsd
From: |
Paul Theodoropoulos |
Subject: |
JADP - systemd, gpsd |
Date: |
Wed, 26 Feb 2020 19:50:25 -0800 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
I run raspbian on a pi for my timeserver. It uses systemd of course. I've
no problems with this systemd configuration, should anyone else find it
useful...
root@ A-NTPsec: ~ # cat /etc/systemd/system/gpsd.service | grep -v ^#
[Unit]
Description=GPS (Global Positioning System) Daemon
After=partrt.service
Before=timeservice.service
Requires=timeservice.service
[Service]
Type=oneshot
EnvironmentFile=-/etc/default/gpsd
EnvironmentFile=-/etc/sysconfig/gpsd
ExecStartPre=stty -F /dev/gpsd0 raw 115200 cs8 clocal -cstopb
ExecStart=/usr/local/sbin/gpsd $GPSD_OPTIONS $OPTIONS $DEVICES
ExecStartPost=/usr/local/bin/sched.gpsd
ExecStartPost=/bin/sleep 5
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
root@ A-NTPsec: ~ # cat /etc/default/gpsd | grep -v ^#|grep -v ^$
START_DAEMON="true"
DEVICES="/dev/gpsd0"
GPSD_OPTIONS="-r -P /run/gpsd.pid"
root@ A-NTPsec: ~ # pstree -lupa | grep gpsd
|-gpsd,1608,nobody -r -P /run/gpsd.pid /dev/gpsd0
| `-{gpsd},1632
In the gpsd service file, you can ignore 'After'/'Before'/'Requires' in
the Unit portion, as they're specific to the CPU partitioning/scheduler
regime I run it under, and running it before ntpd. Same for the
'ExecStartPost' entries.
Anyway, the above works fine for me.
--
Paul Theodoropoulos
www.anastrophe.com
- JADP - systemd, gpsd,
Paul Theodoropoulos <=