Start/Stop an nJAMS instance#
This chapter describes how to start/stop an nJAMS instance. The nJAMS Installer creates start/stop scripts for all subsystems that have been installed. The scripts are available for Windows and Linux/Unix.
Use the following scripts to start/stop the nJAMS instance are located in <njams_installation_dir>\bin
Script
Description
startAll.sh
Starts all installed nJAMS components on this machine
stopAll.sh
Stops all installed nJAMS components on this machine
The correct shutdown of nJAMS Server is essential for the integrity of an nJAMS instance. An improper shutdown can lead to data loss. Hence, it’s important to use one of the official approaches for shutdown nJAMS Server.
Shutdown using nJAMS UI#
Go to “Administration” area and select “Deployment” tab. On this page click the SHUTDOWN button:
Shutdown from console using shutdown script#
nJAMS installer creates a shutdown script named njams-shutdown.sh in <njams_installation_dir>\bin
folder.
Run this script for triggering nJAMS shutdown process.
This script corresponds to clicking the SHUTDOWN button in nJAMS UI.
The script creates a shutdown marker file in nJAMS’s work folder and waits up to 30 seconds for nJAMS to complete shutdown.
Shutdown from console using nJAMS REST API#
For shutting down nJAMS Server via nJAMS REST API, you need to login to nJAMS Server with a user that has server-operator privilege and then execute the shutdown command.
Use the following curl snippets as reference:
curl -c cookiefile -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{
"username" : "<user>",
"password" : "<password>"
}' "http://<host>:<port>/njams/api/usermanagement/authentication/"
curl -b cookiefile -X DELETE -H "Cache-Control: no-cache" "http://<host>:<port>/njams/api/server/"
Killing nJAMS Server process#
Killing the nJAMS Server process should only be applied as last resort, if nJAMS is not responding at all or not shutting down by one of the previous procedures.
Warning
Killing nJAMS Server process can lead to data loss.
- Linux:
Use the following command for identifying the nJAMS Server process running in WildFly application server:
ps -ef | grep wildfly
Then kill the process using it’s PID found with the previous command:
kill -9 <PID>
- Windows:
On Windows systems use the task manager for finding the Java process that runs the WildFly application server. The according process can be identified by its command line, for instance containing option
-Dprogram.name=standalone.bat
or similar. Then right-click to stop that task.
Unsupported Stop options#
The following options commonly attempt to stop WildFly application server without shutting down the nJAMS services before and should NOT be used:
Using the WildFly command line interface (CLI)
Stopping WildFly from its management console application
Using kill (kill -15, or kill -SIGTERM) command. See information in the above section for using kill -9 or kill -SIGKILL
Stopping the WildFly Windows service (njams_wildflyXX)
Warning
All previous options are no proper way for shutting down nJAMS Server and should NOT be used. They most likely lead to data loss and hanging shutdown.
Recommendation#
When you use the internal database of nJAMS Server it is recommended to restart nJAMS Server from time to time. A restart will help to defragment and compress the internal database. However, this is just a recommendation to keep the internal database performant, it is not a must. This recommendation does not apply, when you use an external RDBMS.