Sponsored Content
Full Discussion: Stateless process
Top Forums Shell Programming and Scripting Stateless process Post 302853107 by MDominok on Friday 13th of September 2013 08:32:37 AM
Old 09-13-2013
Stateless process

Hi Folks

I'm trying to monitor that a process is running, using ps.

Astonishingly the process, which is checked every 15 minutes, is runnnig but without a state about 2-3 times a day.

Extract from the script :
Code:
#!/bin/ksh

# edii_pid is PID of process to monitor.

# Checking if pid is listed in hosts processes.
# tr used for getting rid of potential leading blanks.
edii_pid_listed=`ps -p ${edii_pid} -o pid | grep -v "^  PID" | tr -d ' '`

if [[ ${edii_pid_listed} != ${edii_pid} ]]; then
  # So PID is listed, exists. In fact the process/application is runnig
  # for several days continuously.

  # Checking if pid is in running (=0) state.
  # tr used for getting rid of potential leading blanks.
  edii_pid_runnning=`ps -p ${edii_pid} -o s | grep -v "^S" | tr -d ' '`
  if [[ ${edii_pid_runnning} != 'O' ]]; then
    print "${edii_pid} isn't in running (O) state but ${edii_pid_runnning}!" 
  fi
fi

And for about 2-3 times a day i get this :
Code:
PID 2939 isn't in running (O) state but !

Any hints why a process that is running for days, has been "seen" in list of processes only microseconds before querying the state is stateless?

System is SunOS 5.10 Generic_148888-03 sun4v sparc SUNW,SPARC-Enterprise-T5220

Cheers

Michael
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script to monitor process running on server and posting a mail if any process is dead

Hello all, I would be happy if any one could help me with a shell script that would determine all the processes running on a Unix server and post a mail if any of the process is not running or aborted. Thanks in advance Regards, pradeep kulkarni. :mad: (13 Replies)
Discussion started by: pradeepmacha
13 Replies

2. Shell Programming and Scripting

Shell Script to Kill Process(number of process) Unix/Solaris

Hi Experts, we do have a shell script for Unix Solaris, which will kill all the process manullay, it used to work in my previous env, but now it is throwing this error.. could some one please help me to resolve it This is how we execute the script (and this is the requirement) ... (2 Replies)
Discussion started by: jonnyvic
2 Replies

3. Shell Programming and Scripting

script to monitor the process system when a process from user takes longer than 15 min run.

get email notification from from system when a process from XXXX user takes longer than 15 min run.Let me know the time estimation for the same. hi ,any one please tell me , how to write a script to get email notification from system when a process from as mentioned above a xxxx user takes... (1 Reply)
Discussion started by: kirankrishna3
1 Replies

4. Homework & Coursework Questions

Protect service with statefull, stateless

how to protect service dns with filtering tables (statefull, stateless)? iptables -L iptables ...? (1 Reply)
Discussion started by: nini
1 Replies

5. BSD

Process remians in Running state causing other similar process to sleep and results to system hang

Hi Experts, I am facing one problem here which is one process always stuck in running state which causes the other similar process to sleep state . This causes my system in hanged state. On doing cat /proc/<pid>wchan showing the "__init_begin" in the output. Can you please help me here... (0 Replies)
Discussion started by: naveeng
0 Replies

6. UNIX for Advanced & Expert Users

Process remians in Running state causing other similar process to sleep and results to system hang

Hi Experts, I am facing one problem here which is one process always stuck in running state which causes the other similar process to sleep state . This causes my system in hanged state. On doing cat /proc/<pid>wchan showing the "__init_begin" in the output. Can you please help me here... (1 Reply)
Discussion started by: naveeng
1 Replies

7. UNIX for Advanced & Expert Users

Process remians in Running state causing other similar process to sleep and results to system hang

Hi Experts, I am facing one problem here which is one process always stuck in running state which causes the other similar process to sleep state . This causes my system in hanged state. On doing cat /proc/<pid>wchan showing the "__init_begin" in the output. Can you please help me here... (6 Replies)
Discussion started by: naveeng
6 Replies

8. Shell Programming and Scripting

Monitoring processes in parallel and process log file after process exits

I am writing a script to kick off a process to gather logs on multiple nodes in parallel using "&". These processes create individual log files. Which I would like to filter and convert in CSV format after they are complete. I am facing following issues: 1. Monitor all Processes parallelly.... (5 Replies)
Discussion started by: shunya
5 Replies

9. Shell Programming and Scripting

Command to get exact tomcat process I am running ignoring other java process

Team, I have multiple batchjobs running in VM, if I do ps -ef |grep java or tomcat I am getting multiple process list. How do I get my exact tomcat process running and that is unique? via shell script? (4 Replies)
Discussion started by: Ghanshyam Ratho
4 Replies
serialize(1)						      General Commands Manual						      serialize(1)

NAME
serialize - force target process to run serially with other processes SYNOPSIS
command [command_args] pid] DESCRIPTION
The command is used to force the target process to run serially with other processes also marked by this command. The target process can be referred to by pid value, or it can be invoked directly on the command. Once a process has been marked by the process stays marked until process completion unless is reissued on the serialized process with the option. The option causes the pid specified with the option to return to normal timeshare scheduling algorithms. This call is used to improve process throughput, since process throughput usually increases for large processes when they are executed serially instead of allowing each program to run for only a short period of time. By running large processes one at a time, the system makes more efficient use of the CPU as well as system memory, since each process does not end up constantly faulting in its working set, to only have the pages stolen when another process starts running. As long as there is enough memory in the system, processes marked by behave no differently from other processes in the system. However, once memory becomes tight, processes marked by are run one at a time with the highest priority processes being run first. Each process will run for a finite interval of time before another serialized process is allowed to run. Options supports the following options: Indicates the process specified by pid should be returned to timeshare scheduling. Indicates the pid of the target process. If neither option is specified, is invoked on the command line passed in. RETURN VALUE
returns the following value: Successful completion. Invalid pid specification, nonnumeric entry, or pid specification is that of a special system process. Could not execute the specified command. No such process. Must be root or a member of a group having the privilege to execute ERRORS
fails under the following condition and sets (see errno(2)) to the following value: The pid passed in does not exist. EXAMPLES
Use to force a database application to run serially with other processes marked for serialization: Force a currently running process with a pid value of 215 to run serially with other processes marked for serialization: Return a process previously marked for serialization to normal timeshare scheduling. The pid of the target process for this example is WARNINGS
The user has no way of forcing an execution order on serialized processes. AUTHOR
was developed by HP. SEE ALSO
setprivgrp(1M), getprivgrp(2), serialize(2). serialize(1)
All times are GMT -4. The time now is 07:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy