# /var/log/messages flooded with "permission denied" [RESOLVED

## DevSolar

This is a Virtuozzo-based vServer, originally running SuSE, but I replaced that with a Gentoo vServer installation. I build the system locally, "tar cjpf"ed it, uploaded the image and replaced the SuSE with the Gentoo image in maintenance mode.

This has worked fine several times in the (somewhat distant) past, but this time I must have done something wrong, because syslog-ng is flooding my /var/log/messages - fast.

This is the output:

```

Feb  6 13:31:48 lvps87-230-12-179 syslog-ng[17617]: syslog-ng starting up; version='2.0.6'

Feb  6 13:31:48 lvps87-230-12-179 syslog-ng[17617]: Error opening file for writing; filename='/dev/tty12', error='Permission denied (13)'

Feb  6 13:31:48 lvps87-230-12-179 syslog-ng[17617]: Error opening file for writing; filename='/dev/tty12', error='Permission denied (13)'

Feb  6 13:31:48 lvps87-230-12-179 syslog-ng[17617]: Error opening file for writing; filename='/dev/tty12', error='Permission denied (13)'

Feb  6 13:31:48 lvps87-230-12-179 syslog-ng[17617]: Error opening file for writing; filename='/dev/tty12', error='Permission denied (13)'

```

etc. etc. pp., going on until disk space runs out.

Permissions on /dev/tty12 are crw-------, owner is root, group is tty. I see that having /dev/tty12 in the group "tty" but not allowing that group anything is most likely incorrect. But what really gets me confused is, why has this been set this way? Where did I screw up?

Sure I could just change the permissions on that file, but I'd like to know where I did something wrong in my build process where I did right all the times before.

My build process in short (happy to provide more detailed info when requested); I'm using stage1 to get around various issues with the somewhat dated stage3's available.

 untar stage1-x86-2007.0 and current portage

 mount proc / dev and chroot, as per handbook

 set /etc/make.conf and /etc/portage/package.* rather conservatively (see below)

 set profile to default-linux/x86/vserver

 unmerge baselayout, oneshot-emerge baselayout-vserver

 oneshot-emerge expat

 run bootstrap script

 oneshot-emerge perl

 emerge -e system

 emerge syslog-ng iproute2 postfix apache php subversion

 exit chroot, unmount proc / dev, tarball, upload, ...

Pretty straightforward. What's going wrong here?

My make.conf (just to show I'm not pulling something exotic there):

```

# Please consult /etc/make.conf.example for a detailed example

CFLAGS="-Os -mtune=pentium4 -pipe -fomit-frame-pointer"

CHOST="i686-pc-linux-gnu"

CXXFLAGS="${CFLAGS}"

MAKEOPTS="-sj5"

EMERGE_DEFAULT_OPTS="--verbose"

GENTOO_MIRRORS="ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo \

                ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror \

                ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo \

                ftp://ftp.join.uni-muenster.de/pub/linux/distributions/gentoo \

                ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo \

                ftp://ftp.join.uni-muenster.de/pub/linux/distributions/gentoo \

                ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo \

                ftp://ftp.gentoo.mesh-solutions.com/gentoo \

                ftp://pandemonium.tiscali.de/pub/gentoo \

                ftp://ftp.rz.tu-bs.de/pub/mirror/ftp.gentoo.org/gentoo-distfiles"

SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"

PORT_LOGDIR=/var/log/portage

PORTDIR_OVERLAY=/usr/local/portage

FEATURES="sandbox userpriv usersandbox"

USE="apache2 bzip2 cgi chroot cscope enscript expat fam gd gdbm imap \

     libwww maildir memlimit mysql mysqli nptl nptlonly sasl spamassassin \

     sqlite sse2 unicode vhosts xml zip -X -gtk -ipv6"

APACHE2_MPMS="prefork"

```

Any hints or help much appreciated.Last edited by DevSolar on Thu Feb 07, 2008 5:01 am; edited 1 time in total

----------

## Hu

Is your system logger running as root?  My system has the same permissions for /dev/tty12, so your error is elsewhere.

----------

## DevSolar

Yes, it's running as root.

It seems that it is the virtual environment to blame. Of course it doesn't have tty's attached, and I don't really know why it worked before, but I will just accept that it no longer does.

Editing /etc/syslog-ng/syslog-ng.conf helped, commenting out the following two lines:

```

#destination console_all { file("/dev/tty12"); };

...

#log { source(src); destination(console_all); };

```

Reboot, permission errors are gone.

----------

