Install fails when 'ntp' user already exists

Bug #1783175 reported by Paul Dickey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ntp (Ubuntu)
Won't Fix
Undecided
Unassigned
Trusty
Confirmed
Wishlist
Unassigned

Bug Description

I work in an enterprise environment where usernames are decided centrally. A user has been given the user name 'ntp'. I need to be able to tell the ntp package to use a different username, but the install script assumes that the ntp:ntp user/group is available and valid.

At a minimum, this code needs to accept a configured username variable instead of hard-coding ntp.

if [ "$1" = "configure" ]; then
        addgroup --system --quiet ntp
        adduser --system --quiet --ingroup ntp --no-create-home ntp
        chown -R ntp:ntp /var/lib/ntp /var/log/ntpstats
fi

Additional requested information:

1) The release of Ubuntu you are using, via 'lsb_release -rd' or System -> About Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04

2) The version of the package you are using, via 'apt-cache policy pkgname' or by checking in Software Center
apt-cache policy ntp
ntp:
  Installed: 1:4.2.6.p5+dfsg-3ubuntu2.14.04.13
  Candidate: 1:4.2.6.p5+dfsg-3ubuntu2.14.04.13
  Version table:
 *** 1:4.2.6.p5+dfsg-3ubuntu2.14.04.13 0
        500 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
        100 /var/lib/dpkg/status
     1:4.2.6.p5+dfsg-3ubuntu2 0
        500 http://us.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

3) What you expected to happen
I expected the package to install

4) What happened instead
Installation fails because the user 'ntp' already exists.

Setting up ntp (1:4.2.6.p5+dfsg-3ubuntu2.14.04.13) ...
adduser: The user `ntp' already exists. Exiting.
dpkg: error processing package ntp (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 ntp
E: Sub-process /usr/bin/dpkg returned an error code (1)

Tags: trusty
tags: added: trusty
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Hi,
packages have a set of defined usernames that are collision free among each other but as you encountered might collide with other things - especially if a username is rather short.
Commonly package names (ntp, mysql, ceph, ...) or package name plus suffix (libvirt-*, ...), are users used by the system.

While I agree that there could be added some code to support that, it is most likely error prone and unlikely to happen (quite some effort for very low gain).
That is especially true for ntp which is (in later releases) no more in main and a change like that would not be SRUable to older releases.

I'll set this to won't fix as I want to avoid people expecting this to happen.

Changed in ntp (Ubuntu):
status: New → Won't Fix
Changed in ntp (Ubuntu Trusty):
status: New → Confirmed
importance: Undecided → Wishlist
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.