wiki:Restarting

Checking your server process

You can check the server process using the 'ps' command as follows :

  • PS on Leopard ps -ef |grep java
  • PS on Tiger ps -aux |grep java
polaris:~ alex$ ps -ef |grep java
    0  1383  1380   0   0:06.21 ??         0:51.88 /System/Library/Frameworks/JavaVM.framework/Home/bin/java -Xmx512M -Xms64M -XX:MaxPermSize=384M -Dfile.encoding=UTF-8 
-DH2_TCP_PORT=48081 -DH2_WEB_PORT=48082 -Dorg.apache.el.parser.COERCE_TO_ZERO=false -Dcom.addressbookserver.ENABLE_BONJOUR=true 
-Dcom.addressbookserver.ENABLE_H2=true -Dcom.addressbookserver.H2_DATABASE=../db -Dcom.addressbookserver.H2_BACKUPS=../backups 
-Dcom.sun.management.jmxremote -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 
-Djava.util.logging.config.file=/usr/share/addressBookServerEnterpriseEdition/apache-tomcat-6.0.18/conf/logging.properties 
-Djava.endorsed.dirs=/usr/share/addressBookServerEnterpriseEdition/apache-tomcat-6.0.18/endorsed 
-classpath :/usr/share/addressBookServerEnterpriseEdition/apache-tomcat-6.0.18/bin/bootstrap.jar
-Dcatalina.base=/usr/share/addressBookServerEnterpriseEdition/apache-tomcat-6.0.18 -Dcatalina.home=/usr/share/addressBookServerEnterpriseEdition/apache-tomcat-6.0.18 -Djava.io.tmpdir=/usr/share/addressBookServerEnterpriseEdition/apache-tomcat-6.0.18/temp org.apache.catalina.startup.Bootstrap start
  501  1806  1795   0   0:00.00 ttys002    0:00.00 grep java
polaris:~ alex$ 

The second number is the process ID which you can use to terminate the process should the ordered stop command fail to stop the process.

Restarting Address Book Server

You need to switch to the root user using sudo bash this will prompt for the Administrator password. To stop and start Address Book Server use the launchctl scripts as shown in the examples below:

Stopping

This will stop the currently running background service and prevent it from being restarted after a reboot. You can verify that the process has been stopped using the PS command. If the process fails to stop fully try the commands described in the next section (Terminating).

wolf:~ alex$ sudo bash
Password:
bash-3.2# launchctl unload /Library/LaunchDaemons/com.addressBookServer.enterprise.plist

Terminating

Only terminate the process once you have tried to stop Address Book Server using the stop command. To stop the process you need the process ID obtained via the PS command. If the process is still configured to run as a service it can happen that it is automatically restarted. To prevent it from being restarted automatically use the unload command from the stop section. Once successfully unloaded, try terminating the process again.

wolf:~ alex$ sudo bash
Password:
bash-3.2# ps -ef |grep java
    0  1383  1380   0   0:06.21 ??         0:51.88 /System/Library/Frameworks/JavaVM.framework/Home/bin/java -Xmx512M -Xms64M -XX:MaxPermSize=384M -Dfile.encoding=UTF-8 ...
bash-3.2# kill 1383
bash-3.2# ps -ef |grep java
bash-3.2#

Starting

After installing Address Book Server it will run in the background as a service . Should it be required to initiate the process to run as a service the following commands can be used. This enables automatic startup after reboot as well.

wolf:~ alex$ sudo bash
Password:
bash-3.2# launchctl load /Library/LaunchDaemons/com.addressBookServer.enterprise.plist 

Starting in Debug Mode

If the server does not startup automatically there could be a problem with the configuration. To diagnose the problems have a look in the Console (/Applications/Utilities/Console.app) for any obvious error messages. If this does not provide any insight to the cause of the problem, try starting the server manually using the commands above. If this also does not remedy the problem try starting the server in debug mode. To do this enter the following commands in Terminal on the server itself.

wolf:~ alex$ sudo bash
Password:
bash-3.2# cd /usr/share/addressBookServerEnterpriseEdition/apache-tomcat-6.0.24/bin
bash-3.2# ./catalina.sh run

This will produce a lot of output messages which will highlight any problems. If you not sure what to make of it, please forward those on to  Support. To quit out of debug mode press CTRL+C. This will stop Address Book Server from running, and allow you to start it up in service/background mode.