Managing Server Processes Using the OpenDJ Control Panel, you can start and stop local servers. You can also start and stop OpenDJ using command-line tools, and use the operating system's capabilities for starting OpenDJ at boot time. This chapter demonstrates how to start and stop server processes with command line tools and using operating system capabilities. This chapter also describes what OpenDJ directory server does during startup and shutdown, and how it recovers following an abrupt shutdown such as happens during a system crash or when you kill the server process using system tools.
Starting a Server Use one of the following techniques. Use the start-ds command. $ OpenDJ/bin/start-ds Alternatively, you can specify the --no-detach option to start the server in the foreground. (UNIX) Create an RC script, and then use the script to start the server. Unless you run OpenDJ as root, use the -u userName option to specify the user who installed OpenDJ. $ sudo OpenDJ/bin/create-rc-script -f /etc/init.d/opendj -u mark [sudo] password for mark: $ sudo /etc/init.d/opendj start For example, on Linux if you run OpenDJ as root, you can use the RC script to start the server at system boot, and stop the server at system shutdown. $ sudo update-rc.d opendj defaults update-rc.d: warning: /etc/init.d/opendj missing LSB information update-rc.d: see <http://wiki.debian.org/LSBInitScripts> Adding system startup for /etc/init.d/opendj ... /etc/rc0.d/K20opendj -> ../init.d/opendj /etc/rc1.d/K20opendj -> ../init.d/opendj /etc/rc6.d/K20opendj -> ../init.d/opendj /etc/rc2.d/S20opendj -> ../init.d/opendj /etc/rc3.d/S20opendj -> ../init.d/opendj /etc/rc4.d/S20opendj -> ../init.d/opendj /etc/rc5.d/S20opendj -> ../init.d/opendj (Windows) Register OpenDJ as a Windows Service, and then manage the service through Windows administration tools. C:\Users\Mark> OpenDJ\bat\windows-service.bat --enableService
Stopping a Server Use one of the following techniques. Use the stop-ds command. $ OpenDJ/bin/stop-ds (UNIX) Create an RC script, and then use the script to stop the server. $ sudo OpenDJ/bin/create-rc-script -f /etc/init.d/opendj -u mark [sudo] password for mark: $ sudo /etc/init.d/opendj stop (Windows) Register OpenDJ as a Windows Service, and then manage the service through Windows administration tools. C:\Users\Mark> OpenDJ\bat\windows-service.bat --enableService
Restarting a Server Use one of the following techniques. Use the stop-ds command. $ OpenDJ/bin/stop-ds --restart (UNIX) Create an RC script, and then use the script to stop the server. $ sudo OpenDJ/bin/create-rc-script -f /etc/init.d/opendj -u mark [sudo] password for mark: $ /etc/init.d/opendj restart (Windows) Register OpenDJ as a Windows Service, and then manage the service through Windows administration tools. C:\Users\Mark> OpenDJ\bat\windows-service.bat --enableService
Server Recovery OpenDJ tends to show resilience when restarting after a crash or after the server process is killed abruptly. OpenDJ might have to replay the last few entries in a transaction log. Generally OpenDJ returns to service quickly. What can take some time during server startup is preloading database content into memory when the server starts. Objects cached in memory do not survive a crash.