Package OpenNTPd does not install

Bug #782116 reported by Lars Noodén
38
This bug affects 8 people
Affects Status Importance Assigned to Milestone
openntpd (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: openntpd

Bug #548602 says to open a new report if there are any issues.

OpenNTPd does not install using apt-get, it instead gives an error message and the installation fails:

 Setting up openntpd (3.9p1+debian-8) ...
 Starting openntpd: /etc/openntpd/ntpd.conf: Permission denied
 invoke-rc.d: initscript openntpd, action "start" failed.
 dpkg: error processing openntpd (--configure):
  subprocess installed post-installation script returned error exit status 1
 Errors were encountered while processing:
  openntpd
 E: Sub-process /usr/bin/dpkg returned an error code (1)

$ apt-cache policy openntpd
openntpd:
  Installed: 3.9p1+debian-8
  Candidate: 3.9p1+debian-8
  Version table:
 *** 3.9p1+debian-8 0
        500 http://fi.archive.ubuntu.com/ubuntu/ natty/universe amd64 Packages
        100 /var/lib/dpkg/status

Revision history for this message
Lars Noodén (larsnooden) wrote :

It appears to install and run correctly in 11.10 Oneiric

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in openntpd (Ubuntu):
status: New → Confirmed
Revision history for this message
Lars Noodén (larsnooden) wrote :

The problem seems to have gone away for Ubuntu 11.10

Revision history for this message
Miika Turkia (miika-turkia) wrote :

I am/was experiencing this problem on Ubuntu 11.10. A bit of tuning for apparmor's confiugration solved the problem for me. Editing /etc/apparmor.d/usr.sbin.ntpd and running 'sudo dpkg-reconfigure apparmor' did the trick. I added the following two lines for the /usr/sbin/ntpd:
  /etc/openntpd/ntpd.conf r,
  /{,var/}run/openntpd.pid w,

The trouble was that the apparmor prevented ntpd from reading the configuration file and then prevented writing of the pid file...

Revision history for this message
Alexander (lxandr) wrote :

problem also exists in 12.04

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu precise (development branch)
Release: 12.04
Codename: precise

# apt-cache policy apparmor openntpd
apparmor:
  Установлен: 2.7.102-0ubuntu1
  Кандидат: 2.7.102-0ubuntu3
  Таблица версий:
     2.7.102-0ubuntu3 0
        500 http://ua.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
 *** 2.7.102-0ubuntu1 0
        100 /var/lib/dpkg/status
openntpd:
  Установлен: 3.9p1+debian-9
  Кандидат: 3.9p1+debian-9
  Таблица версий:
 *** 3.9p1+debian-9 0
        500 http://ua.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
        100 /var/lib/dpkg/status

Revision history for this message
Alexander (lxandr) wrote :

BTW, Miika's method doesn't do the trick. Now I have this:

Настраивается пакет openntpd (3.9p1+debian-9) ...
Starting openntpd: /usr/sbin/ntpd: error while loading shared libraries: libcrypto.so.1.0.0: cannot open shared object file: No such file or directory
invoke-rc.d: initscript openntpd, action "start" failed.
dpkg: не удалось обработать параметр openntpd (--configure):
 подпроцесс установлен сценарий post-installation возвратил код ошибки 127
Отчёты apport не записаны, так достигнут MaxReports
                                                   При обработке следующих пакетов произошли ошибки:
 openntpd
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Настраивается пакет openntpd (3.9p1+debian-9) ...
Starting openntpd: /usr/sbin/ntpd: error while loading shared libraries: libcrypto.so.1.0.0: cannot open shared object file: No such file or directory
invoke-rc.d: initscript openntpd, action "start" failed.
dpkg: не удалось обработать параметр openntpd (--configure):
 подпроцесс установлен сценарий post-installation возвратил код ошибки 127
При обработке следующих пакетов произошли ошибки:
 openntpd
Press return to continue.

Looks like that adding some more rules to apparmor needed.

Revision history for this message
Peter Matulis (petermatulis) wrote :

Workaround in comment #4 worked for me this evening on 12.04 (beta-2).

Revision history for this message
Paul Boven (p-boven) wrote :

Bug still exists in Raring (13.04)

Revision history for this message
Lars Noodén (larsnooden) wrote :

Bug still existis in Saucy alpha

Revision history for this message
Mrten (bugzilla-ii) wrote :

This isn't really a bug in the openntpd package, it's a result of the fact that the 'ntp' package and the 'openntpd' package use the same filename for the daemon. I'm willing to bet that each and every one of you here first had 'ntp' installed and then upgraded to 'openntpd'.

'ntp' leaved an apparmor profile behind, and that isn't tuned for openntpd.

So the solution here is to first (!) run 'apparmor_parser -R /etc/apparmor.d/usr.sbin.ntpd' and then 'apt-get purge ntp'.

If you try to do it the other way around the usr.sbin.ntpd profile is gone and you have to place a dummy profile in its place, apparmor_parser -R needs a file, even if it's almost emtpy.

A file with

/usr/sbin/ntpd {
}

in it will do.

Revision history for this message
Paweł Hikiert (nsilent22) wrote :

Mrten is right. Uninstallation of ntp leaves its apparmor profile config file. You have to purge it, and then openntpd installs cleanly.

Revision history for this message
Ulises Vitulli (dererk-debian-org) wrote :

This is due to unclean installation from ntp package, not openntpd. Closing this as invalid.

Changed in openntpd (Ubuntu):
status: Confirmed → Invalid
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.