- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: redirect a tracefile to a null device
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-03-2008 12:43 AM
тАО09-03-2008 12:43 AM
redirect a tracefile to a null device
writing data into a trace file
that trace file is the filling up my partition
till i find the reason which should stop the
filling up of the file
i need to temporarily redirect it to a null device WITHOUT stopping the process
is that possible ??
what kind of unixcommands to be used ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-03-2008 12:54 AM
тАО09-03-2008 12:54 AM
Re: redirect a tracefile to a null device
> file name
It will trim your file.
Thanks
SKR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-03-2008 12:58 AM
тАО09-03-2008 12:58 AM
Re: redirect a tracefile to a null device
I think it depends on process, for example if there is a configuration file for that process it should be easy to change log file for it to /dev/null. Otherwise it sounds not possible to change the behaviour of a process which per default writes in a exact trace file.
Anyway could you say which is the process?
Best regards,
Fabio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-03-2008 01:07 AM
тАО09-03-2008 01:07 AM
Re: redirect a tracefile to a null device
I think you need to change how the process is launched.
Messing with the process after it has already launched is likely to crash it. I assume its important or you would have simply killed it and restarted it.
If you don't want the file, don't launch with the output to a trace file.
If you do want the trace file, change the next launch of the process to put it in a place where there is sufficient space for it.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-03-2008 02:29 AM
тАО09-03-2008 02:29 AM
Re: redirect a tracefile to a null device
You might try going into the debugger and changing the __iob entry for the particular stream but you would have to find it.
If you used open(2) instead of fopen(3), you could do something similar.
Basically you would have to weigh the cost of stopping the application and reprogramming it to do what you want, vs trying to fiddle with the debugger in assembly mode.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-03-2008 04:07 AM
тАО09-03-2008 04:07 AM
Re: redirect a tracefile to a null device
You could do something as simple as this, without interrupting your process. Let's assume that your tracefile is named "mylog":
# cp ./mylog /path/mylog.old && > ./mylog
This preserves the data you have collect, but moves it to potentially another filesystem and then truncates the existing collection while allowing logging to continue. Note the use of 'cp' and *not* 'mv'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-03-2008 04:15 AM
тАО09-03-2008 04:15 AM
Re: redirect a tracefile to a null device
If you do not want to stop the running process now, then the workaround is, as SKR suggested, empty the output trace file which fills the partition, using a small script like below:
while:
do
cat /dev/null > /path/trace-output-file
sleep 1
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-03-2008 04:23 AM
тАО09-03-2008 04:23 AM
Re: redirect a tracefile to a null device
The key words here are "WITHOUT stopping the proccess". You have to check how the process is using the trace file. You can use "fuser
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-03-2008 10:24 AM
тАО09-03-2008 10:24 AM
Re: redirect a tracefile to a null device
> TTr: nulling the file as suggested above will either HUNG the process or delete the file but NOT recover the space.
That's not true, By truncating the file, the disk blocks formerly in use are returned to the system, thereby recovering the space formerly used. The process writing to the file can continue unabated.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-03-2008 12:00 PM
тАО09-03-2008 12:00 PM
Re: redirect a tracefile to a null device
I said, "IF the tracefile is kept open by the process..."
Would you run your commands to the syslog.log file?