*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Linux man pages -> dotlockfile (1)              



NAME    [Toc]    [Back]

       dotlockfile - Utility to manage lockfiles

SYNOPSIS    [Toc]    [Back]

       /usr/bin/dotlockfile  [-p]  [-c]  [-u] [-m] [-l|-u] [-r retries] [lock-

DESCRIPTION    [Toc]    [Back]

       Dotlockfile is a command line utility to safely create, test and remove
       lockfiles.  Lockfiles  are  created in an NFS-safe way. Dotlockfile can
       lock and unlock mailboxes even  if  the	mailspool  directory  is  only
       writable by group mail.

       The  name  dotlockfile  comes  from  the  way  mailboxes are locked for
       updates on a lot of UNIX systems. A lockfile is created with  the  same
       filename as the mailbox but with the string ".lock" appended.

       The names dotlock and lockfile were already taken - hence the name dot-
       lockfile :).

OPTIONS    [Toc]    [Back]

       -l     Create a lockfile. This is the default.

       -u     Remove a lockfile.

       -c     Check for the existence of a valid lockfile.

       -p     Write the process-id of the calling process into	the  lockfile.
	      Also  when  testing for an existing lockfile, check the contents
	      for a process-id to find out if the lockfile is still valid.

       -r retries
	      The number of times dotlockfile tries to acquire the lock before
	      giving  up.  The initial sleep after failing to acquire the lock
	      is 5 seconds.  After each next try, a sleep of 5	seconds  extra
	      occurs up to a maximum sleep of 60 seconds between tries.

       -m     Lock  or unlock the current users mailbox. The path to the mailbox
  is  the  default  system   mailspool   directory   (usually
	      /var/mail) with the username as gotten from getpwuid() appended.
	      If the environment variable $MAIL is set, that is used  instead.
	      Then  the  string  ".lock"  is  appended	to get the name of the
	      actual lockfile.

	      The lockfile to be created/removed, unless the -m option	is  in

RETURN VALUE    [Toc]    [Back]

       Zero  on  success,  and	non-zero on failure. For the -c option, sucess
       means that a valid lockfile  is	already  present.  When  locking  (the
       default,  or  the -l option) dotlockfile returns the same values as the
       library function lockfile_create(3).

NOTES    [Toc]    [Back]

       The lockfile is created exactly as  named  on  the  command  line.  The
       extension .lock is not automatically added.

       This  utility is a lot like the lockfile(1) utility included with proc-
       mail, and the mutt_dotlock(1) utility included with mutt.  However  the
       command-line  arguments	differ,  and  so does the return status. It is
       believed that dotlockfile is the most flexible implementation, since it
       automatically  detects  when it needs to use priviliges to lock a mailbox,
 and does it safely.

BUGS    [Toc]    [Back]

       None known.

SEE ALSO    [Toc]    [Back]

       lockfile_create(3), maillock(3)

AUTHOR    [Toc]    [Back]

       Miquel van Smoorenburg, miquels@cistron.nl

				 05 June 1999			DOTLOCKFILE(1)
[ Back ]
 Similar pages
Name OS Title
devswmgr Tru64 utility to manage the device switch database
espreport IRIX 0espreport is a utility provided for viewing various reports from ESP on the command line. This utility bypass
espconfig IRIX 0espconfig is a utility provided for the configuration ESP from the command line. This utility bypasses the we
clipboard IRIX Manage the clipboard
pdbedit.8 IRIX manage the SAM database
vlcreatepath IRIX manage VL paths
fs OpenBSD Manage AFS directories
vlgetconnection IRIX manage the connectivity of a VL path
ktutil OpenBSD manage Kerberos keytabs
snkadm OpenBSD manage the ActivCard, CRYPTOCard and
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service