Bug 1609197

Summary: apt-cacher-ng service is running in wrong permissions
Product: [Fedora] Fedora Reporter: Sander Lepik <sander>
Component: apt-cacher-ngAssignee: Kenjiro Nakayama <knakayam>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: knakayam
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: apt-cacher-ng-3.1-4.fc27 apt-cacher-ng-3.1-4.fc28 apt-cacher-ng-3.1-4.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-08-14 18:47:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sander Lepik 2018-07-27 09:13:48 UTC
Description of problem:
In the spec file I can see that folders and files are created in apt-cacher-ng:
permissions. Logrotate also expects files to be owned by apt-cacher-ng but the service itself runs as root and creates all files as root (logs/cached files).

I think what it really needs is User=apt-cacher-ng under [Service] section in systemd's service file. I had to chown already created files but after that it seems to work and now lograte has also access to manage the log files.

Version-Release number of selected component (if applicable):
3-1

Comment 1 Fedora Update System 2018-07-29 03:03:59 UTC
apt-cacher-ng-3.1-4.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-b102ccf86b

Comment 2 Fedora Update System 2018-07-29 03:13:39 UTC
apt-cacher-ng-3.1-4.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-bebcc57931

Comment 3 Kenjiro Nakayama 2018-07-29 03:21:30 UTC
Verified:

  $ ps aux |grep apt-cacher-n[g]
  apt-cac+ 22141  0.0  0.0 581680  5140 ?        Ssl  11:00   0:01 /usr/sbin/apt-cacher-ng -c /etc/apt-cacher-ng pidfile=/var/run/apt-cacher-ng/pid SocketPath=/var/run/apt-cacher-ng/socket foreground=0
   
  $ sudo ls -alh /var/log/apt-cacher-ng/
  total 16K
  drwx------.  2 apt-cacher-ng apt-cacher-ng 4.0K Jul 29 10:41 .
  drwxr-xr-x. 20 root          root          4.0K Jul 29 10:40 ..
  -rw-r--r--.  1 apt-cacher-ng apt-cacher-ng    0 Jul 29 10:41 apt-cacher.err
  -rw-r--r--.  1 apt-cacher-ng apt-cacher-ng 7.2K Jul 29 11:12 apt-cacher.log

Also, general features are working fine.

Comment 4 Fedora Update System 2018-07-29 03:22:04 UTC
apt-cacher-ng-3.1-4.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-a36c012110

Comment 5 Fedora Update System 2018-07-29 23:51:08 UTC
apt-cacher-ng-3.1-4.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-bebcc57931

Comment 6 Fedora Update System 2018-07-29 23:59:25 UTC
apt-cacher-ng-3.1-4.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-a36c012110

Comment 7 Fedora Update System 2018-07-30 01:26:50 UTC
apt-cacher-ng-3.1-4.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-b102ccf86b

Comment 8 Fedora Update System 2018-08-07 00:11:57 UTC
apt-cacher-ng-3.1-4.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 9 Kenjiro Nakayama 2018-08-07 00:20:22 UTC
Re-opened. FC27 and FC28 fixed this issue, but EPEL7 still needs 1 more week till the fixed package was pushed. (This is just EPEL policy, not testing failure.) I will close this ticket once EPEL package was pushed.

Comment 10 Fedora Update System 2018-08-07 01:15:47 UTC
apt-cacher-ng-3.1-4.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 11 Jan Kurik 2018-08-14 11:22:07 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 12 Fedora Update System 2018-08-14 18:47:07 UTC
apt-cacher-ng-3.1-4.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.