Package autofs does not include autofs.service file

Bug #1614248 reported by Maciej Puzio
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
autofs
Fix Released
Unknown
autofs (Ubuntu)
Fix Released
Undecided
Unassigned
Xenial
Won't Fix
Undecided
Unassigned

Bug Description

Package autofs in Ubuntu 16.04 includes SysV startup script (/etc/init.d/autofs) and Upstart unit (/etc/init/autofs.conf), but does not include systemd service file. As a result, systemd starts autofs as part of its LSB (sysv) processing, which makes it difficult to ensure that autofs is started after services that it requires for proper functioning. In particular, unit autogenerated by systemd-sysv-generator for autofs does not include dependency on sssd.service.

It appears that on the installation that I tested, systemd starts LSB services well after sssd is started, so the issue does not cause any visible problems, but this startup sequence is accidental. Given the number of other issues related to autofs startup in Xenial, requiring users to get their hands dirty just to have autofs run properly after boot, I think it would be advantageous to fix this simple oversight. (See bug 1566508, bug 1584818, bug 1588915)

I attach an example service file for autofs that fixes this problem. In addition to sssd.service, this unit could also list nslcd.service, slapd.service and ypbind.service/nis.service in its After= line. However, these service files are also missing from their respective packages, and I am not even sure how NIS client service file would be called.

$lsb_release -rd
Description: Ubuntu 16.04.1 LTS
Release: 16.04

$apt-cache policy autofs
autofs:
  Installed: 5.1.1-1ubuntu3
  Candidate: 5.1.1-1ubuntu3

Revision history for this message
Maciej Puzio (maciej-puzio) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in autofs (Ubuntu):
status: New → Confirmed
Revision history for this message
Andrei Shevchuk (shevchuk) wrote :

This could also help with bug #1438375 and issues like long shutdown with autofs mouns (https://bugs.archlinux.org/task/40200)

Revision history for this message
Andrei Shevchuk (shevchuk) wrote :

Forgot to mention: adding autofs.service Maciej Puzio created fixed both problems to me (suspending and long shutdown). Thanks, Maciej Puzio!

Revision history for this message
Maciej Puzio (maciej-puzio) wrote :

Andrei, I'm glad that you found my workaround useful. I did not experience problems that you describe (I did not test these issues on a laptop), but I agree that they are relevant to this bug. If you could subscribe to notifications about this bug, we would get more bug heat points, and hopefully this would draw someone's attention.

Revision history for this message
Nish Aravamudan (nacc) wrote :

Hello and thank you for filing this bug! This seems like something that probably should also be fixed in the Debian package, would you be willing to file a bug there?

Changed in autofs (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Maciej Puzio (maciej-puzio) wrote :

I do not use Debian, but please feel free to file a bug report with them. Regarding the autofs.service file attached above, please note that it would benefit from inclusion of additional services in the After= line (such as nslcd, slapd and NIS). The reason that I did not include them is that their respective packages also lack systemd service files, similarly to package autofs.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

FYI - Reported to Debian and linked debbug here.

Changed in autofs:
status: Unknown → New
Changed in autofs:
status: New → Fix Released
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Per Debian fix in 5.1.2-1
"AFAIKS, autofs is providing a .service now with an After=sssd"
This is in Ubuntu as of Zesty.

I'll mark the tasks accordingly.

Adding the service in Xenial in general might have too much risk to cause other regressions - not sure thou - I beg your pardon - this is just an area I rarely work on.
Is there a way to express this in the sysv that xenial has, maybe via [1].
I can envision a setup with autofs and no ssh, so it is not required, but maybe "should".
So maybe in header of /etc/init.d/autofs:
  Should-Start: ssh

I wonder how that carries over into the systemd generator used in Xenial.

Could one affected give it a try instead of adding the full .service file to add that and then run the following to pick up the changes
$ sudo systemctl daemon-reload

Changed in autofs (Ubuntu Xenial):
status: New → Confirmed
Changed in autofs (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Bryce Harrington (bryce) wrote :

[Xenial's standard support period has ended.]

Changed in autofs (Ubuntu Xenial):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.