- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how to find effective gid of running process
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
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
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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
тАО11-12-2003 08:49 AM
тАО11-12-2003 08:49 AM
( actually, the effective gid at the time the process was started)
I've been looking for a way to use the ps command. The ps man page says the gid and group columns in the output give this info, but none of the ps output format options described in the man page actually generate those columns in the output. Unles of course I'm missing something...
- John
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-12-2003 08:59 AM
тАО11-12-2003 08:59 AM
Re: how to find effective gid of running process
What you can do is take the owner of the process and then get the primary gid of the user.
user=$(ps -ef | grep xxx | awk '{ print $1)')
# tweak required untested
gid=$(cat /etc/group | grep -i user | awk '{ print $3 }')
SEP
# this output will
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-12-2003 09:00 AM
тАО11-12-2003 09:00 AM
Re: how to find effective gid of running process
- John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-12-2003 09:02 AM
тАО11-12-2003 09:02 AM
Solution# export UNIX95=XPG4
# ps -ef -o user -o pid -o comm -o rgid -o gid
Where you will get real group ID from rgid and effective group ID from gid columns.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-12-2003 09:11 AM
тАО11-12-2003 09:11 AM
Re: how to find effective gid of running process
get GID
export UNIX95=XPG4
ps -efj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-12-2003 09:15 AM
тАО11-12-2003 09:15 AM
Re: how to find effective gid of running process
1) vendor's software started at boot via rc script gets started as root:root, but then vendor's GUI started from command line runs as root:sys and refuses to deal with the process because the effective gid is different. I work around this by running newgrp to change root's effective gid before running the GUI.
2) same vendor, application refuses to let user write to directory using (secondary) user group membership, only looks at users primary group.
3) current problem, same vendor, not sure what the cause is but guessing it is similar to 1 and 2 above, ... if their app is started at boot by rc script, then when user tries to connect to server there is a licensing problem, which I can get around by restarting the app from the command line. I'm suspecting that once again the effective gid at startup is not what their licensing daemon wants to see.
- John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-12-2003 09:17 AM
тАО11-12-2003 09:17 AM
Re: how to find effective gid of running process
ps -ef -o uid,comm,gid will give it to you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-12-2003 09:19 AM
тАО11-12-2003 09:19 AM
Re: how to find effective gid of running process
- John