Reputation: 2720
I have a complex script - that Jenkins executes on build - which needs to check for events in /var/log/syslog
. In order to do so, I added the user "jenkins" to the group syslog belongs to and set the file permissions to 0640.
The script above runs perfectly fine when manually executed, but when invoked by Jenkins build system it fails: indeed, the output console shows that the script has not the permission to read /var/log/syslog
when invoked via Jenkins.
A quick check with whoami
shows that the building process runs with "jenkins" as user, though. Hence, I cannot understand why the script behavior is different.
Upvotes: 0
Views: 571
Reputation: 3912
I haven't used jenkins, so this might not be what's going on, but do you know if you are running under SELinux or any other sort of mandatory-access-control system?
That tends to be my knee-jerk reaction to strange permissions issues. If SELinux is enabled, try checking /var/log/audit/audit.log to see if there are any denials to read /var/log/syslog.
If you are on Linux, the command "getenforce" should tell you whether SELinux is running or not.
Upvotes: 1