Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • P pkg-gpsd
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • Debian GPS team
  • pkg-gpsd
  • Merge requests
  • !1

Fix 3.19 issues repored by ci

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Christian Ehrhardt requested to merge paelzer-guest/pkg-gpsd:fix-3.19-issues-repored-by-ci into master Jul 18, 2019
  • Overview 1
  • Commits 3
  • Pipelines 0
  • Changes 4

The following part of 5de17f0c "Allow gpsd.service to be enabled by the admin at boot time." went a bit over the top due to some lovely sysV/systemd interaction.

@@ -10,5 +10,4 @@ Debianize gpsd.service
 +ExecStart=/usr/sbin/gpsd $GPSD_OPTIONS $DEVICES
  
  [Install]
--WantedBy=multi-user.target
- Also=gpsd.socket
+ WantedBy=multi-user.target

Instead of "allow to start" this will make the service start for sure (on install). It will create a multi-user.target -> gpsd.service Want dependency. Which per systemd-unit means the service will start directly (instead of only via the socket activation). In theory that would work fine and it does for the purpose as outlined on the bug changing it.

But it broke the test which was meant to ensure that no unexpected change (often in systemd or dh) would break our service behavior.

This changed:

gpsd.service default state -> indirect -> disabled  (ok and intended)
gpsd.service after install -> inactive -> active (not ok)

On reboot things are fine, so it must be something in the postinst that will start it even if not intended. The obvious thing is the try-restart, but I checked it isn't that which activates it.

And it turns out it is my magic favorite issue of this kind mixed sysV and systemd scripts. This later section in postinst will start it:

# End automatically added section
# Automatically added by dh_installinit/12.1.1ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
        if [ -x "/etc/init.d/gpsd" ]; then
                update-rc.d gpsd defaults >/dev/null
                invoke-rc.d gpsd start || exit 1
        fi
fi
# End automatically added section

In particular "invoke-rc.d gpsd start" will map to systemd service and start it.

Getting rid of the sysV script would fix this - I had this discussion with so many maintainers now I don't remember all of them. Some are in for it and get issues resolved by dropping sysV. Other think they need to retain sysV for some arcane stone age rules and have to somehow live with it.

These days there now is an official way which worked in some cases (but not all of them). It is based on compat level 12 which had some changes in regard to this mixed sysV/systemd cases. It might help here as well, but I can't say for sure until we tried so. How about giving compat 12 a shot (won't hurt even if it doesn't fix this) and then retry this?

I checked the list and found a few things to change for newer compat/standards, but not a lot. This MP covers all that I have found in my first pass to improve the gpsd for the CI findings.

FYI: the test issue can be locally reproduced with $ autopkgtest --apt-upgrade --shell-fail gpsd_3.19-1.dsc -- lxd images:debian/sid/amd64

With that (and the proposed fixes) I had the sevrice check work again:

autopkgtest [14:21:54]: test check-service: [-----------------------
Check socket being active
gpsd.socket                            enabled        
ActiveState=active
Check service being inactive
gpsd.service                           disabled       
ActiveState=inactive
Trying ::1...
Connected to localhost.
Escape character is '^]'.
{"class":"VERSION","release":"3.19","rev":"3.19","proto_major":3,"proto_minor":14}
{"class":"DEVICES","devices":[]}
{"class":"WATCH","enable":true,"json":true,"nmea":false,"raw":0,"scaled":false,"timing":false,"split24":false,"pps":false}
{"class":"DEVICES","devices":[]}
{"class":"WATCH","enable":false,"json":true,"nmea":false,"raw":0,"scaled":false,"timing":false,"split24":false,"pps":false}
simplify test debug - full log
Trying ::1...
Connected to localhost.
Escape character is '^]'.
{"class":"VERSION","release":"3.19","rev":"3.19","proto_major":3,"proto_minor":14}
{"class":"DEVICES","devices":[]}
{"class":"WATCH","enable":true,"json":true,"nmea":false,"raw":0,"scaled":false,"timing":false,"split24":false,"pps":false}
{"class":"DEVICES","devices":[]}
{"class":"WATCH","enable":false,"json":true,"nmea":false,"raw":0,"scaled":false,"timing":false,"split24":false,"pps":false}
Check log for version
{"class":"VERSION","release":"3.19","rev":"3.19","proto_major":3,"proto_minor":14}
Check log for devices
{"class":"DEVICES","devices":[]}
{"class":"DEVICES","devices":[]}
Check log for enabled watch
{"class":"WATCH","enable":true,"json":true,"nmea":false,"raw":0,"scaled":false,"timing":false,"split24":false,"pps":false}
Check log for disabled watch
{"class":"WATCH","enable":false,"json":true,"nmea":false,"raw":0,"scaled":false,"timing":false,"split24":false,"pps":false}
Check service being active now
ActiveState=active
autopkgtest [14:22:26]: test check-service: -----------------------]
autopkgtest [14:22:27]: test check-service:  - - - - - - - - - - results - - - - - - - - - -
check-service        PASS
autopkgtest [14:22:27]: @@@@@@@@@@@@@@@@@@@@ summary
check-service        PASS

P.S: I was unable to locally get the lintian complaints about missing python dependencies to fix them - needs another look another day.

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: fix-3.19-issues-repored-by-ci