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
Status: NEW
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: 2019-08-08 11:00 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed:
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

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