Stopping and Starting GreenArrow Engine
Server Reboot or Halt
shutdown command to reboot or halt the server. GreenArrow will then cleanly shutdown its services and then start up automatically as part of the normal boot process.
Optionally, you can use
systemctl to manually stop or start all of GreenArrow:
systemctl stop greenarrow
systemctl start greenarrow
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:
- MTA (Mail Server)
- PostgreSQL Server
- HTTP Server
MTA (Mail Server)
- Before getting started, take any steps needed to pause injecting messages into GreenArrow Engine:
If you’re using GreenArrow Studio, stop it before proceeding by running:
svc -d /service/hvmail-studio-worker
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.
If you’re injecting mail from other source(s) which don’t have the intelligence to retry delivery attempts, pause or stop them.
To stop GreenArrow Engine’s MTA, run:
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.
To start GreenArrow Engine’s MTA, run:
To verify that GreenArrow Engine’s MTA has finished starting back up successfully, run the
hvmail_init statuscommand. 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 yes 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 hvmail-dnscache DOWN hvmail-event-processor UP UP hvmail-httpd UP UP hvmail-logfile-agent UP UP hvmail-logfile-summary UP UP hvmail-passenger 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 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 hvmail-tls UP UP
- 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.
Resume injecting messages into GreenArrow Engine, and if possible perform a test send:
If you’re using GreenArrow Studio, resume sends by running:
svc -u /service/hvmail-studio-worker
- 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.
To restart GreenArrow Engine’s MTA, run:
- 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.
To stop PostgreSQL and its dependencies, run:
To start PostgreSQL and its dependencies, run:
To restart PostgreSQL and its dependencies, run:
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.
To stop the HTTP server, run:
svc -d /service/hvmail-httpd
To start the HTTP server, run:
svc -u /service/hvmail-httpd
To restart the HTTP server, run:
svc -t /service/hvmail-httpd
To verify that the HTTP server has come back up, run the following command:
hvmail_init status | grep hvmail-httpd