Services are started and stopped differently depending on whether they are installed in an HA environment or not.
While Messaging Server is running under HA control, you cannot use the normal Messaging Server start, restart, and stop commands to control individual Messaging Server services. If you attempt a stop-msg in an HA deployment, the system warns that it has detected an HA setup and will tell you how to properly stop the system.
The appropriate start, stop and restart commands are shown in the tables below. Note that there are no specific HA commands to individually start, restart, or stop other Messaging Server services (for example, SMTP). However, you can run a stop-msg service command to stop/restart individual servers such as imap, pop or sched.
Sun Cluster’s finest granularity is that of an individual resource. Since Messaging Server is known to Sun Cluster as a resource, scswitch commands affect all Messaging Server services as a whole.
Table 4–2 Start, Stop, Restart in a Sun Cluster 3.0/3.1 Environment
Action |
Individual Resource |
Entire Resource Group |
|
---|---|---|---|
Start |
scswitch -e -j resource |
sscswitch -Z -g resource_group |
|
Restart |
|
scswitch -R -g resource_group |
|
Stop |
scswitch -n -j resource |
scswitch -F -g resource_group |
Table 4–3 Start, Stop, Restart in Veritas 1.3, 2.0, 2.1, and 3.5 Environments
Action |
Individual Resource |
Entire Resource Group |
||
---|---|---|---|---|
Start |
hares -online resource -sys system |
hagrp -online group -sys system |
||
Restart |
|
|
||
Stop |
hares -offline resource -sys system |
hagrp -offline group -sys system |
You can start and stop services from Console or from the command line. In addition, you only need to run the services that your server actually uses. For example, if you are using Messaging Server solely as a message transfer agent (MTA), you can turn on the MTA alone. Or, if maintenance, repair, or security needs require shutting down the server, you may be able to turn off just the affected service. (If you never intend to run a particular service, you should disable it instead of just turning it off.)
You must first enable services such as POP, IMAP, and HTTP, before starting or stopping them. For more information, see Enabling and Disabling Services.
Important: If a server process crashes, other processes may hang as they wait for locks held by the server process that crashed. If you are not using automatic restart (see Automatic Restart of Failed or Unresponsive Services), and if any server process crashes, you should stop all processes, then restart all processes. This includes the POP, IMAP, HTTP, and MTA processes, as well as the stored (message store) process, and any utilities that modify the message store, such as mboxutil, deliver, reconstruct, readership, or upgrade.
Console: Console allows you to start and stop individual services and view status information about each service.
For each service—IMAP, POP, SMTP, and HTTP—the form displays the service’s current state (on or off). If the service is running, the form shows the time at which the service was last started up. It can also display other status information.
To start up, shut down, or view the status of any messaging services:
From Console, open the Messaging Server whose services you want to start or stop.
Get to the Services General Configuration form in either of these two ways:
The Services General Configuration form appears.
The left column of the Process Control field lists the services supported by the server; the right column gives the basic status of each of the services (ON or OFF, plus—if it is ON—the time it was last started).
To view status information about a service that is currently on, select the service in the Process Control field.
The Service Status field displays status information about the service.
For POP, IMAP, and HTTP the field shows the last connection time, the total number of connections, the current number of connections, the number of failed connections since the service last started, and the number of failed logins since the service last started.
The information in this field helps you to understand the load on the server and the reliability of its service, and it can help spotlight attacks against the server’s security.
To turn a service on, select it in the Process Control field and click Start.
To turn a service off, select it in the Process Control field and click Stop.
To turn all enabled services on or off simultaneously, click the Start All or Stop All button.
Command Line: You can use the start-msg and stop-msg commands to start or stop any of the messaging services (smtp, imap, pop, store, http, ens, sched). Examples:
msg_svr_base/sbin/start-msg imap
msg_svr_base/sbin/stop-msg pop
msg_svr_base/sbin/stop-msg sched
msg_svr_base/sbin/stop-msg smtp
The services must be enabled in order to stop or start them. See To Specify What Services are Started
The start-msg and stop-msg command start and stop all of the MTA services, not just the SMTP server. If you want more granular control when starting or stopping the MTA services, you can use the start/stop-msg command for the dispatcher and the job controller. For more information, see start-msg in Sun Java System Messaging Server 6 2005Q4 Administration Reference and stop-msg in Sun Java System Messaging Server 6 2005Q4 Administration Reference..
By default the following services are started with start-msg:
#./start-msg Connecting to watcher ... Launching watcher ... Starting ens server .... 21132 Starting store server .... 21133 checking store server status ... ready Starting imap server .... 21135 Starting pop server .... 21138 Starting http server .... 21141 Starting sched server .... 21143 Starting dispatcher server .... 21144 Starting job_controller server .... 21146 |
These can be controlled by enabling or disabling the configutil parameters: service.imap.enable, service.pop.enable, service.http.enable, local.smsgateway.enable, local.snmp.enable, local.imta.enable, local.mmp.enable, local.ens.enable, and local.sched.enable. Note that you need to set both service.imap.enable and service.imap.enablesslport to 0 in order to disable IMAP. The same goes for POP and HTTP. See the configutil Parameters in Sun Java System Messaging Server 6 2005Q4 Administration Reference for details on how these work.