Bug 1738884 - Apt-cacher-ng is not creating runtimedir so, it fails to start
Summary: Apt-cacher-ng is not creating runtimedir so, it fails to start
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: apt-cacher-ng
Version: epel7
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: Kenjiro Nakayama
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2019-08-08 11:00 UTC by nwildner
Modified: 2023-01-25 00:49 UTC (History)
2 users (show)

Fixed In Version: apt-cacher-ng-3.7.4-2.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2023-01-25 00:49:15 UTC
Type: Bug

Attachments (Terms of Use)

Description nwildner 2019-08-08 11:00:09 UTC
Description of problem:

Hi. The apt-cacher-ng package needs (/var/)/run/apt-cacher-ng to be set before running. As it fails, the service will not start.

Also, /etc/apt-cacher-ng/acng.conf seems to be a dummy file for pid/socket related configs since a lot of parameters are set by the service unit file and, if you change locations here, they will be completly ignored and set to /var/run/apt-cacher-ng/

Thats why the unit file needs to be fixed :)

Version-Release number of selected component (if applicable):
Latest one: apt-cacher-ng-3.1-4.el7.x86_64 on a CentOS7

Steps to Reproduce:
1. Install apt-cacher-ng and keep default settings
2. Try to start the service with systemctl start apt-cacher-ng

Actual results:
Service fails with journalctl output:

Aug 08 07:34:48 puppet.example.net apt-cacher-ng[31948]: Error creating Unix Domain Socket, /var/run/apt-cacher-ng/socket
Aug 08 07:34:48 puppet.example.net apt-cacher-ng[31948]: Check socket file and directory permissions
Aug 08 07:34:48 puppet.example.net systemd[1]: apt-cacher-ng.service: control process exited, code=exited status=1
Aug 08 07:34:48 puppet.example.net systemd[1]: Failed to start The apt-cacher-ng proxy server.
-- Subject: Unit apt-cacher-ng.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit apt-cacher-ng.service has failed.

Expected results:

To start apt-cacher-ng

Additional info:

Creating a custom systemd service unit and adding RuntimeDirectory= solved the issue. Maybe you should upstream this change since it seems to be pretty simple.

[root@puppet ~]# cp /usr/lib/systemd/system/apt-cacher-ng.service /etc/systemd/system/
[root@puppet ~]# vi /etc/systemd/system/apt-cacher-ng.service

Add RuntimeDirectory=apt-cacher-ng line after Type=forking line

[root@puppet ~]# systemctl status apt-cacher-ng
● apt-cacher-ng.service - The apt-cacher-ng proxy server
   Loaded: loaded (/etc/systemd/system/apt-cacher-ng.service; disabled; vendor preset: disabled)
   Active: inactive (dead)

[root@puppet ~]# systemctl start apt-cacher-ng
[root@puppet ~]# ps fax | grep apt-cacher
 1785 pts/0    S+     0:00                      \_ grep --color=auto apt-cacher
 1783 ?        Ss     0:00 /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

Comment 1 Alexandre Detiste 2022-12-24 00:02:32 UTC
The new upstream release ship a tmpfiles.d that fixes this issue:

Z /run/apt-cacher-ng 0755 apt-cacher-ng apt-cacher-ng - -
D /run/apt-cacher-ng 0755 apt-cacher-ng apt-cacher-ng - -

Comment 2 Fedora Update System 2023-01-15 21:40:59 UTC
FEDORA-EPEL-2023-2c493cf7a8 has been submitted as an update to Fedora EPEL 9. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2023-2c493cf7a8

Comment 3 Fedora Update System 2023-01-16 00:20:40 UTC
FEDORA-EPEL-2023-2c493cf7a8 has been pushed to the Fedora EPEL 9 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2023-2c493cf7a8

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Fedora Update System 2023-01-25 00:49:15 UTC
FEDORA-EPEL-2023-2c493cf7a8 has been pushed to the Fedora EPEL 9 stable repository.
If problem still persists, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.