HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- check process shell
Operating System - HP-UX
1837738
Members
3508
Online
110118
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2004 03:42 AM
04-30-2004 03:42 AM
check process shell
We have shells that send test orders through our production machines to confirm that all is OK (sometimes they hang for over 10min =problem). We use a method of execing the process in a sub-shell, saving PIDs in a temp file, and seeing if the pid file is still around after x minutes. We sometimes get false alarms due to timing (I think). Is there a better way to do this - c program with signal interrupts?
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2004 03:49 AM
04-30-2004 03:49 AM
Re: check process shell
If you have the PID's saved then simply do a
kill -0 ${PID} 2>/dev/null
STAT=${?}
if [[ ${STAT} -eq 0 ]]
then
echo "Still running"
else
echo "${PID} gone"
fi
This is exactly what one would do from C to determine if a process is still running.
kill -0 ${PID} 2>/dev/null
STAT=${?}
if [[ ${STAT} -eq 0 ]]
then
echo "Still running"
else
echo "${PID} gone"
fi
This is exactly what one would do from C to determine if a process is still running.
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2004 07:32 AM
04-30-2004 07:32 AM
Re: check process shell
Hello,
I once wrote a "parallelisation shell", one master and many extraction slave, the master checking the good ending of the child process with signal.
The master used two trap on user defined signal - and the child sended one signal on completion and another one on error.
It worked but I did get strange beheviour some time and ksh core dumped several time. Maybe it was due to the signal choice, I ended changing for rather less elegant but more stable choice of flag file with list of process.
I guess the file solution can be as bad as the signal solution if a bunch of process want to write at the exact same time. But in your case, it's probably the good way to go.
Cheers
Nicolas
I once wrote a "parallelisation shell", one master and many extraction slave, the master checking the good ending of the child process with signal.
The master used two trap on user defined signal - and the child sended one signal on completion and another one on error.
It worked but I did get strange beheviour some time and ksh core dumped several time. Maybe it was due to the signal choice, I ended changing for rather less elegant but more stable choice of flag file with list of process.
I guess the file solution can be as bad as the signal solution if a bunch of process want to write at the exact same time. But in your case, it's probably the good way to go.
Cheers
Nicolas
All different, all Unix
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP