- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- command name shown by ps command
Operating System - HP-UX
1753925
Members
8485
Online
108810
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
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
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
05-28-2003 01:11 AM
05-28-2003 01:11 AM
command name shown by ps command
Hi.
(I found this issue)
As you know some commands as 'ps' changes their behaviour when the environment variable UNIX95 is set.
I read in man pages that 'ps' command can show the 'command name' or the 'arguments' in the output according to '-o' option: For example:
UNIX95= ps -e -o comm
UNIX95= ps -e -o args
The most of people will assume that both outputs match... but it is not true because some commands change their names when launched, for instance, RAID manager instances.
When a RAID Manager instace is running, the running process name (instance) matches the extended regular expression
horcmd_[[:digit:]]+
for example horcmd_03.
To check if this process is running I type:
ps -ef | grep horcmd_
But I was surprised when I type d a slight variation of previous command line and found nothing:
ps -e | grep horcmd_03
I checked the PID and found that, in the second output, the running process (horcmd_03) is shown as 'horcmgr', not as 'horcmd_03'.
I inquired into this problem and found that the running process is actually launched by 'horcmgr' binary file.
I know that the running processes are create in two steps: fork() system call and exec() system call. exec() system calls allow to change the name of process name (argv[0] in C-syntax).
Then I understand that 'args' in 'ps' commands means 'argv[0], argv[1], ...) whereas 'comm' means 'original name of launched command'. '-f' and '-l' options are opposed in this aspect according to manual pages:
-f Show columns user, pid, ppid, cpu, stime, tty, time, and args, in that order.
-l Show columns flags, state, uid, pid, ppid, cpu, intpri, nice, addr, sz, wchan, tty, time, and comm, in that order.
The problem is that this assumptions is not true when UNIX95 is set because:
UNIX95= ps -e -o args
and
UNIX95= ps -e -o comm
show the 'args' not the 'comm', i.e, both preceding command lines show the same output...
I think this can be a bug.
What do you think ?
(I found this issue)
As you know some commands as 'ps' changes their behaviour when the environment variable UNIX95 is set.
I read in man pages that 'ps' command can show the 'command name' or the 'arguments' in the output according to '-o' option: For example:
UNIX95= ps -e -o comm
UNIX95= ps -e -o args
The most of people will assume that both outputs match... but it is not true because some commands change their names when launched, for instance, RAID manager instances.
When a RAID Manager instace is running, the running process name (instance) matches the extended regular expression
horcmd_[[:digit:]]+
for example horcmd_03.
To check if this process is running I type:
ps -ef | grep horcmd_
But I was surprised when I type d a slight variation of previous command line and found nothing:
ps -e | grep horcmd_03
I checked the PID and found that, in the second output, the running process (horcmd_03) is shown as 'horcmgr', not as 'horcmd_03'.
I inquired into this problem and found that the running process is actually launched by 'horcmgr' binary file.
I know that the running processes are create in two steps: fork() system call and exec() system call. exec() system calls allow to change the name of process name (argv[0] in C-syntax).
Then I understand that 'args' in 'ps' commands means 'argv[0], argv[1], ...) whereas 'comm' means 'original name of launched command'. '-f' and '-l' options are opposed in this aspect according to manual pages:
-f Show columns user, pid, ppid, cpu, stime, tty, time, and args, in that order.
-l Show columns flags, state, uid, pid, ppid, cpu, intpri, nice, addr, sz, wchan, tty, time, and comm, in that order.
The problem is that this assumptions is not true when UNIX95 is set because:
UNIX95= ps -e -o args
and
UNIX95= ps -e -o comm
show the 'args' not the 'comm', i.e, both preceding command lines show the same output...
I think this can be a bug.
What do you think ?
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2003 01:16 AM
05-28-2003 01:16 AM
Re: command name shown by ps command
sorry... the nearest paragraphs above and below the command lines
UNIX95= ps -e -o comm
UNIX95= ps -e -o args
at the beginning of my discussion, are wrong.
Then ignore the following paragraphs:
"I read in man pages that 'ps' command can show the 'command name' or the 'arguments' in the output according to '-o' option: For example:
UNIX95= ps -e -o comm
UNIX95= ps -e -o args
The most of people will assume that both outputs match... but it is not true because some commands change their names when launched, for instance, RAID manager instances."
UNIX95= ps -e -o comm
UNIX95= ps -e -o args
at the beginning of my discussion, are wrong.
Then ignore the following paragraphs:
"I read in man pages that 'ps' command can show the 'command name' or the 'arguments' in the output according to '-o' option: For example:
UNIX95= ps -e -o comm
UNIX95= ps -e -o args
The most of people will assume that both outputs match... but it is not true because some commands change their names when launched, for instance, RAID manager instances."
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.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP