LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-16-2006, 08:23 AM   #1
roniagmon
LQ Newbie
 
Registered: Mar 2006
Posts: 3

Rep: Reputation: 0
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
 
Old 03-16-2006, 08:31 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
You can create a script that runs as root (aka "in su mode")--or you can change the permissions on the file in question.
 
Old 03-17-2006, 07:54 AM   #3
roniagmon
LQ Newbie
 
Registered: Mar 2006
Posts: 3

Original Poster
Rep: Reputation: 0
I tried it and it works
Thanks
 
Old 03-19-2006, 01:49 AM   #4
roniagmon
LQ Newbie
 
Registered: Mar 2006
Posts: 3

Original Poster
Rep: Reputation: 0
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 ?
 
Old 03-19-2006, 01:55 AM   #5
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 62
In Debian, if you add a user to group: adm, they have read access to /var/log files
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Repeating messages in /var/log/messages skubik Linux - General 2 12-23-2005 03:47 PM
Redirecting the kernel messages to file other than /var/log/messages jyotika_b83 Linux - General 3 04-28-2005 06:39 PM
From where am i getting error messages to /var/log/messages? prabhuacsp Programming 3 02-16-2005 08:59 AM
From where am i getting error messages to /var/log/messages? prabhuacsp Linux - Networking 1 02-16-2005 12:34 AM
/var/log/messages full of these messages. Should I be concerned? mdavis Linux - Security 5 04-16-2004 10:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration