Purge or rebuild the USAGE file

APPX records session and product usage in the System Administration USAGE file. When a session exits abnormally, the License Server can remove the stale usage entries while APPX is running. A damaged file needs an offline rebuild. These procedures apply to the System Administration APPXIO file pair USAGE.dat and USAGE.key.

Check the reported entry

Open System Administration > System Setup > System Registration > View Registration Usage. Compare the users and login times with the interactive sessions and background jobs on each APPX server that shares these files. A normal logout releases that session's usage. A registration row can remain after an abnormal exit. A row alone does not establish that a license is in use or that someone holds a business record lock.

For one user with a locked record, follow Removing inactive sessions. Ending the confirmed session releases its locks. For one old row, record its server, user, workstation, PID and login time. Confirm on that host that the original engine has exited. The usage screen is an inquiry with no Delete action. The License Server checks all eligible entries, including any others that became stale.

Clear stale entries online

Check the engine release on the host that runs the License Server. In the final 4.1.4 release, in the later 4.1 maintenance releases, and in 4.2, 5.x and 6.x, the normal License Server checks for stale entries on startup and again at intervals. The default interval is two minutes. On a running installation, leave the server running, allow a check to finish, and reopen View Registration Usage. Confirm the stale session is gone and sessions you expect to see are still present.

The server checks whether APPX still holds each session's usage record. An idle interactive session, a reconnectable session or a background job keeps its entry while its APPX engine holds that record. If a confirmed stale row persists, verify that the License Server for this data path is running and check its log. If your site uses APPX_LS_NO_GHOSTS, its presence in that server's environment suppresses the scan, even with a value of 0. If the installation runs without a separate License Server, there is no server sweep to wait for. A change at a command prompt does not alter a running service. Check with the administrator responsible for this setting before changing how the service starts.

APPX 3.3 through 3.4.1 also performed periodic cleanup by default. Between those releases and final 4.1.4, the startup setting changed. The next procedure applies to builds that use the earlier opt-in. Confirm the exact build for a beta or locally patched engine.

Run one cleanup on a release that requires it

The earlier opt-in is documented for releases including 3.5.0, 4.0, 4.1.0 and 4.1.2. The 4.1.4 beta 2 still uses it. Use this procedure when the USAGE file is readable and the problem is abandoned entries. If APPX reports a damaged file, use the offline procedure below.

  1. Record the entries you expect to disappear and the sessions or jobs that should remain. Arrange a quiet period. A License Server restart can briefly interrupt new requests. Pause new logins and job launches so another login cannot start a different server during the restart. Let work that needs uninterrupted license checks finish first.
  2. On the designated License Server host, use the installation's normal service account, APPX data path, engine and writable license log. Stop only the identified License Server as described under Take the files offline. Leave active user engines, their locks, and the USAGE files in place.
  3. Start that same License Server with APPX_LS_GHOSTS in its environment. In a Unix shell, the following example sets it for just this launch.
    APPX_LS_GHOSTS=1 /usr/local/appx/appx -l=/usr/local/appx/data/license.log
    In a Windows Command Prompt opened under the account that normally runs the server, these two commands give the new process the same temporary setting.
    set "APPX_LS_GHOSTS=1"
    start "" "C:\APPX\appx.exe" "/l=C:\APPX\data\license.log"
    Keep the window available until you have verified the result. The server starts the sweep during its first operating cycle. Check that the intended server started and its log shows no error.
  4. From an existing administrator session, reopen View Registration Usage. Confirm the identified stale entries have cleared and the expected sessions remain. Stop the temporary License Server, then restart it through its normal startup procedure with the opt-in absent. If you reuse the Windows prompt, clear the setting with set "APPX_LS_GHOSTS=" first. Confirm normal operation before reopening logins and resuming job launches. On busy older systems, leaving continuous cleanup enabled can increase contention on the USAGE file.

Take the files offline for a rebuild

  1. Identify the effective APPXPATH for the affected installation and every host that uses its System Administration files. Record the release, the problem and the expected sessions. If the file can still be read, save the usage list for comparison.
  2. Arrange downtime. Prevent new logins on all of those hosts, pause scheduled APPX launches and let users log off and background jobs finish. For a service installed with Login Manager, stop each applicable listener by its installed service name. The following examples stop a listener named appx8060 from the APPX services directory.

    Unix

    ./appxLoginMgr -stop appx8060

    Windows Command Prompt

    appxLoginMgr.exe -stop appx8060
  3. Stop the License Server for these files if one is running. If a service manager controls it, stop the named service so it stays stopped.

    Manually started Unix server. For this server, find its PID in the startup message, confirm the engine path and its -l= log argument with ps -p 4260 -o pid,user,etime,args, then use kill -TERM 4260 with the verified PID.

    Windows server. Open Task Manager on the server, select Details and enable the Command line column. Match the running appx.exe by installation and its -l= or /l= license log argument, then select that row and choose End task.

    Confirm that the identified server has exited. Check the server process list on every participating host for remaining interactive, reconnectable and batch engines. Continue only when all processes using this set of files have exited. Stopping the listener alone still leaves existing sessions running.

Save and rebuild the pair

  1. Locate the 0SA/Data directory under the effective APPX data path. For example, with a Unix data path of /usr/local/appx/data, open /usr/local/appx/data/0SA/Data. With a Windows data path of C:\APPX\data, open C:\APPX\data\0SA\Data.
  2. Make a protected backup of USAGE.dat and USAGE.key together, preserving their ownership and permissions. Confirm that the backup contains both files and matches the originals. If either file is already missing, preserve what remains and have APPX Support assess it before continuing.
  3. Move just those two files from 0SA/Data into a new, empty holding directory on the same volume. Confirm that both are present in the holding directory and both original names are absent from 0SA/Data. If either move fails, restore the moved file while the installation is still offline.
  4. Keep general access closed. On the designated host, start the installation's License Server if your site starts it explicitly. On releases configured for automatic startup, start one normal APPX session on that host. If you use a listener for the test login, start it for the test operator only. When APPX opens the missing USAGE file, it creates a fresh pair. It reports an error if an existing file cannot be opened for another reason.

Check the result or restore

Check that the new USAGE.dat and USAGE.key exist in the original directory. Sign in with a test user, check View Registration Usage from an administrator session, then have the test user log out normally and refresh the display. Confirm the login succeeds and its entry clears. Reopen the remaining listeners and resume scheduled jobs once the test passes. For the example listener, use the same Login Manager command with -start appx8060.

If startup or the test login fails, keep general access closed and record the exact error. Check the data path, directory permissions and available disk space. To undo the change, repeat the shutdown, move any newly created USAGE files to a separate holding directory, and return the complete original pair to its original names with its original permissions. A damaged original pair still needs repair. Keep the saved copies and the failure message for APPX Technical Support.

To check the physical file before or after the rebuild, work on a separate copy of the pair taken while APPX is offline. In the directory containing that copy, run /usr/local/appx/appx -an=USAGE on Unix or C:\APPX\appx.exe -an=USAGE in a Windows Command Prompt, using the engine path for that release. At the BRF> prompt, enter VERIFY KEY #ALL, read the record and key counts, and enter QUIT. These counts include APPX housekeeping records.

The offline replacement was checked on Linux with APPX 5.5.4 and 6.2.1. For an older release or a different file layout, confirm the recovery procedure for that installation.

Comments:

Read what other users have said about this page or add your own comments.


 

This topic: APPX > WebHome > SystemAdministration > PurgingTheUSAGEFile
Topic revision: 03 Dec 2026, AdminUser
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding APPX Wiki? Send feedback