LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-10-2007, 02:28 PM   #1
ddenton
Member
 
Registered: May 2007
Posts: 114

Rep: Reputation: 15
Syslogging to somewhere other than /var...


I have a cisco firewall that's currently syslogging to /var/log/firewall . /var's getting tight on space, so I created /opt/log, gave it the same perms and ownership, then altered my /etc/syslog.conf file to write to /opt/log/firewall, and restarted syslog. No new files were being written to /opt/log and nothing was being written to /var/log either. So, I changed everything back and it's logging to /var/log again.

My question is, besides syslog.conf, is there anything that would keep me from syslogging to somewhere other than /var/log?

Thanks in advance...
 
Old 08-10-2007, 02:44 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
without wishing to dodge the question and reinvent the wheel, if you want nothign more than standard syslogging for the system and remote switches, i'd really really recommend changing to use syslog-ng instead, it's really simple to drop in replace syslogd and the configuration iso so simple when you're adding network syslog sources and such, and can do nice things like automatically archiving files into /host/yy/mm/dd/ things...
 
Old 08-10-2007, 03:32 PM   #3
ddenton
Member
 
Registered: May 2007
Posts: 114

Original Poster
Rep: Reputation: 15
Acid,

Thanks for the response, but for now I'd like to fix what I have, if it's possible.
 
Old 08-10-2007, 11:02 PM   #4
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Quote:
My question is, besides syslog.conf, is there anything that would keep me from syslogging to somewhere other than /var/log?
Some thoughts:

If the firewall program does its logging through syslog, then the answer is no. (By the way, you can verify that logging is going through syslog by running lsof and seeing which process is writing to /var/log/firewall). Assuming, as seems to be the case, that syslog is doing the logging, you might need to create the initial log file /opt/log/firewall, so you may need to touch it and subsequently chown and chmod it to whatever it should be (i.e. to whatever the permissions currently are on /var/log/firewall).

Last edited by Berhanie; 08-10-2007 at 11:03 PM.
 
Old 08-13-2007, 08:57 AM   #5
ddenton
Member
 
Registered: May 2007
Posts: 114

Original Poster
Rep: Reputation: 15
I just tried touching the files (firewall and firewall.1) and gave them the same perms as the files in /var/log. No dice. I ran an lsof and grepped for syslog, and while it was set to log to /opt/log, there was no entry for syslog in the output.

So, I took a look at the messages log, and here's what I found:

kernel: audit(1187013097.609:0): avc: denied { append } for pid=4900 exe=/sbin/syslogd name=firewall dev=dm-4 ino=1343490 scontext=root:system_r:syslogd_t tcontext=rootbject_r:usr_t tclass=file
syslog: syslogd shutdown succeeded

By the looks of it, selinux was preventing the syslogd daemon from writing to the file. I tried changing the enforcement level to permissive, and disabled, with no luck, but as far as I can tell the system needs to be rebooted to reset selinux. It's a production box, so I don't know when that will be. I'll be sure to update this post when I find out.
 
Old 08-13-2007, 09:40 AM   #6
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Good work. Thanks for posting the solution.
 
  


Reply



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
External Syslogging (snort) ponds Linux - Security 1 08-15-2005 02:42 PM
Secure syslogging [slack] darklogik_org Linux - Security 13 01-28-2004 01:21 PM
Simulating remote syslogging ganninu Linux - General 0 12-09-2003 02:45 AM
Remote + local syslogging at the same time ganninu Linux - General 9 12-03-2003 02:21 AM
Syslogging from shell script Hko Programming 2 12-16-2002 11:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:05 AM.

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