#973883 [apt-cacher-ng] bad exit code (=0) instead (<>0) if Check permissions of /var/log/apt-cacher-ng #973883
- Package:
- apt-cacher-ng
- Source:
- apt-cacher-ng
- Description:
- caching proxy server for software repositories
- Submitter:
- Jean-Marc LACROIX
- Date:
- 2023-03-25 15:33:02 UTC
- Severity:
- normal
Dear maintainers,
It seems there is one bad exit code issue (=0) when trying to start
démon if internal check is bad. (/etc/init.d/apt-cacher-ng start)
ansible@srv-apt-cache-400:~$ dpkg -l |grep apt-cache
ii apt-cacher-ng 3.2.1-1 amd64
caching proxy server for software repositories
ansible@srv-apt-cache-400:~$ uname -a
Linux srv-apt-cache-400 4.19.0-12-amd64 #1 SMP Debian 4.19.152-1
(2020-10-18) x86_64 GNU/Linux
ansible@srv-apt-cache-400:~$ cat /etc/debian_version
10.6
ansible@srv-apt-cache-400:~$ pstree -anp
init,1
|-sshd,682
| |-sshd,717
| | `-sshd,719
| `-sshd,11014
| `-sshd,11016
| `-bash,11017
| `-pstree,11964 -anp
|-getty,696 38400 tty2
|-getty,697 38400 tty3
|-getty,698 38400 tty4
|-monit,7389 -c /etc/monit/monitrc
| |-{monit},7390
| |-{monit},7913
| `-(bash,11655)
|-syslog-ng,9901
| `-syslog-ng,9902 -p /var/run/syslog-ng.pid --no-caps
`-cron,17286
ansible@srv-apt-cache-400:~$ sudo /etc/init.d/apt-cacher-ng start
[....] Starting apt-cacher-ng: apt-cacher-ngProblem creating log files.
Check permissions of the log directory, //var/log/apt-cacher-ng
failed!
ansible@srv-apt-cache-400:~$ echo $?
0
ansible@srv-apt-cache-400:~$
And, of course, this is true, because ...
ansible@srv-apt-cache-400:~$ sudo ls -altr /var/log/apt-cacher-ng
total 2
drwx------ 2 root root 1024 Nov 6 14:34 .
drwxr-xr-x 8 root root 1024 Nov 6 14:52 ..
Thanks in advance to correct this issue. In my use case, because i am
using Ansible to make deployment, it is then not possible to detect this
bug (because exit code = 0) in one automatic way
Best regards
Hallo, * Jean-Marc LACROIX [Fri, Nov 06 2020, 03:46:53PM]: Yes. Yes. So you have not installed it properly. Because you have some custom way of adding the filesystem components. This does not justify the grave severity. So am I not sure what exactly you want to see fixed. Shall it start and go to degraded mode in this situation, rejecting all operations? Shall it start but run all downloads in pass-through mode (therefore hiding the problem, actually). Best regards, Eduard.
I see the same issue about invalid permissions of /var/log/apt-cacher-ng when installing the latest package on bookworm. I installed it multiple times on this VM before without this issue, not sure why it started to fail in this way now. Somehow the /var/log/apt-cacher-ng directory has owner = "root", no manual intervention was done as far as I am aware. When apt-cacher-ng package is installed it fails with the error about permission on /var/log/apt-cacher-ng folder. Could it be some sort of regression via some other package which adjusts permission of files in /var/log? apt-cacher-ng does not seem to have had any release lately so no regression there. Could either the installation of the package perform a check and fix or the systemd service could adjust access rights during startup to make apt-cacher-ng more robust against such invalid permissions?