[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gpsd-users] gpsd always starting in foregound (a systemd solution)
From: |
Moe |
Subject: |
Re: [gpsd-users] gpsd always starting in foregound (a systemd solution) |
Date: |
Fri, 13 May 2016 00:53:02 +1000 |
On Thu, 12 Jun 2014 21:48:52 -0400
"Jobs, Steve" <address@hidden> wrote:
> The problem turned out to be systemd. Yay, now I can jump on the
> bandwagon and rant about how systemd sucks. Anyways, I would assume
> anyone who is using a beaglebone black with either debian wheezy or
> Jessie would be running into the same problem. As I am using my BBB as
> a headless server it was simple enough to disable systemd in the
> Uenv.txt config file. On reboot everything just works!
>
> On 5/27/2014 9:12 AM, Eric S. Raymond wrote:
> > Jobs, Steve <address@hidden>:
> >> gpsd is always staring in the foreground (-N) with no additional arguments.
> >
> > That's a weird one.
> >
> > I see from your trace log that clone(2) is getting called but setsid()
> > is not. So it looks like what's happening is that gpsd is for some
> > reason failing to background itself properly - probably because the
> > fork call is erroring out.
> >
> > First thing to figure out is whether your instance is calling daemon(3)
> > from a system library or from the emulation iin the GPSD distribution.
> > How are your C skills?
I felt I was missing out. I just tried out a swanky new distribution that uses
apt-get packages and systemd to handle gpsd, et al.. (Xubuntu 16.04)
As long as works without drama, I don't really care.
But, it didn't work, that is...until I had a discussion with systemd.
As others have noted the -N flag accompanied all gpsd starts regardless of the
contents of /etc/default/gpsd file. This was tracked down to:
# cat /lib/systemd/system/gpsd.service
[Unit]
Description=GPS (Global Positioning System) Daemon
Requires=gpsd.socket
# Needed with chrony SOCK refclock
After=chronyd.service
[Service]
EnvironmentFile=-/etc/default/gpsd
ExecStart=/usr/sbin/gpsd -N $GPSD_OPTIONS $DEVICES <-----right in there
[Install]
WantedBy=multi-user.target
Also=gpsd.socket
If the flag is removed, and I reloaded the things that make systemd work, I
could turn off the gpsd as before, but not restart it...if I rebooted, I get
nothing. Sure it said all was honky dory, or spit back a cryptic confession
something of which I had no clue.
The 'net was of little help. The spotty trail of tears runs a few years back,
but with brief exchanges of bad advice and dead ends.
So this is my brief exchange of bad advice.
Add two lines
Type=forking
PIDfile=/var/run/gpsd.pid
so the file now looks like:
[Unit]
Description=GPS (Global Positioning System) Daemon
Requires=gpsd.socket
# Needed with chrony SOCK refclock
After=chronyd.service
[Service]
Type=forking
PIDfile=/var/run/gpsd.pid
EnvironmentFile=-/etc/default/gpsd
ExecStart=/usr/sbin/gpsd $GPSD_OPTIONS $DEVICES
[Install]
WantedBy=multi-user.target
Also=gpsd.socket
##
gpsd now is controlable via
service gpsd stop
service gpsd start
service gpsd restart
There are the irritating pop up authentications, but it works for me, and the
contents of /etc/default/gpsd are no longer glossed over.
--
Moe <address@hidden>
- Re: [gpsd-users] gpsd always starting in foregound (a systemd solution),
Moe <=