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 choice.Please help me with the code.
after the changing the files in the directory it should get locked again with the below command.
Last edited by bhas85; 01-31-2014 at 04:18 AM..
Reason: extra AND has added in the subject line after unlock
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)
When I want to use the editor ,whether vi or textedit,it prompts for entering a key. How can I disable this function?many thanks for offering solutions! (1 Reply)
I only able to lock user ID with passwd -l username
It seems there is no option for me to unlock ID in solaris?
Is there any command as below?
passwd -u username
Appreciate someome can share with me the way to do it. (1 Reply)
When I do HMC upgrade, I download HMC code from IBM web site and burn it to a DVD disk, when I get the first DVD out of HMC's dvd rom and input the second DVD, it shows error:
The requested device is already locked by the process: Install Corrective Service.
Would you like to try to request a... (2 Replies)
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)
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)
I'm running cygwin bash on Windows 8.1. I would like to to write a OS neutral bash script that uses the commands like lock, block and unlock.
Do I need to write lock, block and unlock myself in C++?
I'm hoping someone has already written them.
My bash script would look something like this:... (2 Replies)
Hello,
It is to my understanding that when configuring the Solaris operating system to meet compliance standards, you must configure the "LOCK_AFTER_RETRIES" value in the "/etc/security/policy.conf" file to "YES", and then configure the "RETRIES" parameter in the "/etc/default/login" file to the... (4 Replies)
I use Debian default encryption disk encryption. Only /boot it's not encrypted. When I boot I need to type my password, and then I will be logged in. But now I can't login. It always says that I typed the wrong password, but I typed the correct password.
I tried to boot in live-CD and try unlock... (3 Replies)
Discussion started by: zognadal
3 Replies
LEARN ABOUT PLAN9
lock
LOCK(2) System Calls Manual LOCK(2)NAME
lockinit, lock, canlock, unlock - shared memory spin lock
SYNOPSIS
#include <lock.h>
void lockinit(void);
void lock(Lock *lk);
int canlock(Lock *lk);
void unlock(Lock *lk);
/* Alef only */
adt Lock
{
void lock(*Lock);
void unlock(*Lock);
int canlock(*Lock);
};
adt QLock
{
void lock(*Lock);
void unlock(*Lock);
int canlock(*Lock);
};
adt RWlock
{
void Rlock(*RWlock);
void Runlock(*RWlock);
void Wlock(*RWlock);
void Wunlock(*RWlock);
};
adt Ref
{
int inc(*Ref);
int dec(*Ref);
int ref(*Ref);
};
DESCRIPTION
These routines are used by processes sharing memory to synchronize using spin locks. Lockinit must be called before the first use of the
other routines. Lock blocks until the lock has been obtained. Canlock is non-blocking. It tries to obtain a lock and returns a non-zero
value if it was successful, 0 otherwise. Unlock releases a lock.
Alef
Alef locks have similar functionality, but no special initialization is required. The ADT Lock has functions lock, unlock, and canlock,
just like locks in C. QLocks have the same interface but are not spin locks; instead if the lock is taken QLock.lock will suspend execu-
tion of the calling task until it is released.
Although Locks are the more primitive lock, their use is discouraged and even erroneous for most purposes. For example, Locks cannot syn-
chronize between tasks in the same proc. Use QLocks instead.
RWlocks manage access to a data structure that has distinct readers and writers. RWlock.Rlock grants read access; RWlock.Runlock releases
it. RWlock.Wlock grants write access; RWlock.Wunlock releases it. There may be any number of simultaneous readers, but only one writer.
Moreover, if write access is granted no one may have read access until write access is released.
Refs manage reference counters. Ref.inc increments the counter and returns the old value; Ref.dec decrements the counter and returns the
new value. Ref.ref returns the current value.
SOURCE
/sys/src/liblock
SEE ALSO
rfork in fork(2)LOCK(2)