LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 10-11-2005, 11:22 AM   #1
Sigkill(9)
Member
 
Registered: Jan 2005
Location: Dallas/TX
Distribution: OpenBSD/FreeBSD/Debian/Mac OS X
Posts: 40

Rep: Reputation: 15
Question OpenBSD 3.4 - log files


Total newbie question.

I have an OpenBSD 3.4 machine running spamd and logging to /var/log/spamd

The file is 1.9G

Can I just blow it away?

Or maybe echo "" > /var/log/spamd

Will killing logfiles like this have any adverse effects?

Last edited by Sigkill(9); 10-11-2005 at 11:39 AM.
 
Old 10-11-2005, 11:39 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Try running lsof against the file. If no processes have it open its probably safe to overwrite it. If something DOES have it open you should probably stop whatever that is, then do the blow away, then restart the process. Removing an open file only removes the name - the inode stays there until the process goes away so the space doesn't get freed. Doing the redirect in while its running may prevent this problem but I'd prefer to have my process start up cleanly against the file to take no chances.
 
Old 10-11-2005, 01:23 PM   #3
Sigkill(9)
Member
 
Registered: Jan 2005
Location: Dallas/TX
Distribution: OpenBSD/FreeBSD/Debian/Mac OS X
Posts: 40

Original Poster
Rep: Reputation: 15
lsof is not on this machine.

so I used fstat and grep'd for the file inode

server# ll -i spamd

643576 -rwxrwxrwx 1 root wheel 2089565687 Sep 15 16:57 spamd

server# fstat | grep 643576

_syslogd syslogd 9848 19 / 643576 -rwxrwxrwx w 2089565687
 
  


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
HELP, need to disable Spamd kyletaz Linux - Software 7 11-22-2005 02:45 PM
How to control log file size in /var/log? yan Linux - General 2 10-13-2003 05:00 PM
what log file generator that support squid log? heero82 Linux - Software 2 07-11-2003 08:52 PM
iptables, changing log file from /var/log/messages acid2000 Linux - Networking 3 03-11-2003 08:38 PM
OpenBSD - Log analyser mail *BSD 3 04-24-2002 03:32 PM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 10:40 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