For *nix environment NM should be configured as startup process using rc scripts. Creating rc scripts for configuring NM as a service is even simpler than configuring WebLogic Server as a service. This is mainly because NM doesn't have to be shutdown gracefully. All you have to do is write a simple shell script that starts the NM and create the symbolic link to that script from the right run level folder. The following illustrates the steps to confiure NM as service under LINUX environment. It should be very similar on other *nix environments. You need root permission to peform the following steps.
1. Create a shell script (wlsnmd) under /etc/init.d/ folder:
#! /bin/bash
case "$1" in
start)
WL_HOME = /usr/middleware/11.1.0/wlserver_10.3
$WL_HOME/server/bin/startNodeManager.sh
;;
*)
echo "Usage: $0 {start}"
exit 1
esac
exit_status
2. Assuming that we are going to start NM at run level 5, create a sysmbolic link in /etc/rc.d/rc5.d/ folder. Since it a startup script we should start the symbolic link with "S" and followed by a number which decide the order in which services will be called. As we are fine to start NM after all the other application/services are start let us choose 99 which is the highest number.
ln -s /etc/init.d/wlsnmd S99weblogic
If you don't want to do these manually you can also use utilities like chkconfig (included in Red Hat distributions) for managing your startup scripts. For configuring WebLogic Server as a startup process there are pre-packaged scripts (installSvc.cmd, uninstallSvc.cmd). But you have to create rc scripts similarly for WLS as well in UNIX based environments. Here is an example rc script for configuring a WebLogic Server as a startup process. But here we also need to implement the kill/stop to gracefully shutdown the server.
#! /bin/bash
case "$1" in
start|reload)
DOMAIN_HOME = /usr/middleware/domains/med_analysis
$DOMAIN_HOME/bin/startWebLogic.sh
;;
stop)
$DOMAIN_HOME/bin/stopWebLogic.sh
;;
restart|force-reload)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit_status