Novell Home

Script to Shut Down a NetWare Server

Novell Cool Solutions: Tip
By Wayne Doust

Digg This - Slashdot This

Posted: 9 Mar 2006
 

PROBLEM:

Shutting down a NetWare server can be problematic at times. Typing "down" at the prompt may lead to a hung server as services don't unload in an orderly fashion, particularly if you are running several services off the one NetWare server.

SOLUTION:

I have created a DWN.NCF file that I copy onto every server I deploy. I then rem out the inapplicable lines. To down the server I type:

DWN

instead of "DOWN".

If I want to restart the server I type:

DWN RESTART SERVER

The script will execute any command on the command line after shutting down the server.

This script is a 'work in progress'. As I encounter more services that need shutting down I add them to the generic script.

I may migrate this script to a bash script in the future. For now it works quite well for my purposes.

EXAMPLE:

# Down the server in an orderly fashion
send "Server PELICAN is going down NOW. Some services may be disrupted."
unload conlog
load toolbox
delay 3
del c:\restart.log -qy
load conlog file=c:\restart.log 
cls
echo SHUTDOWN : Shutdown server in an orderly fashion 
echo SHUTDOWN : and execute the following command
echo
echo %1 %2 %3 %4
echo
delay 3

echo SHUTDOWN : Stopping Backup Exec
bestop 
delay 10
unload ndmpd
delay 3
unload ad_aspi
delay 3
unload nrltli
delay 3
unload bkupexec
delay 3
unload ofm
delay 3

echo SHUTDOWN : Leaving Cluster
cluster leave
echo SHUTDOWN : Unloading Cluster Services
quldncs.ncf
unmwreg.ncf
delay 5

echo SHUTDOWN : Unloading Native File Services
afpstop.ncf
cifsstop.ncf
nfsstop.ncf

echo SHUTDOWN : unloading GUI
stopx

echo SHUTDOWN : Unloading TOMCAT Administration
tcadmdn.ncf
delay 5
rem stopifolder.ncf
rem stopser.ncf
echo
echo SHUTDOWN : Unloading TOMCAT
sys:tomcat\4\bin\tc4stop.ncf
delay 3
echo
echo SHUTDOWN : Unloading SQL Manager
mgrstop.ncf
delay 2

echo SHUTDOWN : Shutting down Java Apps
java -shutdownall
delay 5
echo SHUTDOWN : Kill All remaining Java Apps
java -killall
delay 10
echo SHUTDOWN : Exit from JAVA
java -exit
delay 10
echo SHUTDOWN : Unloading JAVA NLM
unload java <<y
delay 3
echo SHUTDOWN : Unloading LDAP
unload nldap
delay 2

echo SHUTDOWN : Unloading Management Agents
sys:system\nma\unnma5.ncf
delay 5
unload ndsimon
unload embox
unload rconag6

echo SHUTDOWN : Unloading security infrastructure
unload rconag6
unload pki
unload sasdfm
unload sas

echo SHUTDOWN : unload name services
unload named
unload dhcpsrvr
unload slpda

rem bstop <<n
rem echo SHUTDOWN : Unbinding Logical NIC boards and Load balancing
rem simplan

echo SHUTDOWN : Unloading SMS Agents
unload volsms
unload ndmpd ?
delay 3
smsstop
delay 2
set server power down options = off

echo SHUTDOWN : 15 Second delay before downing server
delay 10
echo SHUTDOWN : Following command will be executed before Shutdown
echo %1 %2 %3 %4
delay 3
%1 %2 %3 %4
delay 3

echo SHUTDOWN : Down Server
down -f


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell