FS#42318 - [squid] proxy user got not created during installation

Attached to Project: Community Packages
Opened by Reik Keutterling (Spielkind) - Thursday, 09 October 2014, 19:13 GMT
Last edited by Evangelos Foutras (foutrelis) - Wednesday, 22 October 2014, 00:08 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
Sébastien Luttringer (seblu)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:
proxy user is missing after installation of squid

Steps to reproduce:
#> pacman -S squid
resolving dependencies...
looking for inter-conflicts...

Packages (1): squid-3.4.8-1

Total Installed Size: 8.25 MiB

:: Proceed with installation? [Y/n]
(1/1) checking keys in keyring [##############################################################] 100%
(1/1) checking package integrity [##############################################################] 100%
(1/1) loading package files [##############################################################] 100%
(1/1) checking for file conflicts [##############################################################] 100%
(1/1) checking available disk space [##############################################################] 100%
(1/1) installing squid [##############################################################] 100%
error: command failed to execute correctly
#> id proxy
id: proxy: no such user
#> systemctl start squid.service
Job for squid.service failed. See 'systemctl status squid.service' and 'journalctl -xn' for details.
#> systemctl status squid.service
● squid.service - Web Proxy Cache Server
Loaded: loaded (/usr/lib/systemd/system/squid.service; disabled)
Active: failed (Result: exit-code) since Thu 2014-10-09 21:11:41 CEST; 4s ago
Process: 10960 ExecStart=/usr/bin/squid -sYC (code=exited, status=1/FAILURE)

Oct 09 21:11:41 xx systemd[1]: Starting Web Proxy Cache Server...
Oct 09 21:11:41 xx squid[10960]: getpwnam failed to find userid for effective user 'proxy'
Oct 09 21:11:41 xx squid[10960]: FATAL: getpwnam failed to find userid for effective user 'proxy'
Oct 09 21:11:41 xx squid[10960]: Squid Cache (Version 3.4.8): Terminated abnormally.
Oct 09 21:11:41 xx squid[10960]: CPU Usage: 0.009 seconds = 0.007 user + 0.002 sys
Oct 09 21:11:41 xx squid[10960]: Maximum Resident Size: 37232 KB
Oct 09 21:11:41 xx squid[10960]: Page faults with physical i/o: 0
Oct 09 21:11:41 xx systemd[1]: squid.service: control process exited, code=exited status=1
Oct 09 21:11:41 xx systemd[1]: Failed to start Web Proxy Cache Server.
Oct 09 21:11:41 x systemd[1]: Unit squid.service entered failed state.

This task depends upon

Closed by  Evangelos Foutras (foutrelis)
Wednesday, 22 October 2014, 00:08 GMT
Reason for closing:  Fixed
Additional comments about closing:  squid 3.4.8-2
Comment by Arno (ihad) - Friday, 10 October 2014, 13:54 GMT
Fix:
change /usr/lib/sysusers.d/squid.conf from
u proxy 15 "" /var/empty
to
u proxy 15 - /var/empty

execute systemd-sysusers squid.conf
Comment by Sergej Pupykin (sergej) - Friday, 10 October 2014, 15:08 GMT
Fixed in svn, but "id proxy" gives error anyway. Try to execute pwck, grpck and start squid again.
Comment by Arno (ihad) - Friday, 10 October 2014, 15:23 GMT
Strange...
After the change and
# systemd-sysusers squid.conf
as root, of course, the user proxy was created.
# id proxy
uid=15(proxy) gid=15(proxy) groups=15(proxy)

Didn't try a reinstall, though...
Comment by Evangelos Foutras (foutrelis) - Wednesday, 15 October 2014, 15:02 GMT
I just uploaded squid 3.4.8-2 with a few additional fixes (also making sure /var/{cache,log}/squid are owned by proxy:proxy).

The above package creates the proxy user/group during upgrade if it doesn't exist; new installations behave correctly as well.
Comment by Sébastien Luttringer (seblu) - Wednesday, 15 October 2014, 21:02 GMT
Why setting /var/*/squid behing owned by proxy:proxy in install file instead in the PKGBUILD, and let pacman handle that, with possible user override/acl additions?
Comment by Evangelos Foutras (foutrelis) - Wednesday, 15 October 2014, 21:32 GMT
I don't think there's anything wrong with the current method, but I guess you could create the directory in the PKGBUILD using the numeric uid/gid. Of course, you'd also need to conditionally run chown in the install script to handle upgrades from older releases.

IMO it's fine as-is; it has always been this way in the past too.
Comment by Sébastien Luttringer (seblu) - Wednesday, 15 October 2014, 22:23 GMT
Managing directory owner/rights outside of pacman (when it's possible to do it inside) is something wrong.
Doing this unconditionally, has also the drawback of reseting user/group to a value which could be changed by the user to give different access to these files. Pacman doesn't overwrite ownership/rights change in that purpose.

Ya, no big deal, that worked in the past, but it's cleaner to put ownership in pacman and only create users when package is setup. post_upgrade should only handle my broken past packages.
While we are around this package, better is to improve it as much as possible.

Loading...