Skip to the content
Documentation

Starting the daemon manually

No ratings yet

The daemon bin/php/ezasynchronouspublisher.php reads the publishing queue and publishes the drafts in it. Run it as the user the web server runs as, from the root of the installation, so that the files it writes stay writable for the web server.

# in the foreground: the output goes to the terminal, Ctrl-C stops it
php bin/php/ezasynchronouspublisher.php

# as a daemon: it detaches and keeps running after you log out
php bin/php/ezasynchronouspublisher.php -n

./console exp:ezasynchronouspublisher runs the same script. The options:

Option Meaning
-n, --daemon Run in the background; the output then goes to var/log/async.log
-p, --pid-file=<file> The PID file; default run/ezasynchronouspublisher.pid below the var directory
-s, --siteaccess The siteaccess whose settings the daemon reads
-v, --verbose More output

The PID file is locked while the daemon runs: a second daemon with the same PID file stops with "Another instance of the daemon is already running with the same pid file". To stop a daemon, send it SIGTERM (kill $(cat var/<site>/run/ezasynchronouspublisher.pid), with the var directory of your installation).

The script needs PHP's pcntl functions (pcntl_fork, pcntl_signal, pcntl_waitpid, pcntl_wexitstatus) in the PHP command line binary. For a daemon that starts with the server, see Setting up the asynchronous publishing service.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.