I'm running a program (syslog-ng) that must read and write several files in a given path. It was failing at start, claiming that it is unable to open a file in that path.

Please, assume this directory structure:


The platform directory has the permission set to 0655 (not execute permission to the owner user). If I change that permissions to 0755, syslog-ng works fine.

On the other hand, I have written a small program in C that try to open and write into a file in the same directory, and it works without problem when running as root, but syslog-ng is failing...

What can be the problem in this case?

1 Answer 1


syslog wants probably to chdir to the directory and needs therefore the execute bit set on the directory.

See Execute vs Read bit. How do directory permissions in Linux work? for more information.

  • Thanks for your answer. But, if it only wants to read/write from inside /var/platform/program/something_more? It was failing when try to read the configuration file, that is stored on that way Sep 27, 2013 at 10:11
  • 3
    You need the x bit as well to write files in the directory if you're not root. root can do anything in any directory regardless of the permissions. Most probably syslog-ng is not running as root or has dropped some priviledges. Sep 27, 2013 at 11:52
  • Theoretically it's running as root, as it's shown by ps ufax Sep 28, 2013 at 10:19
  • This answer put my in the right direction: I saw that syslog-ng is dropping some root privileges and that there is an option (not documented in the help output) to avoid this privileges dropping. Now, it's working like a charm. Thank you! Oct 15, 2013 at 15:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .