when a process fails to write to /dev/log


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users when a process fails to write to /dev/log
# 1  
Old 07-12-2010
when a process fails to write to /dev/log

Hi ,

when a process fails to write to /dev/log ?
# 2  
Old 07-12-2010
Assuming you mean "when does a process fail to write to /dev/log?"

/dev/log is a semi-standard convention for syslog - syslog listens on this UNIX socket, and writes what is written there according to the rules in it's configuration file.

Given that, you've got three reasons why a process might not be able to log:
  1. The process in question isn't set up to do syslog. Using syslog is optional, and needs to be part of the process code.
  2. syslogd isn't running, so there's nothing reading from that socket.
  3. There is a syslogd running, and the process is set up to log to syslog, but it fails before it reaches the part of it's code when it does.

To check for the first, if you have the source code for the process, check it for calls to openlog(), syslog(), and closelog(), or if it's a shell script, check for calls to the logger program. Perl scripts will usually use Sys::Syslog or something similar.

To check for the second, do:
Code:
 $ ps -efawww | egrep syslog

or even better

Code:
 # lsof /dev/log

and see what has /dev/log open

To check for the third, well, you might try running the process under a debugger, and see if you can catch any writes to /dev/log or calls to syslog. Or, you could run the process via "strace" (truss on some Unixes) and look for writes that way.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Subprocess.popen() should write to log without waiting for process to complete

Here is my test code process = sp.Popen( + , bufsize=1, universal_newlines=True, stdout=sp.PIPE, stderr=sp.STDOUT, cwd=src_home) output, _ =... (2 Replies)
Discussion started by: ezee
2 Replies

2. Shell Programming and Scripting

Ksh: How to write the log file simultaneously when .sql file executes by UNIX process

Hello Team- we would like to implement an approach which has to write the log file simultaneously when .sql file is executing by Unix process. At present,it is writing the log file once the process is completed. I've tested the current process with the below approaches and none of them... (1 Reply)
Discussion started by: Hima_B
1 Replies

3. Shell Programming and Scripting

How do i restart a process if it fails?

Hi Guru's, I just want to have an idea on how to restart a particular step when it fails? SCENARIO we have plenty of steps such as the following below: Step 1 copy file from source to target location which is in a different server. Step 2 create initial and incremental process ... (4 Replies)
Discussion started by: reignangel2003
4 Replies

4. Shell Programming and Scripting

Setuid not working in Linux as script fails to write to file.

Hi, I have the following 3 test files to test setuid bit which if it works I would like to implement in our application. However setuid doesnot seem to be having any impact on my test below.Following are the 3 files of interest in /tmp/ folder. $ ls -ltr *env* -rw------- 1 g332008 users 6... (23 Replies)
Discussion started by: waavman
23 Replies

5. Shell Programming and Scripting

Multiple process write to same log file at the same time

If we have 3 process to write to same log file at the same time like below. will it cause the data outdated because the multiple process writing same time? It this a safe way to keep the log for multiple process? p1 >> test.log &; p2 >> test.log &; p3 >> test.log & Thanks, (5 Replies)
Discussion started by: casttree
5 Replies

6. Solaris

/dev/rmt/0mn: write protected or reserved

# mt stat HP DDS-4 DAT (Sun) tape drive: sense key(0x0)= No Additional Sense residual= 0 retries= 0 file no= 0 block no= 0 mt -f /dev/rmt/0mn erase /dev/rmt/0mn: write protected or reserved. Getting error while ufsdump .... --- Dumping / to /dev/rmt/0mn --- DUMP: Date... (5 Replies)
Discussion started by: vickyingle5
5 Replies

7. Hardware

/dev/rmt/0mn: write protected or reserved

# mt stat HP DDS-4 DAT (Sun) tape drive: sense key(0x0)= No Additional Sense residual= 0 retries= 0 file no= 0 block no= 0 mt -f /dev/rmt/0mn erase /dev/rmt/0mn: write protected or reserved. Getting error while ufsdump .... --- Dumping / to /dev/rmt/0mn --- DUMP: Date... (1 Reply)
Discussion started by: vickyingle5
1 Replies

8. IP Networking

read/write,write/write lock with smbclient fails

Hi, We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Discussion started by: swatidas11
1 Replies

9. Shell Programming and Scripting

Background-Process with #>/dev/null

Heya I want to start a new background-process like this: /tools/bin/bretestdriver QMGR=$QMGR REQUEST=$REQUEST CONTROL=$INPUTSAS $TESTCASE #>/dev/null & #>/dev/null & It doesn't work. like this it ignors #>/dev/null . does anybody know how i could do this? Thanks... (3 Replies)
Discussion started by: lucae
3 Replies

10. UNIX for Dummies Questions & Answers

Sending alt-n to /dev/pts/1 from process bound to /dev/pts/2

Hello, i am using finch (unix commandline instant messaging client using libgnt) which is running connected to /dev/pts/1 Now I would like to "remote control" the program by sending the key combinations normally typed on the keyboard from a programm in another shell. So I tried:... (0 Replies)
Discussion started by: mentos
0 Replies
Login or Register to Ask a Question