[Touch-packages] [Bug 1706818] [NEW] mismatched file locking since 1:4.2.8p4+dfsg-3ubuntu1 causes race leaving ntp dead on reboot

2017-07-26 Thread Josh Littlefield
Public bug reported:

ntpdate and ntp conflict on the NTP well-known-socket. If ntp and
ntpdate 1:4.2.8p4+dfsg-3ubuntu5.5 are installed on Xenial, and there are
2 static interfaces configured, most often we find that ntpd is not
running after a reboot.

When the ntp service is started by systemd, ntp fails to bind the NTP
socket because ntpdate is running in the background. It's intended that
ntp and ntpdate try to avoid this conflict with a lock file, but the
locking mechanism was changed in ntpdate.if-up (from lockfile to flock),
but it was not changed in ntp.init. Previously the file locking
prevented ntp from trying to start when ntpdate was running. Not any
more.

Having multiple interfaces causes a much longer period of the socket
being unavailable, because the 2 ntpdate processes will get serialized
by the lock, while the ntp service is looking for a different lock, so
it just plows right in.  Attempts by netdate.if-up to stop and start ntp
seem to overlap and when the final start is invoked, systemd seems to
thing ntp is already running, though it has failed.

In 1:4.2.8p4+dfsg-3ubuntu1 the following change was made:
  debian/ntpdate.if-up: Drop lockfile mechanism as upstream is using flock now.
Looks like corresponds to rev 371 of debian/ntpdate.if-up from upstream.

This change diverged locking between ntpdate.if-up and ntp.init. This
was rectified in rev 451 of ntp.init, to use compatible locking, but
that doesn't appear in the Ubuntu version.


System Information:

 lsb_release -rd:
   Description:Ubuntu 16.04.2 LTS
   Release:16.04


 apt-cache policy ntpdate:

   ntpdate:
 Installed: 1:4.2.8p4+dfsg-3ubuntu5.5
 Candidate: 1:4.2.8p4+dfsg-3ubuntu5.5
 Version table:
*** 1:4.2.8p4+dfsg-3ubuntu5.5 100
   100 /var/lib/dpkg/status

 apt-cache policy ntp:

   ntp:
 Installed: 1:4.2.8p4+dfsg-3ubuntu5.5
 Candidate: 1:4.2.8p4+dfsg-3ubuntu5.5
 Version table:
*** 1:4.2.8p4+dfsg-3ubuntu5.5 100
   100 /var/lib/dpkg/status

** Affects: ntp (Ubuntu)
 Importance: Undecided
 Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to ntp in Ubuntu.
https://bugs.launchpad.net/bugs/1706818

Title:
  mismatched file locking since 1:4.2.8p4+dfsg-3ubuntu1 causes race
  leaving ntp dead on reboot

Status in ntp package in Ubuntu:
  New

Bug description:
  ntpdate and ntp conflict on the NTP well-known-socket. If ntp and
  ntpdate 1:4.2.8p4+dfsg-3ubuntu5.5 are installed on Xenial, and there
  are 2 static interfaces configured, most often we find that ntpd is
  not running after a reboot.

  When the ntp service is started by systemd, ntp fails to bind the NTP
  socket because ntpdate is running in the background. It's intended
  that ntp and ntpdate try to avoid this conflict with a lock file, but
  the locking mechanism was changed in ntpdate.if-up (from lockfile to
  flock), but it was not changed in ntp.init. Previously the file
  locking prevented ntp from trying to start when ntpdate was running.
  Not any more.

  Having multiple interfaces causes a much longer period of the socket
  being unavailable, because the 2 ntpdate processes will get serialized
  by the lock, while the ntp service is looking for a different lock, so
  it just plows right in.  Attempts by netdate.if-up to stop and start
  ntp seem to overlap and when the final start is invoked, systemd seems
  to thing ntp is already running, though it has failed.

  In 1:4.2.8p4+dfsg-3ubuntu1 the following change was made:
debian/ntpdate.if-up: Drop lockfile mechanism as upstream is using flock 
now.
  Looks like corresponds to rev 371 of debian/ntpdate.if-up from upstream.

  This change diverged locking between ntpdate.if-up and ntp.init. This
  was rectified in rev 451 of ntp.init, to use compatible locking, but
  that doesn't appear in the Ubuntu version.

  
  System Information:

   lsb_release -rd:
 Description:Ubuntu 16.04.2 LTS
 Release:16.04

  
   apt-cache policy ntpdate:

 ntpdate:
   Installed: 1:4.2.8p4+dfsg-3ubuntu5.5
   Candidate: 1:4.2.8p4+dfsg-3ubuntu5.5
   Version table:
  *** 1:4.2.8p4+dfsg-3ubuntu5.5 100
 100 /var/lib/dpkg/status

   apt-cache policy ntp:

 ntp:
   Installed: 1:4.2.8p4+dfsg-3ubuntu5.5
   Candidate: 1:4.2.8p4+dfsg-3ubuntu5.5
   Version table:
  *** 1:4.2.8p4+dfsg-3ubuntu5.5 100
 100 /var/lib/dpkg/status

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ntp/+bug/1706818/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp


[Touch-packages] [Bug 1639558] Re: message regarding ignoring 50unattended-upgrades.ucf-dist is annoying

2017-04-13 Thread Josh Littlefield
The patch works around the issue in apt, but isn't the underlying cause
the fact that /etc/apt/apt.conf.d/50unattended-upgrades was a confffile
in ~0.82.1ubuntu2.3, and is no longer a conffile in ~0.90ubuntu0.3, yet
the typical pattern for obsoleting a conffile wasn't performed? So even
an unchanged 50unattended-upgrades is seen as a conflict by the ucf
code, and thuse the .ufc-dist file is created, and the user is asked to
resolve a "conflict" in a file that wasn't changed.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to unattended-upgrades in
Ubuntu.
https://bugs.launchpad.net/bugs/1639558

Title:
  message regarding ignoring 50unattended-upgrades.ucf-dist is annoying

Status in apt package in Ubuntu:
  Fix Committed
Status in unattended-upgrades package in Ubuntu:
  Confirmed
Status in apt package in Debian:
  New

Bug description:
  Regression problem, (in the sense it didn't happen before the update
  although not directly from the code changes)

  Since update to 0.90ubuntu0.1 (ubuntu 16.04)  I am constantly now
  getting this notification performing anything with apt.

  N: Ignoring file '50unattended-upgrades.ucf-dist' in directory
  '/etc/apt/apt.conf.d/' as it has an invalid filename extension

  
  Secondly I am also now getting this, triggering apport bug report on every 
boot (program is not checking/creating a dir before trying to write to log in 
it)

  syslog.1:Nov  6 10:36:26 PortegeR830 apt.systemd.daily[815]:
  FileNotFoundError: [Errno 2] No such file or directory: '/var/log
  /unattended-upgrades/unattended-upgrades-dpkg.log'

  ProblemType: Bug
  DistroRelease: Ubuntu 16.04
  Package: unattended-upgrades 0.90ubuntu0.1
  ProcVersionSignature: Ubuntu 4.4.0-45.66-generic 4.4.21
  Uname: Linux 4.4.0-45-generic x86_64
  .var.log.unattended-upgrades.unattended-upgrades.log:
   2016-11-06 10:36:05,682 INFO Initial blacklisted packages: 
   2016-11-06 10:36:05,682 INFO Initial whitelisted packages: 
   2016-11-06 10:36:05,683 INFO Starting unattended upgrades script
   2016-11-06 10:36:05,683 INFO Allowed origins are: 
['o=Ubuntu,a=xenial-security', 'o=Ubuntu,a=xenial-updates', 
'o=Ubuntu,a=xenial-backports']
   2016-11-06 10:36:21,473 INFO Packages that will be upgraded:
  ApportVersion: 2.20.1-0ubuntu2.1
  Architecture: amd64
  CurrentDesktop: Unity
  Date: Sun Nov  6 10:59:28 2016
  PackageArchitecture: all
  SourcePackage: unattended-upgrades
  UpgradeStatus: No upgrade log present (probably fresh install)
  modified.conffile..etc.apt.apt.conf.d.10periodic:
   APT::Periodic::Update-Package-Lists "1";
   APT::Periodic::Download-Upgradeable-Packages "1";
   APT::Periodic::AutocleanInterval "7";
   APT::Periodic::Unattended-Upgrade "1";
  mtime.conffile..etc.apt.apt.conf.d.10periodic: 2015-05-30T16:31:54.137714
  mtime.conffile..etc.apt.apt.conf.d.50unattended-upgrades: 
2015-05-30T16:31:21.861600

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1639558/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp