


Software and hardware errors can sometimes result in the stranding of data files opened by AcuServer. AcuServer is equipped to detect and close files associated with client applications that terminate abnormally with a Control-C or "kill" signal, but other application or system failures may result in stranded files. For instance, if a client system using AcuServer suddenly crashes, all files held open by AcuServer for that client remain open, and remain unavailable to others. "acuserve -unlock" provides a mechanism for closing these stranded files.
To use "-unlock" you must be logged onto a UNIX server as root or superuser or onto a Windows NT or Windows 2000 server from an account that belongs to the Administrators group.
Before you use "-unlock" it is best to generate a current AcuServer status report using "acuserve -info". The status report provides a complete list of open files on the server, including client name, user name, PID, FID, file type, and the file name of each open file. With information from this report, you can use "-unlock" to close specific files.
The "-unlock" command syntax is:
acuserve -unlock [server] [-a] [-c client [-u user] [-p PID]] [-f FID] [-n port]
"-unlock" has two modes of operation: an interactive mode, in which the user is prompted for information about the files to be closed; and a command line mode, in which the user specifies all of the requisite information as additional arguments on the command line.
Interactive mode
To initiate interactive mode, enter:
acuserve -unlock [server] [-n port]
The absence of other options triggers interactive mode. If the server option is omitted, the server is assumed to be the current host. If the -n port option is omitted, the port number is assumed to be "6523".
Interactive mode prompts the user for specific information that describes the files to be closed (any locks are removed). The more general the information entered, the larger the classification of files to be closed. For example, if only a client name is given, then all files associated with the client will be closed (see the examples that follow).
After prompting for information, interactive mode redisplays the information entered and prompts for confirmation before closing any files.
The following examples demonstrate how interactive mode can be used to close specific files and classes of files. When interactive mode is entered, the unlock program displays the following text:
This program allows you to force acuserve to unlock and close a single file or group of files. To unlock and close a single file, enter the file's unique hexadecimal identifier (FID). Leave the FID blank if you want to specify files by client name, user name or process identifier (PID). Enter FID []:
To close a single file, enter the file ID at the prompt.
Enter FID []: 5fb58
The unlock program then redisplays the information and prompts for confirmation.
Server : condor Port Number : 6523 FID : 5fb58 Is this correct [N]:
If you enter "y" (or "Y", "YES", "yes") the program will unlock and close the file and report the results:
acuserve: unlocked and closed 1 file(s) on: condor
To close all files open on the server, leave the FID prompt blank and accept the default value "ALL" for the client machine name prompt:
Enter FID []: Enter client machine name [ALL]:
The program then redisplays your entry and prompts for confirmation:
Server : condor Port Number : 6523 Client : ALL Is this correct [N]:
To close all files held open by a single client, leave the FID prompt blank, specify the client machine name at the client machine name prompt, and accept the default value "ALL" at the user name prompt:
Enter FID []: Enter client machine name [ALL]: starling Enter name of user [ALL]:
The program then redisplays your entry and prompts for confirmation:
Server : condor Port Number : 6523 Client : starling User : ALL Is this correct [N]:
To close all files associated with a specific user on a specific machine, leave the FID prompt blank, specify the client machine name at the client machine name prompt, specify the user name at the user name prompt, and accept the default value "ALL" at the PID prompt:
Enter FID []: Enter client machine name [ALL]: starling Enter name of user [ALL]: bernie Enter PID [ALL]:
The program then redisplays your entry and prompts for confirmation:
Server : condor Port Number : 6523 Client : starling User : bernie PID : ALL Is this correct [N]:
To close all files associated with a single PID, leave the FID prompt blank, specify the client machine name at the client machine name prompt, specify the user name at the user name prompt, and specify the PID at the PID prompt:
Enter FID []: Enter client machine name [ALL]: starling Enter name of user [ALL]: bernie Enter PID [ALL]: 1726
The program then redisplays your entry and prompts for confirmation:
Server : condor Port Number : 6523 Client : starling User : bernie PID : 1726 Is this correct [N]:
Command line mode
Command line mode requires that the description of the files to be closed be specified as options to "-unlock" on the command line. The unlock and close actions are carried out immediately, without a prompt for confirmation, and the results are reported. Command line mode is well suited to use in shell scripts and batch files that are run without user input.
To unlock and close a specific file you would enter:
acuserve -unlock [server] -f FID
The unlock program closes the file and reports its actions:
acuserve: unlocked and closed 1 file(s) on: condor
To unlock and close all files associated with a PID, enter:
acuserve -unlock [server] -c client -p PID
To unlock and close all files associated with a single user on a client, enter:
acuserve -unlock [server] -c client -u user
To unlock and close all files associated with a client, enter:
acuserve -unlock [server] -c client
To unlock and close all files on the file server, enter:
acuserve -unlock [server] -a
Note that closing all files requires the "-a" option.