# Help with: /proc/kmsg -> "No such file or directory"

## youngka

Hi all,

```

myTerm ~ # /etc/init.d/syslog-ng start                                    [ ok ]

 * Starting syslog-ng ...

Error opening file /proc/kmsg for reading (No such file or directory)

Error initializing configuration, exiting.

 * Failed to start syslog-ng                                            [ !! ]

myTerm ~ #

```

I have a VPS server running Gentoo, and after a reboot I noticed that syslog-ng wasn't running.  It shows the above error when I try to start it.  I have been Googling like mad to try and figure out where the heck kmsg comes from and how to get it back, but I am at a loss.  Can someone please help me with instructions on how to get /proc/kmsg to show up again? I have taken out the kernel logging for now in syslog-ng.conf to get at least some logging happening, but I (obviously) would like to get kernel logging restored.

The VPS account is an "unmanaged" account, so the host isn't very helpful with this.

Cheers,

Keith.

----------

## widan

 *youngka wrote:*   

> I have a VPS server running Gentoo, and after a reboot I noticed that syslog-ng wasn't running.

 

Did it work properly before ?

 *youngka wrote:*   

> figure out where the heck kmsg comes from

 

It comes from the kernel (through the proc filesystem). If you read that file, you get the kernel log messages (that are written by printk inside the kernel).

 *youngka wrote:*   

> how to get it back

 

It should always be there, the kernel creates it... Check that /proc is mounted, just in case (but the boot process would have complained about it). Look at what you have in /proc, does it look normal, or is it empty ?

----------

## ryker

Did you ever find a solution to this?  I am having the same problem.  I am using Gentoo Vserver and I just updated one of the hosts, ran dispatch-conf, and rebooted the guest.  Now I'm getting the same kmsg error.  I checked /proc and it is there.  I also recompiled syslog-ng, and I get the same error.

----------

## ryker

I guess not.  I switched to metalog, and everything seems ok now.  I never could get syslog-ng to work again.

----------

## xbot

Got it solved!

I have gentoo running on a 1and1 Vserver too . (orig System SuSe 9.3)

Have copied the syslog-ng file from a SuSe 10 server.

Now syslog is working again! 

Just change the following lines:

```

options { long_hostnames(off); sync(0); perm(0640); stats(3600); };

source src { internal(); unix-dgram("/dev/log"); };

```

----------

## dev-urandom

Are you guys running selinux? I've seen similiar errors on some redhat systems when I upgraded. If you really don't have /proc/kmesg, well then thats a really funky kernel configuration that you folks have  :Wink: 

----------

## ryker

Thanks xbot, I'll give that a try when I get a chance.  I've changed most of my machines over to metalog since syslog-ng died.

@dev-urandom: /proc/kmsg exists, syslog just says it doesn't.

----------

## dev-urandom

 *ryker wrote:*   

> @dev-urandom: /proc/kmsg exists, syslog just says it doesn't.

 

Hmm, do you have selinux enabled? Also, please post the last few lines of /var/log/messages when you restart syslog-ng.

----------

## ryker

Sorry it took so long for me to reply.  As I mentioned in my last post, I have switched all of my servers to metalog to quickly fix the problem.  I just installed a new server (new to me) and I am running into the same problem after I did an emerge -uD world on a fresh install.  It looks like syslog-ng is the same version as before I updated world.  I'm not in too much of a rush for this server, so I can spend some time trying to figure out what's wrong.

Here is some more information about the problem.

When I try to start syslog-ng, I get the following:

```

 * Starting syslog-ng ...

Error opening file /proc/kmsg for reading (Operation not permitted)

Error initializing configuration, exiting.

 * Failed to start syslog-ng
```

/var/log/messages only shows syslog-ng going down for reboot after I upgraded.  No new log entries.  Here is a tail of /var/log/messages:

```
Jul 24 23:54:48 jackassvs1 init: Trying to re-exec init

Jul 24 23:54:48 jackassvs1 init: no more processes left in this runlevel

Jul 25 04:37:50 jackassvs1 syslog-ng[11715]: STATS: dropped 0

Jul 25 05:46:39 jackassvs1 rc-scripts: gcc-config: No gcc profile is active!

Jul 25 05:46:44 jackassvs1 rc-scripts: If you intend to use the gcc from the new profile in an already

Jul 25 05:46:44 jackassvs1 rc-scripts: running shell, please remember to do:

Jul 25 05:46:44 jackassvs1 rc-scripts:   # source /etc/profile

Jul 25 11:31:27 jackassvs1 shutdown[6870]: shutting down for system reboot

Jul 25 11:31:27 jackassvs1 init: Switching to runlevel: 6

Jul 25 11:31:31 jackassvs1 syslog-ng[11715]: syslog-ng version 1.6.9 going down

```

I am currently using syslog-ng 1.6.9

ls -lah /proc/kmsg shows:

```
-r-------- 1 root root 0 Jul 22 00:43 /proc/kmsg

```

Seems strange that it has 400 permission.  Shouldn't it at least have 444?

Please letm me know if you need any further info.

Thanks for your help.

----------

## G104cch1n0

Still experiencing this problem  :Neutral: 

Someone found a fix ?

----------

