![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with signals - 3 process communication | Nightwright | High Level Programming | 2 | 05-03-2006 05:58 AM |
| Inter Process File Handling Problem | saurabhjain | HP-UX | 4 | 05-12-2005 12:49 PM |
| Interprocess communication using pipes and fork | scmay | UNIX for Advanced & Expert Users | 2 | 10-14-2004 10:44 PM |
| signal in process communication | a9711 | High Level Programming | 2 | 06-22-2002 09:16 PM |
| Inter Process Communication | kamathanil | High Level Programming | 2 | 08-07-2001 07:32 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi,
I am thinking about writing a log daemon for a multi-processed ksh application (yes - I know that high-level language would be a better option). My question is as follows: If many processes (many scripts) will try writing to a single log file: print "message" > common.log Will it work or is there a risk of collision between them? If there is such a risk then is it better to use named pipes or doors for such logging system? And maybe there is some alternative? |
|
|||||
|
Well, it depends what you do you understand as collision, if the log file will be used for simple messages, then "echo `date` "log this message" >> file.log would be sufficient. Otherwise, for more sophisticated tasks, consider mkfifo, which I see, you are already familiar with.
|
|
||||
|
Maybe I will give you some more details.
I was to take code created by someone else. For logging from several simultaneous processes they are using many log files and from time to time they merge them all into one. Until now I was thinking that when you are doing: Code:
print "some even quite long message" >> file.txt But they told me that they were receiving logs like: "log number one log numbelog number threer two log number four" Im ,y understanding this should never occur. But if this is the case then FIFO pseudo-device would be the best choice. Anyway - I asked because according to my knowledge situation described by the other guy should not occur unless he is doing something like: Code:
print "log number " >>file.txt print "one" >>file.txt |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|