Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions docs/en/workers/worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,31 @@ php-censor 19057 0.0 0.9 200244 18720 ? S 03:00 0:01 php /php-c
php-censor 19058 0.0 0.9 200244 18860 ? S 03:00 0:01 php /php-censor/console php-censor:worker
```

Also you can use systemd to run the worker.
Configuration for the unit is almost the same as supervisord's configuration.
Just copy this config to `/etc/systemd/system/php-censor.service` with right permissions and run it by `systemctl start php-censor.service`.

```
[Unit]
Description=PHPCensor Worker
After=multi-user.target

[Service]
ExecStart=/path/to/php-censor/bin/console php-censor:worker
Restart=always

User=php-censor #Could be changed
Group=php-censor #Could be changed
```

And check that it works properly by `systemctl status php-censor.service`

Also you can simple daemonise worker by `nohup`:

```
nohup /path/to/php-censor/bin/console php-censor:worker &> /var/log/php-censor-worker.log </dev/null & # and you can save pid in pidfile with echo "$!" > /var/run/php-censor-worker.pid, but it's not really necessary
```

But keep in mind: it won't restart your worker if it fails and can be inconvenient to manage worker process in contrast with other solutions. So, it's good for debug purposes or as temporary solution.

That's it! Now, whenever you create a new build in PHP Censor, it should start building immediately.