- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Are there lock files for passwd/useradd/usermod/us...
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
Forums
Discussions
Discussions
Discussions
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
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
01-26-2004 08:07 AM
01-26-2004 08:07 AM
I know about /etc/ptmp, but it appears the system does not use it with passwd. Are there any other lock files the system uses when modifying passwd or shadow?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2004 08:14 AM
01-26-2004 08:14 AM
Re: Are there lock files for passwd/useradd/usermod/userdel ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2004 08:21 AM
01-26-2004 08:21 AM
Re: Are there lock files for passwd/useradd/usermod/userdel ?
From the tusc output, I found that it created two files .pwd.lock and ptmp under /etc and use lockf to lock them until it is done.
open("/etc/.pwd.lock", O_RDWR, 0177777) .................... = 3
lockf(3, 0x2, 0) ........................................... = 0
open("/etc/ptmp", O_WRONLY|O_CREAT|O_EXCL, 0) .............. = 5
setresuid(-1, 0, -1) ....................................... = 0
fchmod(5, 0444) ............................................ = 0
lockf(5, 0x2, 0) ........................................... = 0
But if you are using only passwd/useradd/usermod commands, then the system will take care of creating the locks.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2004 08:26 AM
01-26-2004 08:26 AM
SolutionMMYNAME=${0##*/}
if [ UNIX95= ps -C $MYNAME > /dev/null ]
then
print "\nAnother copy is running!\n"
exit 1
fi
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2004 08:34 AM
01-26-2004 08:34 AM
Re: Are there lock files for passwd/useradd/usermod/userdel ?
Its designed to work on files such as /etc/passwd and such.
It works quite nicely however on any file you don't want edited by another user while you are working on it.
SEP
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
01-26-2004 09:03 AM
01-26-2004 09:03 AM
Re: Are there lock files for passwd/useradd/usermod/userdel ?
passwd useradd usermod userdel chfn chsh vipw
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2004 09:07 AM
01-26-2004 09:07 AM
Re: Are there lock files for passwd/useradd/usermod/userdel ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2004 09:16 AM
01-26-2004 09:16 AM