pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: can't upgrade apache tomcat package, complains about tomcat user



* On 2014-08-15 at 22:20 BST, Eric Haszlakiewicz wrote:

> On 8/15/2014 3:01 PM, Jonathan Perkin wrote:
> >* On 2014-08-15 at 19:19 BST, Eric Haszlakiewicz wrote:
> >
> >>I get this error when trying to upgrade an installation of Apache Tomcat:
> >>
> >>installing apache-tomcat-6.0.41...
> >>===========================================================================
> >>The following users need to be created for apache-tomcat-6.0.41:
> >>
> >>         tomcat (uid = 1076): tomcat, /usr/pkg/share/tomcat, /bin/sh
> >>
> >>===========================================================================
> >>pkg_install warnings: 1, errors: 1
> >>pkg_install error log can be found in /var/db/pkgin/pkg_install-err.log
> >>
> >>but I already have a tomcat user, although with a different uid. Why is this
> >>complaining?
> >This is what this change fixes:
> >
> >   
> > https://github.com/joyent/pkgsrc/commit/dd0143bde586f20b991b42a25015b19f0dcae0b8
> >
> >but I think there was some objection to it, hence why I haven't
> >committed it yet (we use it for our SmartOS packages and set
> >PKGINSTALL_IGNORE_UIDGID=yes by default).
> 
> Ok, but why did it start caring what the uid is in the first place? I could
> have sworn I've done similar upgrades in the past (e.g. postfix, dovecot),
> but perhaps I just happened to end up with the same uid?

Whoever built that package gave it an explicit PKG_UID and PKG_GID
setting:

  $ pkg_info -i 
http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/i386/6.1.4/All/apache-tomcat-6.0.41.tgz
 | egrep '^# (USER|GROUP):'
  # GROUP: tomcat:1112
  # USER: tomcat:tomcat:1076::/usr/pkg/share/tomcat:/bin/sh

Unless you use the patch I pasted, this isn't recommended for packages
which are designed for public consumption, as you run into this exact
problem.

The dovecot package does not have hard-coded uid/gid:

  $ pkg_info -i 
http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/i386/6.1.4/All/dovecot-1.2.17nb13.tgz
 | egrep '^# (USER|GROUP):'
  # GROUP: dovecot
  # USER: dovecot:dovecot::Dovecot IMAP/POP3 user

so will correctly work regardless of whether there are existing
user/group entries.

Cheers,

-- 
Jonathan Perkin  -  Joyent, Inc.  -  www.joyent.com


Home | Main Index | Thread Index | Old Index