Hi Daniel On Mon, Mar 21, 2011 at 04:49:18PM +0100, Daniel Cacabelos wrote: > Package: cron-apt > Version: 0.8.2 > Severity: normal > > > When cron-apt line exceeds 256 characters an error message is shown on > standard error. > This is because cron-apt tries to create a new file with the entire > cron-apt line as filename. When line length exceeds maximum allowed > file name length of filesystem the file cannot be created and the > error is shown (checked on ext3 filesystem).
Oh. Interesting. I had not thought about that case really.
> I haven't noticed any error on apt package management, It seems to
> complete all operations, but It would be great if you could clarify
> possible consequences of that error (e.g. Which operations are
> interrupted?).
It looks like the only thing that stop working is the diff
functionality. Essentially it will always show the result regardless
of the setting.
> Any workaround to avoid that error would be appreciated too (e.g.
> disabling features via config file or doing some hack).
The hack would be to correct the problem. I have attached a corrected
version that you can test.
> Also I suggest to use an alternative method for file naming instead of
> using entire cron-apt line.
Fully agree with that. The correction is very simple. What I have done
is to change it from using the full line to use a md5sum of the line.
--- src/cron-apt (revision 2634)
+++ src/cron-apt (arbetskopia)
@@ -432,8 +435,7 @@
createloginfo $ACTIONF
fi
fi
- TLINE=$(echo "$LINE" | sed -e "s/[[:space:]]/_/g;" | \
- tr "/" "-")
+ TLINE=$(echo "$LINE" | md5sum | sed -e "s/[[:space:]].*//;")
if [ -n "$DIFFIGNORE" ]; then
DIFFIGNORELINE="--ignore-matching-lines=$DIFFIGNORE"
fi
Hope this solves your problem.
When you have confirmed that it does, then I will upload the corrected
version to Debian.
Best regards,
// Ola
> Example CRON-APT LINE:
> CRON-APT LINE: /usr/bin/apt-get install net-tools netbase
> netcat-traditional openssh-blacklist openssh-client openssh-server
> openssl passwd patch perl perl-base perl-modules portmap postfix
> procmail procps ng-updater python python-apt-common python-central
> python-minimal python-reportbug python-support python2.5
> python2.5-minimal -y --force-yes -o APT::Get::Show-Upgraded=true -o
> DPkg::Options::=--force-confold
>
> Error message:
> cp: accessing
> `/var/lib/cron-apt/_-_tmp_-_ng-updater-generic-install-1300700364_-_config/mailchanges/5-install-install_net-tools_netbase_netcat-traditional_openssh-blacklist_openssh-client_openssh-server_openssl_passwd_patch_perl_perl-base_perl-modules_portmap_postfix_procmail_procps_ng-updater_python_python-apt-common_python-central_python-minimal_python-reportbug_python-support_python2.5_python2.5-minimal_-y_--force-yes_-o_APT::Get::Show-Upgraded=true_-o_DPkg::Options::=--force-confold':
> File name too long
>
> Thanks,
>
>
> -- System Information:
> Debian Release: 6.0.1
> APT prefers stable
> APT policy: (500, 'stable')
> Architecture: amd64 (x86_64)
>
> Kernel: Linux 2.6.24-8-pve (SMP w/4 CPU cores; PREEMPT)
> Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
> Shell: /bin/sh linked to /bin/dash
>
> Versions of packages cron-apt depends on:
> ii apt 0.8.10.3 Advanced front-end for dpkg
>
> Versions of packages cron-apt recommends:
> ii bsd-mailx [mailx] 8.1.2-0.20100314cvs-1 simple mail user agent
> ii cron 3.0pl1-116 process scheduling daemon
> ii liblockfile1 1.08-4 NFS-safe locking library,
> includes
>
> cron-apt suggests no packages.
>
> -- Configuration Files:
> /etc/cron.d/cron-apt changed [not included]
>
> -- no debconf information
>
>
>
--
--------------------- Ola Lundqvist ---------------------------
/ [email protected] Annebergsslingan 37 \
| [email protected] 654 65 KARLSTAD |
| http://inguza.com/ +46 (0)70-332 1551 |
\ gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9 /
---------------------------------------------------------------
cron-apt_0.8.3_all.deb
Description: application/debian-package

