Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.raspberry-pi > #10926 > unrolled thread

GPSD not starting automatically

Started byDavid Taylor <david-taylor@blueyonder.co.uk.invalid>
First post2016-03-02 11:17 +0000
Last post2016-03-04 17:32 +0000
Articles 12 — 6 participants

Back to article view | Back to comp.sys.raspberry-pi


Contents

  GPSD not starting automatically David Taylor <david-taylor@blueyonder.co.uk.invalid> - 2016-03-02 11:17 +0000
    Re: GPSD not starting automatically David <wibble@btintenet.com> - 2016-03-02 12:22 +0000
      Re: GPSD not starting automatically David Taylor <david-taylor@blueyonder.co.uk.invalid> - 2016-03-02 14:59 +0000
        Re: GPSD not starting automatically alister <alister.ware@ntlworld.com> - 2016-03-02 17:16 +0000
    Re: GPSD not starting automatically Martin Gregorie <martin@address-in-sig.invalid> - 2016-03-02 12:34 +0000
      Re: GPSD not starting automatically David Taylor <david-taylor@blueyonder.co.uk.invalid> - 2016-03-02 14:56 +0000
        Re: GPSD not starting automatically Martin Gregorie <martin@address-in-sig.invalid> - 2016-03-02 16:47 +0000
          Re: GPSD not starting automatically David Taylor <david-taylor@blueyonder.co.uk.invalid> - 2016-03-04 16:50 +0000
            Re: GPSD not starting automatically Tomasz Torcz <zdzichu@irc.-spamu.nie.chce-.pl> - 2016-03-04 17:14 +0000
              Re: GPSD not starting automatically David Taylor <david-taylor@blueyonder.co.uk.invalid> - 2016-03-05 20:58 +0000
                Re: GPSD not starting automatically markallenshell@gmail.com - 2016-03-05 18:34 -0800
            Re: GPSD not starting automatically Martin Gregorie <martin@address-in-sig.invalid> - 2016-03-04 17:32 +0000

#10926 — GPSD not starting automatically

FromDavid Taylor <david-taylor@blueyonder.co.uk.invalid>
Date2016-03-02 11:17 +0000
SubjectGPSD not starting automatically
Message-ID<nb6huq$lj2$1@dont-email.me>
Yes, you already think you know the answer looking at the topic title, 
but perhaps it's not the obvious one!

Raspbian Jessie, with current updates.
gpsd installed and working from the default serial port.  Almost.

When first booting the RPi gpsd does /not/ autostart in spite of "-n" 
being present in the options.  This used to work under Wheezy.

So I enter:  "sudo service gpsd restart"  and gpsd is then running as 
normal.  I guess I'm missing something obvious, but what?  Any thoughts 
about what the problem might be, and how to proceed with further diagnosis?

Thanks!
-- 
Cheers,
David
Web: http://www.satsignal.eu

[toc] | [next] | [standalone]


#10930

FromDavid <wibble@btintenet.com>
Date2016-03-02 12:22 +0000
Message-ID<djo47iF9pjeU3@mid.individual.net>
In reply to#10926
On Wed, 02 Mar 2016 11:17:36 +0000, David Taylor wrote:

> Yes, you already think you know the answer looking at the topic title,
> but perhaps it's not the obvious one!
> 
> Raspbian Jessie, with current updates.
> gpsd installed and working from the default serial port.  Almost.
> 
> When first booting the RPi gpsd does /not/ autostart in spite of "-n"
> being present in the options.  This used to work under Wheezy.
> 
> So I enter:  "sudo service gpsd restart"  and gpsd is then running as
> normal.  I guess I'm missing something obvious, but what?  Any thoughts
> about what the problem might be, and how to proceed with further
> diagnosis?
> 
> Thanks!

Are you sure the script is being executed at start up?

Perhaps include a diagnostic message output to a temporary file to confirm 
execution?

Assuming you can find the script that is supposed to start the process, of 
course.

Systemd joys await me shortly.

Cheers

Dave R



-- 
Windows 8.1 on PCSpecialist box

[toc] | [prev] | [next] | [standalone]


#10940

FromDavid Taylor <david-taylor@blueyonder.co.uk.invalid>
Date2016-03-02 14:59 +0000
Message-ID<nb6uum$5v4$2@dont-email.me>
In reply to#10930
On 02/03/2016 12:22, David wrote:
[]
> Are you sure the script is being executed at start up?
>
> Perhaps include a diagnostic message output to a temporary file to confirm
> execution?
>
> Assuming you can find the script that is supposed to start the process, of
> course.
>
> Systemd joys await me shortly.
>
> Cheers
>
> Dave R

Thanks, Dave.  The script is a configuration one, rather than a start-up 
one - see my other post.  With Jessie I have no idea where the actual 
start-up script lives.

I'm trying to get this figured out so that I can put it on my Web pages 
to help others.

-- 
Cheers,
David
Web: http://www.satsignal.eu

[toc] | [prev] | [next] | [standalone]


#10945

Fromalister <alister.ware@ntlworld.com>
Date2016-03-02 17:16 +0000
Message-ID<GdFBy.1135976$Yh.521769@fx36.am4>
In reply to#10940
On Wed, 02 Mar 2016 14:59:25 +0000, David Taylor wrote:

> On 02/03/2016 12:22, David wrote:
> []
>> Are you sure the script is being executed at start up?
>>
>> Perhaps include a diagnostic message output to a temporary file to
>> confirm execution?
>>
>> Assuming you can find the script that is supposed to start the process,
>> of course.
>>
>> Systemd joys await me shortly.
>>
>> Cheers
>>
>> Dave R
> 
> Thanks, Dave.  The script is a configuration one, rather than a start-up
> one - see my other post.  With Jessie I have no idea where the actual
> start-up script lives.
> 
> I'm trying to get this figured out so that I can put it on my Web pages
> to help others.

most things are no controlled by the systemctl command

systemctl status <service>	Show the status of service
systemctl start <service>	Starts Service
systemctl stop <service>	stops service
systemctl enable <service>	enables service @ startup
systemctl disable <service>	disables service @ startup
systemctl is-enabled <service>	Checks if service is enabled or disabled

this should help with your problem (I Hope)


-- 
A penny saved is a penny taxed.

[toc] | [prev] | [next] | [standalone]


#10933

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2016-03-02 12:34 +0000
Message-ID<nb6mjp$1mi$1@dont-email.me>
In reply to#10926
On Wed, 02 Mar 2016 11:17:36 +0000, David Taylor wrote:

> When first booting the RPi gpsd does /not/ autostart in spite of "-n"
> being present in the options.  This used to work under Wheezy.
>
Where are these options of which you speak?
 
> So I enter:  "sudo service gpsd restart"  and gpsd is then running as
> normal.  I guess I'm missing something obvious, but what?  Any thoughts
> about what the problem might be, and how to proceed with further
> diagnosis?
>
Is the -n option present in both the ExecStart and ExecReload lines in 
the [Service] section of gpsd.service?
 

-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

[toc] | [prev] | [next] | [standalone]


#10939

FromDavid Taylor <david-taylor@blueyonder.co.uk.invalid>
Date2016-03-02 14:56 +0000
Message-ID<nb6upj$5v4$1@dont-email.me>
In reply to#10933
On 02/03/2016 12:34, Martin Gregorie wrote:
> On Wed, 02 Mar 2016 11:17:36 +0000, David Taylor wrote:
>
>> When first booting the RPi gpsd does /not/ autostart in spite of "-n"
>> being present in the options.  This used to work under Wheezy.
>>
> Where are these options of which you speak?
>
>> So I enter:  "sudo service gpsd restart"  and gpsd is then running as
>> normal.  I guess I'm missing something obvious, but what?  Any thoughts
>> about what the problem might be, and how to proceed with further
>> diagnosis?
>>
> Is the -n option present in both the ExecStart and ExecReload lines in
> the [Service] section of gpsd.service?

The options are entered by manually editing  /etc/default/gpsd  in 
Jessie.  I have:

START_DAEMON="true"
GPSD_OPTIONS="-n  /dev/ttyAMA0"
DEVICES=""
USBAUTO="false"
GPSD_SOCKET="/var/run/gpsd.sock"

although I've also tried:

START_DAEMON="true"
GPSD_OPTIONS="-n"
DEVICES="/dev/ttyAMA0"
USBAUTO="false"
GPSD_SOCKET="/var/run/gpsd.sock"

Where might I find gpsd.service?  That's not a file I am familiar with 
at all, but I'd like to check it.

-- 
Cheers,
David
Web: http://www.satsignal.eu

[toc] | [prev] | [next] | [standalone]


#10944

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2016-03-02 16:47 +0000
Message-ID<nb75eu$q20$1@dont-email.me>
In reply to#10939
On Wed, 02 Mar 2016 14:56:42 +0000, David Taylor wrote:

> On 02/03/2016 12:34, Martin Gregorie wrote:
>> On Wed, 02 Mar 2016 11:17:36 +0000, David Taylor wrote:
>>
>>> When first booting the RPi gpsd does /not/ autostart in spite of "-n"
>>> being present in the options.  This used to work under Wheezy.
>>>
>> Where are these options of which you speak?
>>
>>> So I enter:  "sudo service gpsd restart"  and gpsd is then running as
>>> normal.  I guess I'm missing something obvious, but what?  Any
>>> thoughts about what the problem might be, and how to proceed with
>>> further diagnosis?
>>>
>> Is the -n option present in both the ExecStart and ExecReload lines in
>> the [Service] section of gpsd.service?
> 
> The options are entered by manually editing  /etc/default/gpsd  in
> Jessie.  I have:
> 
> START_DAEMON="true"
> GPSD_OPTIONS="-n  /dev/ttyAMA0"
> DEVICES=""
> USBAUTO="false"
> GPSD_SOCKET="/var/run/gpsd.sock"
> 
> although I've also tried:
> 
> START_DAEMON="true"
> GPSD_OPTIONS="-n"
> DEVICES="/dev/ttyAMA0"
> USBAUTO="false"
> GPSD_SOCKET="/var/run/gpsd.sock"
> 
> Where might I find gpsd.service?  That's not a file I am familiar with
> at all, but I'd like to check it.

Not having gpsd installed, I looked at crond.service to check the keynames 
in the [Service] section. There were copies in /etc/systemd/system/* and /
usr/lib/systemd/system - if its not in either, try "locate gpsd.service".

For an explanation of the content of .service files, try 

   man 5 systemd.service

which mainly covers the [Service] section of a .service file and contains 
references to other manpages which cover the contents of the [Unit] and 
[Install] sections as well as other material.

One thing I should have asked earlier: what does "systemctl status gpsd" 
show?

The reason I ask is that by default systemd daemons are disabled when 
they're first installed - under Fedora anyway. This means that although 
you can start them with 'systemctl start servicename', they will not 
start automatically at boot time until you've run 
"systemctl enable servicename". 

This is no different from sysVinit, where you had to do exactly the same 
using syscontrol whenever you installed a new daemon in order to tell it 
which runlevels it should be active at.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

[toc] | [prev] | [next] | [standalone]


#10984

FromDavid Taylor <david-taylor@blueyonder.co.uk.invalid>
Date2016-03-04 16:50 +0000
Message-ID<nbce7s$12m$1@dont-email.me>
In reply to#10944
On 02/03/2016 16:47, Martin Gregorie wrote:
> On Wed, 02 Mar 2016 14:56:42 +0000, David Taylor wrote:
>
>> On 02/03/2016 12:34, Martin Gregorie wrote:
>>> On Wed, 02 Mar 2016 11:17:36 +0000, David Taylor wrote:
>>>
>>>> When first booting the RPi gpsd does /not/ autostart in spite of "-n"
>>>> being present in the options.  This used to work under Wheezy.
>>>>
>>> Where are these options of which you speak?
>>>
>>>> So I enter:  "sudo service gpsd restart"  and gpsd is then running as
>>>> normal.  I guess I'm missing something obvious, but what?  Any
>>>> thoughts about what the problem might be, and how to proceed with
>>>> further diagnosis?
>>>>
>>> Is the -n option present in both the ExecStart and ExecReload lines in
>>> the [Service] section of gpsd.service?
>>
>> The options are entered by manually editing  /etc/default/gpsd  in
>> Jessie.  I have:
>>
>> START_DAEMON="true"
>> GPSD_OPTIONS="-n  /dev/ttyAMA0"
>> DEVICES=""
>> USBAUTO="false"
>> GPSD_SOCKET="/var/run/gpsd.sock"
>>
>> although I've also tried:
>>
>> START_DAEMON="true"
>> GPSD_OPTIONS="-n"
>> DEVICES="/dev/ttyAMA0"
>> USBAUTO="false"
>> GPSD_SOCKET="/var/run/gpsd.sock"
>>
>> Where might I find gpsd.service?  That's not a file I am familiar with
>> at all, but I'd like to check it.
>
> Not having gpsd installed, I looked at crond.service to check the keynames
> in the [Service] section. There were copies in /etc/systemd/system/* and /
> usr/lib/systemd/system - if its not in either, try "locate gpsd.service".
>
> For an explanation of the content of .service files, try
>
>     man 5 systemd.service
>
> which mainly covers the [Service] section of a .service file and contains
> references to other manpages which cover the contents of the [Unit] and
> [Install] sections as well as other material.
>
> One thing I should have asked earlier: what does "systemctl status gpsd"
> show?
>
> The reason I ask is that by default systemd daemons are disabled when
> they're first installed - under Fedora anyway. This means that although
> you can start them with 'systemctl start servicename', they will not
> start automatically at boot time until you've run
> "systemctl enable servicename".
>
> This is no different from sysVinit, where you had to do exactly the same
> using syscontrol whenever you installed a new daemon in order to tell it
> which runlevels it should be active at.

Martin,

Thanks for all that!  I located the service file here:

   /lib/systemd/system/gpsd.service

It contains:

[Unit]
Description=GPS (Global Positioning System) Daemon
Requires=gpsd.socket

[Service]
EnvironmentFile=-/etc/default/gpsd
ExecStart=/usr/sbin/gpsd -N $GPSD_OPTIONS $DEVICES

[Install]
Also=gpsd.socket

I don't see why that wouldn't start the service, but I really know very 
little at this level.

Again the issue is:

- reboot
- gpsd service does/not/ start
- run cgps and exit
- gosd service is started

It's just as if the "-n" parameter is being ignored.

-- 
Cheers,
David
Web: http://www.satsignal.eu

[toc] | [prev] | [next] | [standalone]


#10986

FromTomasz Torcz <zdzichu@irc.-spamu.nie.chce-.pl>
Date2016-03-04 17:14 +0000
Message-ID<slrnndjgk0.mu1i.zdzichu@mother.pipebreaker.pl>
In reply to#10984
 Dzieki, David, za post o tresci: 
> Martin,
>
> Thanks for all that!  I located the service file here:
>
>    /lib/systemd/system/gpsd.service
>
> It contains:
>
> [Unit]
> Description=GPS (Global Positioning System) Daemon
> Requires=gpsd.socket
>
> [Service]
> EnvironmentFile=-/etc/default/gpsd
> ExecStart=/usr/sbin/gpsd -N $GPSD_OPTIONS $DEVICES
>
> [Install]
> Also=gpsd.socket
>
> I don't see why that wouldn't start the service, but I really know very 
> little at this level.

  Well, this unit file doesn't have entries required for enabling
autostart.  I guess because socket-activation is used – it
means GPSD is started on-demand, when first client connects.
The appearance of ”gpsd.socket” strongly suggest so.

Following confirms that gpsd is started on client access:

> Again the issue is:
>
> - reboot
> - gpsd service does/not/ start
> - run cgps and exit
> - gosd service is started
>
> It's just as if the "-n" parameter is being ignored.

  It's not ignored, gpsd is not started at boot so it 
can't intepret this option or not.
  Your distribution decided to configure GPSD to be started
on-demand.  There is probably some reasoning for it, especially
that there are no means to easily enable on-boot GPSD startup
(using systemctl enable).
  Of course you can still manually override those decisions
and start gpsd on boot by issuing:

ln -s /lib/systemd/system/gpsd.service /etc/systemd/system/multi-user.target.wants/


-- 
Tomasz   .. oo o.   oo o. .o   .o o. o. oo o.   ..
Torcz    .. .o .o   .o .o oo   oo .o .. .. oo   oo
o.o.o.   .o .. o.   o. o. o.   o. o. oo .. ..   o.

[toc] | [prev] | [next] | [standalone]


#10999

FromDavid Taylor <david-taylor@blueyonder.co.uk.invalid>
Date2016-03-05 20:58 +0000
Message-ID<nbfh3n$im5$1@dont-email.me>
In reply to#10986
On 04/03/2016 17:14, Tomasz Torcz wrote:
[]
>    It's not ignored, gpsd is not started at boot so it
> can't intepret this option or not.
>    Your distribution decided to configure GPSD to be started
> on-demand.  There is probably some reasoning for it, especially
> that there are no means to easily enable on-boot GPSD startup
> (using systemctl enable).
>    Of course you can still manually override those decisions
> and start gpsd on boot by issuing:
>
> ln -s /lib/systemd/system/gpsd.service /etc/systemd/system/multi-user.target.wants/

Thanks for that, Tomasz, works perfectly.

Martin, apologies for not answering the status question.  I'm afraid I 
can't now recall what the status was, but I now get a multi-line output. 
  Previously it was a single word.

I do appreciate everyone's help, and this is now written up on my Web 
site for anyone to use.

-- 
Cheers,
David
Web: http://www.satsignal.eu

[toc] | [prev] | [next] | [standalone]


#11000

Frommarkallenshell@gmail.com
Date2016-03-05 18:34 -0800
Message-ID<a8ba839f-37ac-4547-80f8-1a8cd2562216@googlegroups.com>
In reply to#10999
David,

Thank you so very much for your web site.  It worked great for me over the past couple of days as I built a RPi with Adafruit GPS Hat -- except for starting gpsd on boot.

I finally found that running the following command from the "start)" section of /etc/init.d/ntp did the trick:

    gpspipe -d -r -l -n 1 -o /dev/null

It waits 10 seconds, then accesses gpsd to read one NEMA sentence, then exits.

Seems to work, but is a bit of a kludge.  I like the solution posted by Tomasz Torc much better.

Again, thanks for your great web site.

Tomasz Torc -- thanks for your solution!

Mark

[toc] | [prev] | [next] | [standalone]


#10989

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2016-03-04 17:32 +0000
Message-ID<nbcgr4$5ds$1@dont-email.me>
In reply to#10984
On Fri, 04 Mar 2016 16:50:59 +0000, David Taylor wrote:

> On 02/03/2016 16:47, Martin Gregorie wrote:
>> On Wed, 02 Mar 2016 14:56:42 +0000, David Taylor wrote:
>>
>>> On 02/03/2016 12:34, Martin Gregorie wrote:
>>>> On Wed, 02 Mar 2016 11:17:36 +0000, David Taylor wrote:
>>>>
>>>>> When first booting the RPi gpsd does /not/ autostart in spite of
>>>>> "-n"
>>>>> being present in the options.  This used to work under Wheezy.
>>>>>
>>>> Where are these options of which you speak?
>>>>
>>>>> So I enter:  "sudo service gpsd restart"  and gpsd is then running
>>>>> as normal.  I guess I'm missing something obvious, but what?  Any
>>>>> thoughts about what the problem might be, and how to proceed with
>>>>> further diagnosis?
>>>>>
>>>> Is the -n option present in both the ExecStart and ExecReload lines
>>>> in the [Service] section of gpsd.service?
>>>
>>> The options are entered by manually editing  /etc/default/gpsd  in
>>> Jessie.  I have:
>>>
>>> START_DAEMON="true"
>>> GPSD_OPTIONS="-n  /dev/ttyAMA0"
>>> DEVICES=""
>>> USBAUTO="false"
>>> GPSD_SOCKET="/var/run/gpsd.sock"
>>>
>>> although I've also tried:
>>>
>>> START_DAEMON="true"
>>> GPSD_OPTIONS="-n"
>>> DEVICES="/dev/ttyAMA0"
>>> USBAUTO="false"
>>> GPSD_SOCKET="/var/run/gpsd.sock"
>>>
>>> Where might I find gpsd.service?  That's not a file I am familiar with
>>> at all, but I'd like to check it.
>>
>> Not having gpsd installed, I looked at crond.service to check the
>> keynames in the [Service] section. There were copies in
>> /etc/systemd/system/* and /
>> usr/lib/systemd/system - if its not in either, try "locate
>> gpsd.service".
>>
>> For an explanation of the content of .service files, try
>>
>>     man 5 systemd.service
>>
>> which mainly covers the [Service] section of a .service file and
>> contains references to other manpages which cover the contents of the
>> [Unit] and [Install] sections as well as other material.
>>
>> One thing I should have asked earlier: what does "systemctl status
>> gpsd" show?
>>
>> The reason I ask is that by default systemd daemons are disabled when
>> they're first installed - under Fedora anyway. This means that although
>> you can start them with 'systemctl start servicename', they will not
>> start automatically at boot time until you've run "systemctl enable
>> servicename".
>>
>> This is no different from sysVinit, where you had to do exactly the
>> same using syscontrol whenever you installed a new daemon in order to
>> tell it which runlevels it should be active at.
> 
> Martin,
> 
> Thanks for all that!  I located the service file here:
> 
>    /lib/systemd/system/gpsd.service
> 
> It contains:
> 
> [Unit]
> Description=GPS (Global Positioning System) Daemon Requires=gpsd.socket
> 
> [Service]
> EnvironmentFile=-/etc/default/gpsd ExecStart=/usr/sbin/gpsd -N
> $GPSD_OPTIONS $DEVICES
> 
> [Install]
> Also=gpsd.socket
> 
> I don't see why that wouldn't start the service, but I really know very
> little at this level.
> 
> Again the issue is:
> 
> - reboot - gpsd service does/not/ start - run cgps and exit - gosd
> service is started
> 
> It's just as if the "-n" parameter is being ignored.

As I also asked, what does:

    systemctl status gpsd 

show? The second line of output should show something like:

Loaded: loaded (/usr/lib/systemd/system/gpsd.service; enabled; ...
                                                      =======

The word (underlined) following the pathname of the service file should 
be either 'enabled' or 'disabled'. IME the latter is the initial setting 
when you install a new package: not surprising really, since you usually 
don't want to run a daemon before you've configured it. Anyway, once its 
configured and tested using:

    systemctl start/stop/status gpsd 

commands and you're happy with what its doing, then you leave gpsd
running and execute:

    systemctl enable gpsd

to tell systemd that from now on this service/daemon should be started 
when the system is (re)booted. This applies to any and all daemons you 
want to have running all the time. Needless to say, if you no longer want 
the daemon to start automatically, prevent it being started on boot-up 
with: 

    systemctl disable gpsd


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

[toc] | [prev] | [standalone]


Back to top | Article view | comp.sys.raspberry-pi


csiph-web