gpsd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JADP - systemd, gpsd


From: Paul Theodoropoulos
Subject: Re: JADP - systemd, gpsd
Date: Wed, 26 Feb 2020 21:58:44 -0800
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

Huh. I assume there's no downside to turning on the '-n' option?

The thing about systemd is that it presents you with this:
   https://i.imgur.com/sJHJohf.jpg
When all you asked for is this:
   https://i.imgur.com/DqLT1Ou.jpg

But the 'upside' is that telling it to just do the latter is reasonably straightforward, particularly since most  such startup files are similarly simple, so you can just cut & paste your way to success. The rest is just bloated snake oil you can ignore in 99.995% of use-cases.

On 2/26/2020 21:31 PM, Gary E. Miller wrote:
Yo Paul!

I highly discourage running without the "-n" option.

Any idea why last week no one could find a working systemd config?

On Wed, 26 Feb 2020 19:50:25 -0800
Paul Theodoropoulos via <address@hidden> wrote:

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.




RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        address@hidden  Tel:+1 541 382 8588

            Veritas liberabit vos. -- Quid est veritas?
     "If you can't measure it, you can't improve it." - Lord Kelvin

--
Paul Theodoropoulos
www.anastrophe.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]