Restart Sun/Oracle Glassfish domain on Solaris 10 under SMF
Hopefully you will be using SMF to manage the services. You will doubtless know that the command
svcadm restart domain1
would restart a domain. However, if you want to script your restart like this:
svcadm restart domain1 && touch .reload
perhaps, the the return code you are checking is a result of the restart command being sucessfully passed to the SMF facility. If you really want to wait for the domain to restart properly, the do then following:
svcadm disable -s domain1 && svcadm enable -s domain1 && touch .reload
The -s switch svcadm waits for the result of the termination, and sets its return code appropriately. Likewise when starting the domain.