NSCD fails to create nscd.log debug log
This document (3428635) is provided subject to the disclaimer at the end of this document.
Environment
Situation
After uncommenting the 'logfile /var/log/nscd.log' parameter from /etc/nscd.conf and restarting nscd, the log file is never created or written to.
Using strace to monitor system calls by nscd, the following error can be seen when attempting to access the log file:
nscdout.log:31049 open("/var/log/nscd.log", O_WRONLY|O_APPEND|O_CREAT, 0666) = -1 EPERM (Operation not permitted)
Resolution
There are two possible resolutions to this issue. If AppArmor is not desired, it can be disabled through the following steps:
1. Prevent AppArmor from starting upon server startup - `chkconfig boot.apparmor off`
2. Remove AppArmor from memory - `rcapparmor stop`
3. Restart NSCD - `rcnscd restart`
If AppArmor functionality is desired, the profile for NSCD must be modified to allow access to the log file. This can be accomplished through the YaST | AppArmor | Edit Profile module. Within this module, select the /usr/bin/nscd profile and select to"Add Entry" for the file /var/log/nscd.log. Grant the "Write" permissions to this file.
After making any profile changes to AppArmor, restart NSCD using `rcnscd restart` and the log file will be properly created.
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:3428635
- Creation Date: 27-Nov-2007
- Modified Date:04-Mar-2021
-
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com