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


Groups > linux.debian.user > #159706 > unrolled thread

systemd gpsd does not start on boot

Started byPhilippe Clérié <philippe@gcal.net>
First post2015-10-24 00:00 +0200
Last post2015-10-28 00:30 +0100
Articles 6 — 2 participants

Back to article view | Back to linux.debian.user


Contents

  systemd gpsd does not start on boot Philippe Clérié <philippe@gcal.net> - 2015-10-24 00:00 +0200
    Re: systemd gpsd does not start on boot Philippe Clérié <philippe@gcal.net> - 2015-10-25 13:20 +0100
      Re: systemd gpsd does not start on boot Michael Biebl <biebl@debian.org> - 2015-10-25 19:10 +0100
        Re: systemd gpsd does not start on boot Philippe Clérié <philippe@gcal.net> - 2015-10-26 17:40 +0100
          Re: systemd gpsd does not start on boot Michael Biebl <biebl@debian.org> - 2015-10-26 18:30 +0100
            Re: systemd gpsd does not start on boot Philippe Clérié <philippe@gcal.net> - 2015-10-28 00:30 +0100

#159706 — systemd gpsd does not start on boot

FromPhilippe Clérié <philippe@gcal.net>
Date2015-10-24 00:00 +0200
Subjectsystemd gpsd does not start on boot
Message-ID<qmSxr-5Cp-1@gated-at.bofh.it>
I'm running raspbian jessy on a rpi2 with an Adafruit GPS board. Gpsd 
refuses to load on boot, but works just fine on manual start.

I am not yet familiar with systemd. Even if I've had to dig a bit to try 
to understand how it works I'm still stumped at the moment, so I don't 
know if there's a bug or I am doing something wrong.

There are 3 systemd units related to gpsd in /lib/systemd/system.

gpsd.service
gpsd.socket
gpsdctl@.service

My (weak) understanding is that systemd will start .socket which in turn 
will launch .service. That does not seem to be happening.

Suggestions would be greatly appreciated.

Thanks

-- 
Philippe

------
The trouble with common sense it that it is so uncommon.
<Anonymous>

[toc] | [next] | [standalone]


#159757

FromPhilippe Clérié <philippe@gcal.net>
Date2015-10-25 13:20 +0100
Message-ID<qnsrf-2T6-7@gated-at.bofh.it>
In reply to#159706
On 10/23/2015 05:33 PM, Philippe Clérié wrote:
> I'm running raspbian jessy on a rpi2 with an Adafruit GPS board. Gpsd
> refuses to load on boot, but works just fine on manual start.
>
> I am not yet familiar with systemd. Even if I've had to dig a bit to try
> to understand how it works I'm still stumped at the moment, so I don't
> know if there's a bug or I am doing something wrong.
>
> There are 3 systemd units related to gpsd in /lib/systemd/system.
>
> gpsd.service
> gpsd.socket
> gpsdctl@.service
>
> My (weak) understanding is that systemd will start .socket which in turn
> will launch .service. That does not seem to be happening.
>
> Suggestions would be greatly appreciated.
>
> Thanks
>

For what it's worth:

Edit /lib/systemd/system/gpsd.service:

[Install]
+ WantedBy=multi-user.target
Also=gpsd.socket

Then:

sudo systemctl enable gpsd.service
sudo reboot

And gpsd gets loaded.

I don't know if it is the correct fix but that seems to work.

-- 
Philippe

------
The trouble with common sense it that it is so uncommon.
<Anonymous>

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


#159773

FromMichael Biebl <biebl@debian.org>
Date2015-10-25 19:10 +0100
Message-ID<qnxTX-6g0-9@gated-at.bofh.it>
In reply to#159757

[Multipart message — attachments visible in raw view] — view raw

Am 25.10.2015 um 12:59 schrieb Philippe Clérié:
> On 10/23/2015 05:33 PM, Philippe Clérié wrote:
>> I'm running raspbian jessy on a rpi2 with an Adafruit GPS board. Gpsd
>> refuses to load on boot, but works just fine on manual start.
>>
>> I am not yet familiar with systemd. Even if I've had to dig a bit to try
>> to understand how it works I'm still stumped at the moment, so I don't
>> know if there's a bug or I am doing something wrong.
>>
>> There are 3 systemd units related to gpsd in /lib/systemd/system.
>>
>> gpsd.service
>> gpsd.socket
>> gpsdctl@.service
>>
>> My (weak) understanding is that systemd will start .socket which in turn
>> will launch .service. That does not seem to be happening.

Well, was there actually a request over the socket /var/run/gpsd.sock
which would trigger the start of the service?

If there is no such request from a client, the service will not be
started. The maintainer of gpsd apparently has setup gpsd so it is
started on-demand and apparently there is no demand from a client.


> For what it's worth:
> 
> Edit /lib/systemd/system/gpsd.service:
> 
> [Install]
> + WantedBy=multi-user.target
> Also=gpsd.socket
> 
> Then:
> 
> sudo systemctl enable gpsd.service
> sudo reboot
> 
> And gpsd gets loaded.
> 
> I don't know if it is the correct fix but that seems to work.
> 


Editing files in /lib/systemd/system/gpsd.service is not a good idea,
since they will be overwritten on the next package update.

It's better to make a copy of that file as
/etc/systemd/system/gpsd.service and make your changes there, or simply
extend the service file with the desired changes using a drop-in snippet:

mkdir /etc/systemd/system/gpsd.service.d/
echo -e "[Install]\nWantedBy=multi-user.target" >
/etc/systemd/system/gpsd.service.d/local.conf

You can pick the names of that conf file as you like.

systemd in testing/unstable has a nice shortcut here:
Try systemctl edit foo.service (creates a drop-in in /etc)
or systemctl edit --full foo.service (creates a full copy in /etc)


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

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


#159810

FromPhilippe Clérié <philippe@gcal.net>
Date2015-10-26 17:40 +0100
Message-ID<qnSYr-26p-23@gated-at.bofh.it>
In reply to#159773
On 10/25/2015 01:52 PM, Michael Biebl wrote:
> Am 25.10.2015 um 12:59 schrieb Philippe Clérié:
>> On 10/23/2015 05:33 PM, Philippe Clérié wrote:
>>> I'm running raspbian jessy on a rpi2 with an Adafruit GPS board. Gpsd
>>> refuses to load on boot, but works just fine on manual start.
>>>
>>> I am not yet familiar with systemd. Even if I've had to dig a bit to try
>>> to understand how it works I'm still stumped at the moment, so I don't
>>> know if there's a bug or I am doing something wrong.
>>>
>>> There are 3 systemd units related to gpsd in /lib/systemd/system.
>>>
>>> gpsd.service
>>> gpsd.socket
>>> gpsdctl@.service
>>>
>>> My (weak) understanding is that systemd will start .socket which in turn
>>> will launch .service. That does not seem to be happening.
>
> Well, was there actually a request over the socket /var/run/gpsd.sock
> which would trigger the start of the service?
>
> If there is no such request from a client, the service will not be
> started. The maintainer of gpsd apparently has setup gpsd so it is
> started on-demand and apparently there is no demand from a client.
>

Looks like he did half the job then. I'm pretty sure my ntp daemon works 
over /run/gpsd.sock. I'm also pretty sure nothing queries gpsd over the 
local tcp socket on port 2947.

>
>> For what it's worth:
>>
>> Edit /lib/systemd/system/gpsd.service:
>>
>> [Install]
>> + WantedBy=multi-user.target
>> Also=gpsd.socket
>>
>> Then:
>>
>> sudo systemctl enable gpsd.service
>> sudo reboot
>>
>> And gpsd gets loaded.
>>
>> I don't know if it is the correct fix but that seems to work.
>>
>
>
> Editing files in /lib/systemd/system/gpsd.service is not a good idea,
> since they will be overwritten on the next package update.
>
> It's better to make a copy of that file as
> /etc/systemd/system/gpsd.service and make your changes there, or simply
> extend the service file with the desired changes using a drop-in snippet:
>
> mkdir /etc/systemd/system/gpsd.service.d/
> echo -e "[Install]\nWantedBy=multi-user.target" >
> /etc/systemd/system/gpsd.service.d/local.conf
>
> You can pick the names of that conf file as you like.
>

Just read something about that. I had planned on looking into it 
sometime this week. Thanks for the tip.


> systemd in testing/unstable has a nice shortcut here:
> Try systemctl edit foo.service (creates a drop-in in /etc)
> or systemctl edit --full foo.service (creates a full copy in /etc)
>
>


-- 
Philippe

------
The trouble with common sense it that it is so uncommon.
<Anonymous>

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


#159815

FromMichael Biebl <biebl@debian.org>
Date2015-10-26 18:30 +0100
Message-ID<qnTKO-2CZ-19@gated-at.bofh.it>
In reply to#159810

[Multipart message — attachments visible in raw view] — view raw

Am 26.10.2015 um 17:13 schrieb Philippe Clérié:
> On 10/25/2015 01:52 PM, Michael Biebl wrote:
>> Am 25.10.2015 um 12:59 schrieb Philippe Clérié:
>>> On 10/23/2015 05:33 PM, Philippe Clérié wrote:
>>>> I'm running raspbian jessy on a rpi2 with an Adafruit GPS board. Gpsd
>>>> refuses to load on boot, but works just fine on manual start.
>>>>
>>>> I am not yet familiar with systemd. Even if I've had to dig a bit to
>>>> try
>>>> to understand how it works I'm still stumped at the moment, so I don't
>>>> know if there's a bug or I am doing something wrong.
>>>>
>>>> There are 3 systemd units related to gpsd in /lib/systemd/system.
>>>>
>>>> gpsd.service
>>>> gpsd.socket
>>>> gpsdctl@.service
>>>>
>>>> My (weak) understanding is that systemd will start .socket which in
>>>> turn
>>>> will launch .service. That does not seem to be happening.
>>
>> Well, was there actually a request over the socket /var/run/gpsd.sock
>> which would trigger the start of the service?
>>
>> If there is no such request from a client, the service will not be
>> started. The maintainer of gpsd apparently has setup gpsd so it is
>> started on-demand and apparently there is no demand from a client.
>>
> 
> Looks like he did half the job then. I'm pretty sure my ntp daemon works
> over /run/gpsd.sock. I'm also pretty sure nothing queries gpsd over the
> local tcp socket on port 2947.

/var/run should be a symlink to /run. Please check that, if not, then
something is wrong.
How das ntp + gpsd work? Does your ntp daemon accesses actually access
/run/gpsd.sock? If so it should trigger the start of gpsd.service.

Also, whenever udev finds GPS hardware, it should trigger
gpsdctl@.service. See /lib/udev/rules.d/60-gpsd.rules.
Do you have such a gpsdctl@<device>.service instance running?

The gpsdctl@.service instance in turn will run
gpsdctl add /dev/<device>. gpsdctl talks to gpsd over
/var/run/gpsd.socket, so will trigger the start of gpsd.service

If not, maybe the udev rules file does not list your hardware and that's
the root cause for this issue

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

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


#159877

FromPhilippe Clérié <philippe@gcal.net>
Date2015-10-28 00:30 +0100
Message-ID<qolQK-37m-11@gated-at.bofh.it>
In reply to#159815
On 10/26/2015 01:09 PM, Michael Biebl wrote:
> Am 26.10.2015 um 17:13 schrieb Philippe Clérié:
>> On 10/25/2015 01:52 PM, Michael Biebl wrote:
>>> Am 25.10.2015 um 12:59 schrieb Philippe Clérié:
>>>> On 10/23/2015 05:33 PM, Philippe Clérié wrote:
>>>>> I'm running raspbian jessy on a rpi2 with an Adafruit GPS board. Gpsd
>>>>> refuses to load on boot, but works just fine on manual start.
>>>>>
>>>>> I am not yet familiar with systemd. Even if I've had to dig a bit to
>>>>> try
>>>>> to understand how it works I'm still stumped at the moment, so I don't
>>>>> know if there's a bug or I am doing something wrong.
>>>>>
>>>>> There are 3 systemd units related to gpsd in /lib/systemd/system.
>>>>>
>>>>> gpsd.service
>>>>> gpsd.socket
>>>>> gpsdctl@.service
>>>>>
>>>>> My (weak) understanding is that systemd will start .socket which in
>>>>> turn
>>>>> will launch .service. That does not seem to be happening.
>>>
>>> Well, was there actually a request over the socket /var/run/gpsd.sock
>>> which would trigger the start of the service?
>>>
>>> If there is no such request from a client, the service will not be
>>> started. The maintainer of gpsd apparently has setup gpsd so it is
>>> started on-demand and apparently there is no demand from a client.
>>>
>>
>> Looks like he did half the job then. I'm pretty sure my ntp daemon works
>> over /run/gpsd.sock. I'm also pretty sure nothing queries gpsd over the
>> local tcp socket on port 2947.
>
> /var/run should be a symlink to /run. Please check that, if not, then
> something is wrong.
> How das ntp + gpsd work? Does your ntp daemon accesses actually access
> /run/gpsd.sock? If so it should trigger the start of gpsd.service.
>
> Also, whenever udev finds GPS hardware, it should trigger
> gpsdctl@.service. See /lib/udev/rules.d/60-gpsd.rules.
> Do you have such a gpsdctl@<device>.service instance running?
>
> The gpsdctl@.service instance in turn will run
> gpsdctl add /dev/<device>. gpsdctl talks to gpsd over
> /var/run/gpsd.socket, so will trigger the start of gpsd.service
>
> If not, maybe the udev rules file does not list your hardware and that's
> the root cause for this issue
>

So this may not be so simple after all. Please remember I am not up to 
speed with systemd so it's not all that clear to me how it works. So, 
other than confirming the existence of gpsdctl@.service I've no idea 
whether it works or gets called or whatever. I guess I'll have to be 
more proactive about learning systemd.

Anyway, I did some googling and you may have a point about that 
on-demand starting of gpsd, and I thank for bringing it up. More stuff 
to research.

Unfortunately, I am traveling tomorrow and I'll be out a couple of 
weeks. I'll resume work on this upon return. I'll bring up any issues I 
come up with then.

Thanks for the help.

-- 
Philippe

------
The trouble with common sense it that it is so uncommon.
<Anonymous>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web