<img src="https://d5nxst8fruw4z.cloudfront.net/atrk.gif?account=lYCzn1QolK10N8" style="display:none" height="1" width="1" alt="">

Stopping and Starting GreenArrow Engine

Server Reboot or Halt

Use the halt, reboot, poweroff or shutdown command to reboot or halt the server. GreenArrow will then cleanly shutdown its services.

Components

Since most situations in which GreenArrow Engine will be stopped and started involve either one of the components below, or a server reboot, the remainder of this document is broken into 3 sections to cover each component:

  1. MTA (Mail Server)
  2. PostgreSQL Server
  3. HTTP Server

MTA (Mail Server)

Stopping
  1. Before getting started, take any steps needed to pause injecting messages into GreenArrow Engine:
    1. If you’re using GreenArrow Studio, stop it before proceeding by running:

      svc -d /service/hvmail-studio-worker
      

      1. If the above command returns a unable to chdir warning, then you’re probably running an older version of GreenArrow Studio, and will need to run the following command instead:

        /etc/init.d/hvmail_studio3 stop
        

    2. If you’re using an MTA, such as another GreenArrow Engine installation, the other MTA should handle the downtime gracefully, and retry deliveries after GreenArrow comes back up.

    3. If you’re injecting mail from other source(s) which don’t have the intelligence to retry delivery attempts, pause or stop them.

  2. To stop GreenArrow Engine’s MTA, run:

    hvmail_init stop
    

Stopping GreenArrow Engine can take a minute or two, depending on how many messages are currently being processed. Status information is given while GreenArrow Engine is being stopped.

After stopping GreenArrow Engine it may still take some time for the disk queue qmail-send program to fully terminate, if there are a very large number of messages in the disk queue. This is because after getting the stop command, the disk queue qmail-send program writes information to disk about when to retry the messages currently in the queue. After some time, the program will terminate. If the system shuts down before this process finishes, there is no harm.

Starting
  1. To start GreenArrow Engine’s MTA, run:

    hvmail_init start
    

  2. To verify that GreenArrow Engine’s MTA has finished starting back up successfully, run the hvmail_init status command. This should produce the output shown below:

    # hvmail_init status
    
         QUEUE      SERVICE STARTED       OK FILE EXISTS       RAMDISK ACTIVE
           ram                  yes                  yes                  yes
        bounce                  yes                  yes                  yes
          disk                  yes                  n/a                  n/a
    
    OVERALL STATUS: up
    
    LICENSE: current
    
    SERVICES:
    Name                      Primary Service Status  Log Service Status
    hvmail-bounce-processor   UP                      UP
    hvmail-bounce-qmail-send  UP                      UP
    hvmail-config-agent       UP                      UP
    hvmail-dd-dispatcher      UP                      UP
    hvmail-dd-logreader       UP                      UP
    hvmail-disk-qmail-send    UP                      UP
    dnscache                  UP                      UP
    hvmail-event-processor    UP                      UP
    hvmail-httpd              UP                      UP
    hvmail-logfile-agent      UP                      UP
    hvmail-logfile-summary    UP                      UP
    hvmail-postgres           UP                      UP
    hvmail-pure-authd-studio  UP                      UP
    hvmail-pure-ftpd          UP                      UP
    hvmail-qmail-pop3d        UP                      UP
    hvmail-qmail-smtpd        UP                      UP
    hvmail-qmail-smtpd2       UP                      UP
    hvmail-qmail-smtpd3       DOWN but normally UP
    hvmail-ram-qmail-send     UP                      UP
    hvmail-redis              UP                      UP
    hvmail-redis-np           UP                      UP
    hvmail-rpc                UP                      UP
    hvmail-rspawn-limiter     UP                      UP
    hvmail-simplemh           UP                      UP
    hvmail-simplemh2          UP                      UP
    hvmail-smtp-sink          UP                      UP
    hvmail-studio-worker      UP                      UP
    

  3. After starting GreenArrow Engine’s MTA, if there are a large number of messages in the disk queue, it will take the disk queue qmail-send program some time to read information on all of the messages. This limitation will likely be removed in a future update.
  4. Resume injecting messages into GreenArrow Engine, and if possible perform a test send:

    1. If you’re using GreenArrow Studio, resume sends by running:

      svc -u /service/hvmail-studio-worker
      

      1. If the above command returns a unable to chdir warning, then you’re probably running an older version of GreenArrow Studio, and will need to run the following command instead:

        /etc/init.d/hvmail_studio3 start
        

Restarting
  1. Before getting started, take any steps needed to pause injecting messages into GreenArrow Engine. This is described in more detail in the Stopping section above.
  2. To restart GreenArrow Engine’s MTA, run:

    hvmail_init restart
    

  3. After restarting GreenArrow Engine’s MTA, resume injecting messages into GreenArrow Engine, and if possible perform a test send. This is described in more detail in the Starting section above.

PostgreSQL Server

  1. To stop PostgreSQL and its dependencies, run:

    /var/hvmail/bin/hvmail_postgres_manager stop
    

  2. To start PostgreSQL and its dependencies, run:

    /var/hvmail/bin/hvmail_postgres_manager start
    

  3. To restart PostgreSQL and its dependencies, run:

    /var/hvmail/bin/hvmail_postgres_manager restart
    

Once you stop the PostgreSQL server using /var/hvmail/bin/hvmail_postgres_manager, it should be started back up using that same script, so that all of the dependencies that are stopped or paused by this script can be properly resumed. If you accidentally start PostgreSQL up directly after using /var/hvmail/bin/hvmail_postgres_manager, then it’s safe to run /var/hvmail/bin/hvmail_postgres_manager start to start up the previously shutdown dependencies without having to shut PostgreSQL back down.

HTTP Server

  1. To stop the HTTP server, run:

    svc -d /service/hvmail-httpd
    

  2. To start the HTTP server, run:

    svc -u /service/hvmail-httpd
    

  3. To restart the HTTP server, run:

    svc -t /service/hvmail-httpd
    

  4. To verify that the HTTP server has come back up, run the following command:

    hvmail_init status | grep hvmail-httpd