locks - test file locking on NOAH database
locks [OPTIONS]
This is a installation debug/verification program to help verify file locking is working as expected in a particular NOAH Documentation Database.
There may be a wrapper script in /usr/bin with noah- prefix that calls this program in the correct run directory.
File locking is used throughout the NOAH Documentation Database to ensure one user’s access does not conflict with another simultaneous access.
This program tests the locking functions used by NOAH in your operating environment.
-pause
set lock and pause waiting for an <ENTER>
-file
filename
Optional use filename as the lock file - instead of
using the database lock file.
This is useful if you are running multiple locks and you are testing independently of the database.
-database
DATABASE
Set the database to DATABASE. The default is default.
This is how locks figures out where the lock file is
unless using -file option and where the temp_dir
is.
-count N
repeat setting and clearing locks for N times with a
1 second pause between each lock and unlock
-log
log events to TEMP_DIR/locks.txt file’
-quiet
remove html head/tail and other verbose printing.
The html head/tail is useful if you want to debug a problem and call this program from a browser in the cgi-bin directory.
-h
quick help (usage)
-help
verbose help (this file)
This program is found in the admin directory and expects to be run from there.
In a Debian distribution, this program has a link to the wrapper program in the admin directory typically /usr/lib/noah/admin and the link name has a noah- prefix and is found in /usr/bin.
/usr/bin/locks
This is a link to wrapper
/usr/lib/noah/admin/wrapper
This is a generic bash shell wrapper to start the program in the admin directory.
/usr/lib/noah/admin/locks
This is the actual executable called by the wrapper.
/usr/lib/noah/database.config
This is typically a link to /etc/noah/database.config in a Debian release.
’temp_dir’/locks.txt
Log file.
locks -pause This will lock the default database. If you try to access the database to write data the browser will hang and wait for you to give locks a <ENTER> command.
NOTE: You can also test the lock by opening locks in another window and observe that it is pausing at the ’.. locking file’ line and will not proceed until you go back to the first window and hit <ENTER> to release the database lock.
Harold Blount - Nordicwind Inc. www.nordicwind.ca
http://noah.@nordicwind.ca
NOAH - Copyright (c) 2004-2012 Nordicwind Inc. All rights reserved. <http://www.nordicwind.ca>
This is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 or later <http://gnu.org/licenses/gpl.html>.
This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
no2path noah-help
Noah Document Management Server : http://noah.nordicwind.ca