I recently migrate to tmpfs /run as /var/lock is symlinked here and is distroyed on reboot cron sends me this warning: mkdir: cannot create directory '/var/lock/logcheck': Permission denied Reproducible: Always Steps to Reproduce: 1. install logcheck 2. uncomment /etc/cron.hourly/logcheck.cron 3. wait 1 hour :) or run "su -s /bin/bash -c /usr/sbin/logcheck logcheck" Actual Results: logcheck says: mkdir: cannot create directory '/var/lock/logcheck': Permission denied Expected Results: create lock file and remove on finish run. I add this on top logcheck cron file: if [ ! -d "/run/lock/logcheck" ]; then mkdir /run/lock/logcheck chown logcheck:logcheck /run/lock/logcheck fi and seems work as expected now.
This bug hits stable users now. As Iván wrote, the logcheck user has insufficient rights to write to the /var/lock/ directory anymore.
I'm sorry, I can't reproduce. :( Could you post output of the command below on your system? # ls -ld /var /var/lock /var/lock/logcheck drwxr-xr-x 18 root root 4096 Dec 4 14:14 /var drwxrwxr-x 4 root uucp 4096 Dec 8 06:28 /var/lock drwxr-xr-x 2 logcheck logcheck 4096 Dec 8 06:31 /var/lock/logcheck Also, where does the /var symlink come from (which package)?
I have this problem on my stable AMD64 machines. # ls -ld /var /var/lock /var/lock/logcheck ls: cannot access /var/lock/logcheck: No such file or directory drwxr-xr-x 10 root root 4096 Nov 25 13:10 /var lrwxrwxrwx 1 root root 9 Nov 25 13:10 /var/lock -> /run/lock # ls -ld /run/lock/ drwxrwxr-x 2 root uucp 40 Dec 8 10:56 /run/lock/ # equery belongs /var * Searching for /var ... app-admin/eselect-1.3.1 (/var) app-admin/logcheck-1.3.14 (/var) app-portage/gentoolkit-0.3.0.6-r3 (/var) mail-filter/sqlgrey-1.7.6 (/var) mail-mta/postfix-2.9.4 (/var) net-mail/mailbase-1 (/var) net-misc/openssh-5.9_p1-r4 (/var) sys-apps/man-1.6g (/var) sys-apps/sandbox-2.5 (/var) sys-libs/glibc-2.15-r3 (/var) sys-libs/pam-1.1.5 (/var) sys-process/cronbase-0.3.3 (/var) sys-process/fcron-3.0.6-r1 (/var) www-servers/lighttpd-1.4.32 (/var) equery belongs /var/lock/ * Searching for /var/lock/ ... app-admin/logcheck-1.3.14 (/var/lock) # emerge --info Portage 2.1.11.31 (default/linux/amd64/10.0/no-multilib, gcc-4.5.4, glibc-2.15-r3, 3.5.7-gentoo x86_64) ================================================================= System uname: Linux-3.5.7-gentoo-x86_64-QEMU_Virtual_CPU_version_1.0-with-gentoo-2.1 Timestamp of tree: Sun, 02 Dec 2012 05:00:01 +0000 ld GNU ld (GNU Binutils) 2.22 app-shells/bash: 4.2_p37 dev-lang/python: 3.2.3 dev-util/pkgconfig: 0.27.1 sys-apps/baselayout: 2.1-r1 sys-apps/openrc: 0.11.6 sys-apps/sandbox: 2.5 sys-devel/autoconf: 2.68 sys-devel/automake: 1.11.6 sys-devel/binutils: 2.22-r1 sys-devel/gcc: 4.5.4 sys-devel/gcc-config: 1.7.3 sys-devel/libtool: 2.4-r1 sys-devel/make: 3.82-r3 sys-kernel/linux-headers: 3.6 (virtual/os-headers) sys-libs/glibc: 2.15-r3
I have this bug on amd64 and x86.
Should be fixed now in stable. Sorry I was quite confused, it seems on my old but up-to-date system there are no symlinks from /var to /run. When I noticed bug #332633 it became quite clear that what you suggested is the right fix.