Sponsored Content
Full Discussion: Weird output from ps command
Top Forums UNIX for Advanced & Expert Users Weird output from ps command Post 302952885 by brij123 on Monday 24th of August 2015 07:03:06 AM
Old 08-24-2015
Weird output from ps command

Hi Guys,

I am regular Solaris user. I came across a weird problem that puzzled me. Hope you guys can help. I found that process's state(command & arguments) in two different variants of ps command is different. Can anyone explain how is this possible?


Code:
bash-3.2$ ps -eLo pid,s,comm,args | sort | uniq  | grep " Z "| grep -v grep 
  153 Z <defunct>                                                                        <defunct>                                                          
bash-3.2$ ps -ef | grep  syseventd| grep -v grep 
    root   153     1   0   Nov 26 ?           0:01 /usr/lib/sysevent/syseventd 
bash-3.2$ ps -eLo pid,s,comm,args | sort | uniq  | grep " Z "| grep -v grep 
  153 Z <defunct>                                                                        <defunct>                                                          
bash-3.2$ uname -a 
SunOS <hostname> 5.10 Generic_150400-11 sun4v sparc sun4v 
bash-3.2$ cat /etc/release 
                   Oracle Solaris 10 8/11 s10s_u10wos_17b SPARC 
  Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved. 
                            Assembled 23 August 2011 
 
                  Solaris 10 1/13 (Update 11) Patchset applied. 
bash-3.2$

Thanks in advance for your guidance and support.

Brijesh

---------- Post updated at 06:03 AM ---------- Previous update was at 03:40 AM ----------

On further investigation I found that there are 17 light wait processes generated for syseventd daemon. One of them is going to state 'Z'. I compared it with another Solaris machine, it was happening there as well.

Code:
bash-3.2$  ps -eLo pid,s,lwp  | grep 153 
  153 S      1 
  153 S      2 
  153 S      3 
  153 S      4 
  153 S      5 
  153 S      6 
  153 S      7 
  153 S      8 
  153 S      9 
  153 S     10 
  153 S     11 
  153 Z     12 
  153 S     13 
  153 S     14 
  153 S     15 
  153 S     16 
  153 S     17 
bash-3.2$ sudo truss -p 153 
/15:    lwp_park(0x00000000, 0)         (sleeping...) 
/8:     lwp_park(0x00000000, 0)         (sleeping...) 
/2:     lwp_park(0x00000000, 0)         (sleeping...) 
/4:     sigtimedwait(0xFEE4BEB8, 0xFEE4BE38, 0x00000000) (sleeping...) 
/6:     lwp_park(0x00000000, 0)         (sleeping...) 
/9:     lwp_park(0x00000000, 0)         (sleeping...) 
/3:     lwp_park(0x00000000, 0)         (sleeping...) 
/5:     door_return(0xFED2BE58, 4, 0x00000000, 0) (sleeping...) 
/7:     lwp_park(0x00000000, 0)         (sleeping...) 
/16:    lwp_park(0x00000000, 0)         (sleeping...) 
/17:    door_return(0x00000000, 0, 0x00000000, 0) (sleeping...) 
/1:     pause()                         (sleeping...) 
/10:    lwp_park(0x00000000, 0)         (sleeping...) 
/14:    lwp_park(0x00000000, 0)         (sleeping...) 
/13:    lwp_park(0x00000000, 0)         (sleeping...) 
/11:    lwp_park(0x00000000, 0)         (sleeping...) 
^Cbash-3.2$

Whats going on ????
 

10 More Discussions You Might Find Interesting

1. AIX

Weird bootlist output

just setup a new system today - 9117 570, using HMC for console but not partitioned. I installed this system twice. the first time it started off as 5300-00, then updated to ML03. before the update, I believe I mirrored the rootvg, and then altered the bootlist, at that point, the display was... (4 Replies)
Discussion started by: davew1099
4 Replies

2. Shell Programming and Scripting

weird echo output?

#!/bin/bash INPUT=$1 if then INPUT=0$1 TRACKNUMBER=$INPUT fi TRACKNUMBER=$INPUT echo "Track Number:" $TRACKNUMBER if then echo "File Does Not Exist!: split-track"${TRACKNUMBER}".wav" exit 0 fi CUEFILE="$2" (6 Replies)
Discussion started by: TinCanFury
6 Replies

3. Shell Programming and Scripting

format of output is weird

hi all, have a ksh script which connects to a database and runs a sql and dumps it to a '.csv' file. The problem is the result is in multiple rows with long spaces in between when it should be just a single line and this screws up the format in the '.csv' file. script is : #!/bin/ksh... (1 Reply)
Discussion started by: cesarNZ
1 Replies

4. UNIX for Dummies Questions & Answers

weird 'ls' output

Hi, Anyone knows why I can't display the contents of my directory and how to fix this? http://i50.tinypic.com/4smfth.jpg Thanks in advance for any advise. Deanne Double post. Continued here. (0 Replies)
Discussion started by: Deanne
0 Replies

5. Shell Programming and Scripting

In bash getting weird output from function ?

My script- result="" times() { echo "inside the times function" result=8 echo "Inside function $result" return $result } result=$(times) echo "the value is "$? echo "the value of result $result" when I run I get this, why the value still remain 0. $ ./func the value is 0 the value... (5 Replies)
Discussion started by: boy18nj
5 Replies

6. Shell Programming and Scripting

Traceroute script weird output

This script is giving weird output #!/bin/bash NETPATH=(`/bin/traceroute -n 4.2.2.2 | awk '{print $2}'`) for i in "${NETPATH}" do echo $i done The output: to 11.11.11.1 1.1.1.1 99.111.208.2 traceroute_test.sh traceroute_test.sh (7 Replies)
Discussion started by: thumbs
7 Replies

7. Shell Programming and Scripting

ery weird wget/curl output - what should I do?

Hi, I'm trying to write a script to download RedHat's errata digest. It comes in a txt.gz format, and i can get it easily with firefox. HOWEVER: output is VERY strange when donwloading it in a script. It seems I'm getting a file of the same size - but partially text and partly binary! It... (5 Replies)
Discussion started by: jstilby
5 Replies

8. Shell Programming and Scripting

Weird tail output over ssh

Hello; Am trying to correct the formatting of tail output over ssh. Using the following code: echo "" > $FILE for BOX in $SERVERS do echo "Processing on $BOX" |tee -a $FILE echo "===============================" >> $FILE sudo ssh $BOX 'TERMINAL="vt100" /usr/bin/sh -s' <... (2 Replies)
Discussion started by: delphys
2 Replies

9. HP-UX

[Solved] Weird 'ls -l' output

Hello folks, I've found an HP-UX server with a rare 'ls -l' output. Please see the attached file. Anybody knows how can I change the output to not have this extra tabulations? Thanks in advance! (10 Replies)
Discussion started by: carpannav
10 Replies

10. Shell Programming and Scripting

Grep two files: -F flag gives weird output

Hi Members, I'm confused with grep -F option. Goal is to get all the lines from file2 that have exact gene name from gene list (file one). File one has list of genes: File two has lot more information pertinent to genes in file one: I use three following commands: 1) grep -wf gene... (9 Replies)
Discussion started by: genome
9 Replies
exec(1) 							   User Commands							   exec(1)

NAME
exec, eval, source - shell built-in functions to execute other commands SYNOPSIS
sh exec [argument...] eval [argument...] csh exec command eval argument... source [-h] name ksh *exec [arg...] *eval [arg...] DESCRIPTION
sh The exec command specified by the arguments is executed in place of this shell without creating a new process. Input/output arguments may appear and, if no other arguments are given, cause the shell input/output to be modified. The arguments to the eval built-in are read as input to the shell and the resulting command(s) executed. csh exec executes command in place of the current shell, which terminates. eval reads its arguments as input to the shell and executes the resulting command(s). This is usually used to execute commands generated as the result of command or variable substitution. source reads commands from name. source commands may be nested, but if they are nested too deeply the shell may run out of file descrip- tors. An error in a sourced file at any level terminates all nested source commands. -h Place commands from the file name on the history list without executing them. ksh With the exec built-in, if arg is given, the command specified by the arguments is executed in place of this shell without creating a new process. Input/output arguments may appear and affect the current process. If no arguments are given the effect of this command is to mod- ify file descriptors as prescribed by the input/output redirection list. In this case, any file descriptor numbers greater than 2 that are opened with this mechanism are closed when invoking another program. The arguments to eval are read as input to the shell and the resulting command(s) executed. On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways: 1. Variable assignment lists preceding the command remain in effect when the command completes. 2. I/O redirections are processed after variable assignments. 3. Errors cause a script that contains them to abort. 4. Words, following a command preceded by ** that are in the format of a variable assignment, are expanded with the same rules as a vari- able assignment. This means that tilde substitution is performed after the = sign and word splitting and file name generation are not performed. EXIT STATUS
For ksh: If command is not found, the exit status is 127. If command is found, but is not an executable utility, the exit status is 126. If a redi- rection error occurs, the shell exits with a value in the range 1-125. Otherwise, exec returns a zero exit status. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
csh(1), ksh(1), sh(1), attributes(5) SunOS 5.10 17 Jul 2002 exec(1)
All times are GMT -4. The time now is 09:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy