Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 440880 - app-admin/logcheck - mkdir: cannot create directory '/var/lock/logcheck': Permission denied
Summary: app-admin/logcheck - mkdir: cannot create directory '/var/lock/logcheck': Per...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Paweł Hajdan, Jr. (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-02 01:12 UTC by Iván Atienza
Modified: 2012-12-30 18:56 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Iván Atienza 2012-11-02 01:12:54 UTC
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.
Comment 1 Roland Ramthun 2012-12-06 18:19:18 UTC
This bug hits stable users now. As Iván wrote, the logcheck user has insufficient rights to write to the /var/lock/ directory anymore.
Comment 2 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2012-12-08 05:33:09 UTC
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)?
Comment 3 Roland Ramthun 2012-12-08 11:44:14 UTC
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
Comment 4 Stanislav Romanov 2012-12-17 14:10:29 UTC
I have this bug on amd64 and x86.
Comment 5 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2012-12-30 18:56:37 UTC
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.