Install fails when 'ntp' user already exists
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.
Candidate: 1:4.2.6.
Version table:
*** 1:4.2.6.
500 http://
500 http://
100 /var/lib/
1:
500 http://
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.
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: | added: trusty |
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.