Operating System - Tru64 Unix
1829879 Members
3623 Online
109993 Solutions
New Discussion

#!/usr/bin/ksh, however ksh does not show up in ps

 
Michael Schulte zur Sur
Honored Contributor

#!/usr/bin/ksh, however ksh does not show up in ps

Hi,

I start a script by crontab and I check whether it is still running with the code below. However now ps shows no more ksh.
What can it be? I am using 5.1A PK3

hub 588838 678911 0.0 23:00:00 ?? 0:00.01 /teamhub/prod/app/xfac
e/bat/xface.teamdata_monitor


function check_if_xface_is_running
{
if test `ps -eo pid,command | grep "ksh.*teamdata_monitor" | grep -v grep | wc
-l` -gt 1
then
return 1
fi
return 0
}
2 REPLIES 2
Ralf Puchner
Honored Contributor

Re: #!/usr/bin/ksh, however ksh does not show up in ps

Here is what I see under TRU64 4.0F
# ps -u sys_vf
PID TTY S TIME CMD
22726 ttyq6 I N 0:00.01 ksh ./sl.ksh
30689 ttyq6 I N 0:00.01 sleep 1440
31463 ttyq6 S 0:00.07 -ksh (ksh)

Here is what I see under TRU64 5.1
# ps -u sys_vf
PID TTY S TIME CMD
6271 console I + 0:00.14 -ksh (ksh)
72243 pts/1 S 0:00.20 -ksh (ksh)
75753 pts/1 I N 0:00.01 ./sl.ksh
75754 pts/1 I N 0:00.01 sleep 1440

Changes depend on:
Tru64 > 5.x use parenthesis when the child had a child process, parent displayed to the left if not, the -child is displayed
(here -ksh (ksh))

So it is a well known feature not a bug.
Help() { FirstReadManual(urgently); Go_to_it;; }
Michael Schulte zur Sur
Honored Contributor

Re: #!/usr/bin/ksh, however ksh does not show up in ps

Hi Ralf,

thanks for your info. This explains, why my check does not work anymore. However, I am not happy about it. :-(

best regards

Michael