Sponsored Content
Full Discussion: How to Lock In HP-UX
Operating Systems HP-UX How to Lock In HP-UX Post 302078435 by jim mcnamara on Friday 30th of June 2006 11:39:07 AM
Old 06-30-2006
hpux does not have mandatory locking - that means every process that opens the file has to play by the rules. So, if you lock your file, then run another program that does not play by those rules, the lock will not work. It's like obeying a traffic light. Some people break the rules and do not stop on red. There is no physical barrier to stop them - a physical barrier at a traffic light is like manadtory locking. They cannot run the red light/They can't play with the file no matter what

Please show your code.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to lock keyboard without using lock command

how can I lock my keyboard while I'm away from the computer without using lock command. What other commands gives me the option to lock keyboard device? thanks (7 Replies)
Discussion started by: dianayun
7 Replies

2. UNIX for Dummies Questions & Answers

Lock File

Hi, We have a lock file being created called lck8c0001 created in Unixware 2.1.2. This is locking a printer. According to some websites, 8c0001 relates to the device name. How does one link 8c0001 to those devices listed in the /dev folder? I have done a ps -lp for all printers and have... (4 Replies)
Discussion started by: canman
4 Replies

3. Shell Programming and Scripting

Lock for this script

Hi, My requirement is to service a process and below is the script which i wrote for that and works fine, I have kept it in a crontab and running this everyminute, how do I lock this if its already running and i dont want to open if its running and not completed yet. The crontab need to run... (4 Replies)
Discussion started by: strunz
4 Replies

4. Shell Programming and Scripting

lock an account

hi how can I Lock an account, by prepending ”*LK*” to the password field in /etc/shadow. I dont want to use passwd -l . Any idea? (3 Replies)
Discussion started by: tjay83
3 Replies

5. Solaris

Not able to lock the port

Hi, I am working with Sun-Solaris 9 and in our application I need to connect the UPS with Serial port,after that I need to monitor it..but before stating communication,It should lock that port,To check it,first i am trying to make sure the lock directory exists and I am able to find it(/var/lock)... (0 Replies)
Discussion started by: smartgupta
0 Replies

6. Red Hat

Security Question: Lock after invalid login, Session Lock and Required Minimum Password Length

Hello all, If anyone has time, I have a few questions: How do I do the following in Linux. We are using Red Hat and Oracle Enterprise Linux, which is based on Red Hat too. 1. How to lock the account after a few (like 3) invalid password attempts? 2. How do you lock a screen after 30... (1 Reply)
Discussion started by: nstarz
1 Replies

7. UNIX for Advanced & Expert Users

Testing privileges -lock lockfile /var/lock/subsys/..- Permission denied

Hi all, I have to test some user priviliges. The goal is to be sure that an unauthorized user can't restart some modules (ssh, mysql etc...). I'm trying to automate it with a shell script but in same cases I got the syslog broadcast message. Is there any way to simply get a return code... (3 Replies)
Discussion started by: Dedalus
3 Replies

8. Shell Programming and Scripting

lock on files

Hi, I want to write a code where in the file once taken genrates a lock number and other developer/user cannot take the file to make any changes in it. He gets the file only as read only. (2 Replies)
Discussion started by: rac
2 Replies

9. Ubuntu

Help me to lock my system.

Hi All! I am not able to lock my Ubuntu 12.04 LXDE. Can anybody tell me the shortcut to lock the system. I have tried all conventional keyboard shortcuts as well as buttons. (2 Replies)
Discussion started by: nixhead
2 Replies

10. Shell Programming and Scripting

Need help in lock and unlock and after the changes

Requirement:First i need to unlock the directory which i had a script for it.If i select app1 it should unlock the directory and after chnages in the script once need to lock the directory with lock command The below highlighed variables in lock and unlock has to be changed according... (2 Replies)
Discussion started by: bhas85
2 Replies
dotlock(1)							Mail Avenger 0.8.3							dotlock(1)

NAME
dotlock - execute a command with a lock on a mailbox SYNOPSIS
dotlock [-LPW] mbox-file command [arg ...] DESCRIPTION
dotlock acquires a lock on the mailbox file mbox-file using both flock and a lock file, then executes command with any arguments specified. When command exits, dotlock releases the lock. dotlock attempts to clean up stale lockfiles. If it succeeds in locking an mbox-file with flock, and roughly 30 seconds elapse without there being any changes to mbox-file or the lockfile, then dotlock will delete the lockfile and try again. While it holds a lock, lockfile will keep updating the modification time of the lockfile every 15 seconds, to prevent the lock from getting cleaned up in the event that command is slow. OPTION --noflock (-L) Ordinarily, dotlock uses both flock and dotfile locking. (It uses flock first, but releases that lock in the even that dotfile locking fails, so as to avoid deadlocking with applications that proceed in the reverse order.) The -L option disables flock locking, so that dotlock only uses dotfile locking. This is primarily useful as a wrapper around an application that already does flock locking, but to which you want to add dotfile locking. (Even if your mail delivery system doesn't use flock, flock actually improves the efficiency of dotlock, so there is no reason to disable it.) --fcntl (-P) This option enables fcntl (a.k.a. POSIX) file locking of mail spools, in addition to flock and dotfile locking. The advantage of fcntl locking is that it may do the right thing over NFS. However, if either the NFS client or server does not properly support fcntl locking, or if the file system is not mounted with the appropriate options, fcntl locking can fail in one of several ways. It can allow different processes to lock the same file concurrently--even on the same machine. It can simply hang when trying to acquire a lock, even if no other process holds a lock on the file. Also, on some OSes it can interact badly with flock locking, because those OSes actually implement flock in terms of fcntl. --nowait (-W) With this option, dotlock simply exits non-zero and does not run command if it cannot immediately acquire the lock. SEE ALSO
avenger(1), deliver(1), avenger.local(8) The Mail Avenger home page: <http://www.mailavenger.org/>. BUGS
dotlock does not perform fcntl/lockf-style locking by default. Thus, if your mail reader exclusively uses fcntl for locking, there will be race conditions unless you specify the --fcntl option. flock does not work over network file systems. Thus, because of dotlock's mechanism for cleaning stale lock files, there is a possibility that a network outage could lead to a race condition where the lockfile is cleared before command finishes executing. If lockfile detects that the lock has been stolen, it prints a message to standard error, but does not do anything else (like try to kill command). AUTHOR
David Mazieres Mail Avenger 0.8.3 2012-04-05 dotlock(1)
All times are GMT -4. The time now is 07:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy