Set up a recurring task to spawn workers
To ensure that incoming Perforce events are automatically processed for Swarm, it is important to set up a cron job to do this. The cron job can be installed on any host, although you may want to place this on the Swarm host.
Warning!
curl or wget must be installed or workers do not spawn and Swarm cannot process any events. See below for verification steps.
-
Create a file named
swarm
in/etc/cron.d
. -
Edit
/etc/cron.d/swarm
to contain one of the following blocks; select a block depending on whether your system has curl or wget installed.# This ensures that a worker is fired up every minute * * * * * nobody curl -so /dev/null -m5 http://
myswarm
/queue/worker# This ensures that a worker is fired up every minute * * * * * nobody wget -q -O /dev/null -T5 http://
myswarm
/queue/worker -
Replace myswarm above with the actual hostname you have configured for Swarm.
If this is running on the Swarm host, and you have specified the correct
hostname
item in the “Environment” configuration, this can be set tolocalhost
.In the example configuration lines above, where you see
-m5
or-T5
, the5
is the number of seconds that the cron task will wait for a response from the Swarm host. When the cron task is installed on the Swarm host, such as in the Swarm OVA, that value could be reduced to 1 seconds (e.g.-m1
or-T1
). -
Save the edited file.
You are now all set to start using Swarm. Enjoy!
curl/wget verification
The cron job depends on having curl or wget installed, as indicated in “Runtime dependencies”.
To verify that curl or wget is installed, use the which command. For example:
$ which curl
If you see any output, the referenced command is installed.