Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.sys.raspberry-pi > #10989
| From | Martin Gregorie <martin@address-in-sig.invalid> |
|---|---|
| Newsgroups | comp.sys.raspberry-pi |
| Subject | Re: GPSD not starting automatically |
| Date | 2016-03-04 17:32 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <nbcgr4$5ds$1@dont-email.me> (permalink) |
| References | <nb6huq$lj2$1@dont-email.me> <nb6mjp$1mi$1@dont-email.me> <nb6upj$5v4$1@dont-email.me> <nb75eu$q20$1@dont-email.me> <nbce7s$12m$1@dont-email.me> |
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 |
Back to comp.sys.raspberry-pi | Previous | Next — Previous in thread | Find similar | Unroll thread
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
csiph-web