How to Run WSO2 WSAS as a Unix Daemon
- Afkham Azeez
- VP - Cloud - WSO2
/etc/init.d wsas [start | stop | restart]
Answer:
Locate the daemon.sh script in the WSAS_HOME directory. Make sure that the daemon.sh file is executable;
cd $WSAS_HOME/bin chmod +x daemon.sh
Make sure that all the files in WSAS_HOME/bin/native are executable
cd $WSAS_HOME/bin/native chmod +x *
Now from WSAS_HOME/bin, you can run the daemon.sh as follows:
- './daemon.sh console' - Run WSAS in console mode. All output will appear on the current console
- './daemon.sh start' - Start WSAS. Now WSAS will run as a background process
- './daemon.sh stop' - Stop a WSAS process which was started using the above command
- './daemon.sh restart' - Restart the running WSAS instance
You could also create a symbolic link from the /etc/init.d/ directory to the WSAS daemon.sh script as follows:
cd /etc/init.d/ ln -s $WSAS_HOME/bin/daemon.sh wsas
Now you can start, stop and restart WSAS as follows:
/etc/init.d wsas [start | stop | restart]
To automatically start WSAS as a daemon when the machine boots up, you can add WSAS to the default run level as follows
- Download and install chckconfig.
- run, chkconfig --add wsas
- To verify that WSAS has been added to the proper run levels; chkconfig --list
- edit the $WSO2WSAS_HOME/conf/wrapper.conf file and provide the absolute path to the java command as the value of the wrapper.java.command entry.
- Reboot your machine
- Check the $WSO2WSAS_HOME/logs/wrapper.log and $WSO2WSAS_HOME/logs/wso2wsas.log files to make sure that WSAS has been properly started
- Access the WSAS Console at https://localhost:9762/
Applies To
WSO2 WSAS 2.1 & higher versions
Unix, Linux, Sun Solaris, MAC OS X
More Information