Access to /var/log/messages
I want to write an application that gets, periodically, the new messages written to /var/log/messages (and other log files in the same directory). I want the application to run in user mode. The problem is that this file can be opened only in su mode.
Is there any system call (or another option) that gets the new messages in user mode ? Regards |
You can create a script that runs as root (aka "in su mode")--or you can change the permissions on the file in question.
|
I tried it and it works
Thanks |
I can't change file permission
It appears that I can't change the permissions of files in /var/log. I prefer not to write any script (or small program) in root mode so I tried to use the system call syslog (syslog(3, bufp, len) but it returned always 0 bytes. I tried it as a root and as a user (though in the man page it is written that syslog(3, ...) can be activated also in user mode).
Should I do any other action besides calling to this system call ? Is there another system call that can be used in user mode ? |
In Debian, if you add a user to group: adm, they have read access to /var/log files
|
All times are GMT -5. The time now is 04:03 PM. |