Bug#890414: awstats: run-parts doesnt work with .sh files
Package: awstats
Version: 7.6+dfsg-2
Followup-For: Bug #890414
This is still an issue on Debian 10. Any update on when this will be fixed?
Steps to reproduce on a fresh install of Debian 10:
sudo su -
apt-get -y install nginx awstats
run-parts --list /etc/logrotate.d/httpd-prerotate
The below execution demonstrates the issue and a potential fix (moving /etc/logrotate.d/httpd-prerotate/awstats/prerotate.sh to /etc/logrotate.d/httpd-prerotate/awstats-prerotate)
```
user@disp9503:~$ sudo su -
root@disp9503:~# apt-get -y install nginx awstats
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libnet-xwhois-perl libnginx-mod-http-auth-pam libnginx-mod-http-dav-ext
libnginx-mod-http-echo libnginx-mod-http-geoip
libnginx-mod-http-image-filter libnginx-mod-http-subs-filter
libnginx-mod-http-upstream-fair libnginx-mod-http-xslt-filter
libnginx-mod-mail libnginx-mod-stream nginx-common nginx-full
Suggested packages:
libnet-dns-perl libnet-ip-perl libgeo-ipfree-perl fcgiwrap nginx-doc
The following NEW packages will be installed:
awstats libnet-xwhois-perl libnginx-mod-http-auth-pam
libnginx-mod-http-dav-ext libnginx-mod-http-echo libnginx-mod-http-geoip
libnginx-mod-http-image-filter libnginx-mod-http-subs-filter
libnginx-mod-http-upstream-fair libnginx-mod-http-xslt-filter
libnginx-mod-mail libnginx-mod-stream nginx nginx-common nginx-full
0 upgraded, 15 newly installed, 0 to remove and 11 not upgraded.
Need to get 3,778 kB of archives.
After this operation, 10.3 MB of additional disk space will be used.
Get:1 https://deb.debian.org/debian buster/main amd64 awstats all 7.6+dfsg-2 [1,998 kB]
Get:2 https://deb.debian.org/debian buster/main amd64 libnet-xwhois-perl all 0.90-4 [22.0 kB]
Get:3 https://deb.debian.org/debian buster/main amd64 nginx-common all 1.14.2-2+deb10u1 [120 kB]
Get:4 https://deb.debian.org/debian buster/main amd64 libnginx-mod-http-auth-pam amd64 1.14.2-2+deb10u1 [92.6 kB]
Get:5 https://deb.debian.org/debian buster/main amd64 libnginx-mod-http-dav-ext amd64 1.14.2-2+deb10u1 [100 kB]
Get:6 https://deb.debian.org/debian buster/main amd64 libnginx-mod-http-echo amd64 1.14.2-2+deb10u1 [104 kB]
Get:7 https://deb.debian.org/debian buster/main amd64 libnginx-mod-http-geoip amd64 1.14.2-2+deb10u1 [93.8 kB]
Get:8 https://deb.debian.org/debian buster/main amd64 libnginx-mod-http-image-filter amd64 1.14.2-2+deb10u1 [97.4 kB]
Get:9 https://deb.debian.org/debian buster/main amd64 libnginx-mod-http-subs-filter amd64 1.14.2-2+deb10u1 [95.7 kB]
Get:10 https://deb.debian.org/debian buster/main amd64 libnginx-mod-http-upstream-fair amd64 1.14.2-2+deb10u1 [95.7 kB]
Get:11 https://deb.debian.org/debian buster/main amd64 libnginx-mod-http-xslt-filter amd64 1.14.2-2+deb10u1 [95.7 kB]
Get:12 https://deb.debian.org/debian buster/main amd64 libnginx-mod-mail amd64 1.14.2-2+deb10u1 [126 kB]
Get:13 https://deb.debian.org/debian buster/main amd64 libnginx-mod-stream amd64 1.14.2-2+deb10u1 [147 kB]
Get:14 https://deb.debian.org/debian buster/main amd64 nginx-full amd64 1.14.2-2+deb10u1 [501 kB]
Get:15 https://deb.debian.org/debian buster/main amd64 nginx all 1.14.2-2+deb10u1 [88.3 kB]
Fetched 3,778 kB in 17s (223 kB/s)
Preconfiguring packages ...
Selecting previously unselected package awstats.
(Reading database ... 189758 files and directories currently installed.)
Preparing to unpack .../00-awstats_7.6+dfsg-2_all.deb ...
Unpacking awstats (7.6+dfsg-2) ...
Selecting previously unselected package libnet-xwhois-perl.
Preparing to unpack .../01-libnet-xwhois-perl_0.90-4_all.deb ...
Unpacking libnet-xwhois-perl (0.90-4) ...
Selecting previously unselected package nginx-common.
Preparing to unpack .../02-nginx-common_1.14.2-2+deb10u1_all.deb ...
Unpacking nginx-common (1.14.2-2+deb10u1) ...
Selecting previously unselected package libnginx-mod-http-auth-pam.
Preparing to unpack .../03-libnginx-mod-http-auth-pam_1.14.2-2+deb10u1_amd64.deb ...
Unpacking libnginx-mod-http-auth-pam (1.14.2-2+deb10u1) ...
Selecting previously unselected package libnginx-mod-http-dav-ext.
Preparing to unpack .../04-libnginx-mod-http-dav-ext_1.14.2-2+deb10u1_amd64.deb ...
Unpacking libnginx-mod-http-dav-ext (1.14.2-2+deb10u1) ...
Selecting previously unselected package libnginx-mod-http-echo.
Preparing to unpack .../05-libnginx-mod-http-echo_1.14.2-2+deb10u1_amd64.deb ...
Unpacking libnginx-mod-http-echo (1.14.2-2+deb10u1) ...
Selecting previously unselected package libnginx-mod-http-geoip.
Preparing to unpack .../06-libnginx-mod-http-geoip_1.14.2-2+deb10u1_amd64.deb ...
Unpacking libnginx-mod-http-geoip (1.14.2-2+deb10u1) ...
Selecting previously unselected package libnginx-mod-http-image-filter.
Preparing to unpack .../07-libnginx-mod-http-image-filter_1.14.2-2+deb10u1_amd64.deb ...
Unpacking libnginx-mod-http-image-filter (1.14.2-2+deb10u1) ...
Selecting previously unselected package libnginx-mod-http-subs-filter.
Preparing to unpack .../08-libnginx-mod-http-subs-filter_1.14.2-2+deb10u1_amd64.deb ...
Unpacking libnginx-mod-http-subs-filter (1.14.2-2+deb10u1) ...
Selecting previously unselected package libnginx-mod-http-upstream-fair.
Preparing to unpack .../09-libnginx-mod-http-upstream-fair_1.14.2-2+deb10u1_amd64.deb ...
Unpacking libnginx-mod-http-upstream-fair (1.14.2-2+deb10u1) ...
Selecting previously unselected package libnginx-mod-http-xslt-filter.
Preparing to unpack .../10-libnginx-mod-http-xslt-filter_1.14.2-2+deb10u1_amd64.deb ...
Unpacking libnginx-mod-http-xslt-filter (1.14.2-2+deb10u1) ...
Selecting previously unselected package libnginx-mod-mail.
Preparing to unpack .../11-libnginx-mod-mail_1.14.2-2+deb10u1_amd64.deb ...
Unpacking libnginx-mod-mail (1.14.2-2+deb10u1) ...
Selecting previously unselected package libnginx-mod-stream.
Preparing to unpack .../12-libnginx-mod-stream_1.14.2-2+deb10u1_amd64.deb ...
Unpacking libnginx-mod-stream (1.14.2-2+deb10u1) ...
Selecting previously unselected package nginx-full.
Preparing to unpack .../13-nginx-full_1.14.2-2+deb10u1_amd64.deb ...
Unpacking nginx-full (1.14.2-2+deb10u1) ...
Selecting previously unselected package nginx.
Preparing to unpack .../14-nginx_1.14.2-2+deb10u1_all.deb ...
Unpacking nginx (1.14.2-2+deb10u1) ...
Setting up awstats (7.6+dfsg-2) ...
Setting up nginx-common (1.14.2-2+deb10u1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /lib/systemd/system/nginx.service.
Setting up libnginx-mod-http-xslt-filter (1.14.2-2+deb10u1) ...
Setting up libnginx-mod-http-auth-pam (1.14.2-2+deb10u1) ...
Setting up libnginx-mod-http-geoip (1.14.2-2+deb10u1) ...
Setting up libnet-xwhois-perl (0.90-4) ...
Setting up libnginx-mod-http-echo (1.14.2-2+deb10u1) ...
Setting up libnginx-mod-http-subs-filter (1.14.2-2+deb10u1) ...
Setting up libnginx-mod-http-dav-ext (1.14.2-2+deb10u1) ...
Setting up libnginx-mod-mail (1.14.2-2+deb10u1) ...
Setting up libnginx-mod-http-image-filter (1.14.2-2+deb10u1) ...
Setting up libnginx-mod-stream (1.14.2-2+deb10u1) ...
Setting up libnginx-mod-http-upstream-fair (1.14.2-2+deb10u1) ...
Setting up nginx-full (1.14.2-2+deb10u1) ...
Setting up nginx (1.14.2-2+deb10u1) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for systemd (241-7~deb10u3) ...
root@disp9503:~# dpkg -S /etc/logrotate.d/nginx
nginx-common: /etc/logrotate.d/nginx
root@disp9503:~# cat /etc/logrotate.d/nginx
/var/log/nginx/*.log {
daily
missingok
rotate 14
compress
delaycompress
notifempty
create 0640 www-data adm
sharedscripts
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
run-parts /etc/logrotate.d/httpd-prerotate; \
fi \
endscript
postrotate
invoke-rc.d nginx rotate >/dev/null 2>&1
endscript
}
root@disp9503:~# run-parts --list /etc/logrotate.d/httpd-prerotate
root@disp9503:~# ls /etc/logrotate.d/httpd-prerotate/
awstats
root@disp9503:~# ls /etc/logrotate.d/httpd-prerotate/awstats/
prerotate.sh
root@disp9503:~# run-parts --list /etc/logrotate.d/httpd-prerotate/awstats/
root@disp9503:~# mv /etc/logrotate.d/httpd-prerotate/awstats/prerotate.sh /etc/logrotate.d/httpd-prerotate/awstats/prerotate
root@disp9503:~# run-parts --list /etc/logrotate.d/httpd-prerotate/awstats/
/etc/logrotate.d/httpd-prerotate/awstats//prerotate
root@disp9503:~# run-parts --list /etc/logrotate.d/httpd-prerotate
root@disp9503:~# mv /etc/logrotate.d/httpd-prerotate/awstats/prerotate /etc/logrotate.d/httpd-prerotate/awstats-prerotate
root@disp9503:~# run-parts --list /etc/logrotate.d/httpd-prerotate
/etc/logrotate.d/httpd-prerotate/awstats-prerotate
root@disp9503:~#
```
-- System Information:
Debian Release: 10.3
APT prefers stable
APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 4.19.107-1.pvops.qubes.x86_64 (SMP w/2 CPU cores)
Kernel taint flags: TAINT_OOT_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages awstats depends on:
ii perl 5.28.1-6
Versions of packages awstats recommends:
ii libnet-xwhois-perl 0.90-4
Versions of packages awstats suggests:
pn libgeo-ipfree-perl <none>
pn libnet-dns-perl <none>
pn libnet-ip-perl <none>
ii liburi-perl 1.76-1
ii nginx-full [httpd] 1.14.2-2+deb10u1
-- Configuration Files:
/etc/logrotate.d/httpd-prerotate/awstats/prerotate.sh [Errno 2] No such file or directory: '/etc/logrotate.d/httpd-prerotate/awstats/prerotate.sh'
-- no debconf information
Reply to: