Replace 'bin/worker.php' calls and help

This commit is contained in:
Philipp 2025-01-02 20:29:17 +01:00
parent 7b952e3c94
commit c79f0c83a7
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
6 changed files with 13 additions and 13 deletions

View file

@ -129,7 +129,7 @@ bin/console user password "$USER_NICK" "$USER_PASSW"
# create cronjob - activate if you have enough memory in you dev VM # create cronjob - activate if you have enough memory in you dev VM
# cronjob runs as www-data user # cronjob runs as www-data user
echo ">>> Installing cronjob" echo ">>> Installing cronjob"
echo "*/10 * * * * www-data cd /vagrant; /usr/bin/php bin/worker.php" >> /etc/cron.d/friendica echo "*/10 * * * * www-data cd /vagrant; /usr/bin/php bin/console.php worker" >> /etc/cron.d/friendica
# friendica needs write access to /tmp # friendica needs write access to /tmp
chmod 777 /tmp chmod 777 /tmp

View file

@ -268,7 +268,7 @@ You might wish to delete/rename `config/local.config.php` to another name and dr
Set up a cron job or scheduled task to run the worker once every 5-10 minutes in order to perform background processing. Set up a cron job or scheduled task to run the worker once every 5-10 minutes in order to perform background processing.
Example: Example:
cd /base/directory; /path/to/php bin/worker.php cd /base/directory; /path/to/php bin/console.php worker
Change "/base/directory", and "/path/to/php" as appropriate for your situation. Change "/base/directory", and "/path/to/php" as appropriate for your situation.
@ -277,7 +277,7 @@ Change "/base/directory", and "/path/to/php" as appropriate for your situation.
If you are using a Linux server, run "crontab -e" and add a line like the If you are using a Linux server, run "crontab -e" and add a line like the
one shown, substituting for your unique paths and settings: one shown, substituting for your unique paths and settings:
*/10 * * * * cd /home/myname/mywebsite; /usr/bin/php bin/worker.php */10 * * * * cd /home/myname/mywebsite; /usr/bin/php bin/console.php worker
You can generally find the location of PHP by executing "which php". You can generally find the location of PHP by executing "which php".
If you run into trouble with this section please contact your hosting provider for assistance. If you run into trouble with this section please contact your hosting provider for assistance.
@ -426,7 +426,7 @@ provided by one of our members.
> >
> */10 * * * * cd /var/www/friendica/friendica/ && sudo -u www-data /usr/bin/php \ > */10 * * * * cd /var/www/friendica/friendica/ && sudo -u www-data /usr/bin/php \
> -d suhosin.executor.func.blacklist=none \ > -d suhosin.executor.func.blacklist=none \
> -d suhosin.executor.eval.blacklist=none -f bin/worker.php > -d suhosin.executor.eval.blacklist=none -f bin/console.php
> >
> This worked well for simple test cases, but the friendica-cron still failed > This worked well for simple test cases, but the friendica-cron still failed
> with a fatal error: > with a fatal error:
@ -435,7 +435,7 @@ provided by one of our members.
> (attacker 'REMOTE_ADDR not set', file '/var/www/friendica/friendica/boot.php', > (attacker 'REMOTE_ADDR not set', file '/var/www/friendica/friendica/boot.php',
> line 1341) > line 1341)
> >
> After a while I noticed, that `bin/worker.php` calls further PHP script via `proc_open`. > After a while I noticed, that `bin/console.php worker` calls further PHP script via `proc_open`.
> These scripts themselves also use `proc_open` and fail, because they are NOT > These scripts themselves also use `proc_open` and fail, because they are NOT
> called with `-d suhosin.executor.func.blacklist=none`. > called with `-d suhosin.executor.func.blacklist=none`.
> >

View file

@ -57,7 +57,7 @@ Finally, you may also want to optimise your database with the following command:
### Going offline ### Going offline
Stop background tasks and put your server in maintenance mode. Stop background tasks and put your server in maintenance mode.
1. If you had set up a worker cron job like this ``*/10 * * * * cd /var/www/friendica; /usr/bin/php bin/worker.php`` run ``crontab -e`` and comment out this line. Alternatively if you deploy a worker daemon, disable this instead. 1. If you had set up a worker cron job like this ``*/10 * * * * cd /var/www/friendica; /usr/bin/php bin/console.php worker`` run ``crontab -e`` and comment out this line. Alternatively if you deploy a worker daemon, disable this instead.
2. Put your server into maintenance mode: ``bin/console maintenance 1 "We are currently upgrading our system and will be back soon."`` 2. Put your server into maintenance mode: ``bin/console maintenance 1 "We are currently upgrading our system and will be back soon."``
## Dumping DB ## Dumping DB
@ -78,7 +78,7 @@ Ensure the newly created database credentials are identical to the setting in th
### Cron job for worker ### Cron job for worker
Set up the required daily cron job. Set up the required daily cron job.
Run ``crontab -e`` and add the following line according to your system specification Run ``crontab -e`` and add the following line according to your system specification
``*/10 * * * * cd /var/www/friendica; /usr/bin/php bin/worker.php`` ``*/10 * * * * cd /var/www/friendica; /usr/bin/php bin/console.php worker``
### DNS settings ### DNS settings
Adjust your DNS records by pointing them to your new server. Adjust your DNS records by pointing them to your new server.

View file

@ -210,13 +210,13 @@ Gehe in den Friendica-Hauptordner und führe den Kommandozeilen Befehl aus:
Erstelle einen Cron job oder einen regelmäßigen Task, um den Poller alle 5-10 Minuten im Hintergrund ablaufen zu lassen. Erstelle einen Cron job oder einen regelmäßigen Task, um den Poller alle 5-10 Minuten im Hintergrund ablaufen zu lassen.
Beispiel: Beispiel:
cd /base/directory; /path/to/php bin/worker.php cd /base/directory; /path/to/php bin/console.php worker
Ändere "/base/directory" und "/path/to/php" auf deine Systemvorgaben. Ändere "/base/directory" und "/path/to/php" auf deine Systemvorgaben.
Wenn du einen Linux-Server nutzt, benutze den Befehl "crontab -e" und ergänze eine Zeile wie die Folgende; angepasst an dein System Wenn du einen Linux-Server nutzt, benutze den Befehl "crontab -e" und ergänze eine Zeile wie die Folgende; angepasst an dein System
`*/10 * * * * cd /home/myname/mywebsite; /usr/bin/php bin/worker.php` `*/10 * * * * cd /home/myname/mywebsite; /usr/bin/php bin/console.php worker`
Du kannst den PHP-Pfad finden, indem du den Befehl „which php“ ausführst. Du kannst den PHP-Pfad finden, indem du den Befehl „which php“ ausführst.
Wenn du Schwierigkeiten mit diesem Schritt hast, kannst du deinen Hosting-Anbieter kontaktieren. Wenn du Schwierigkeiten mit diesem Schritt hast, kannst du deinen Hosting-Anbieter kontaktieren.

View file

@ -6,4 +6,4 @@ Description=Friendica Worker
User=http User=http
#Adapt the path in the following line to your system, use 'which php' to find php path, #Adapt the path in the following line to your system, use 'which php' to find php path,
#provide the absolute path for worker.php #provide the absolute path for worker.php
ExecStart=/usr/bin/php /www/path/bin/worker.php & ExecStart=/usr/bin/php /www/path/bin/console.php worker &

View file

@ -1207,7 +1207,7 @@ class Worker
if (Worker\Daemon::isMode() && DI::config()->get('system', 'worker_fork')) { if (Worker\Daemon::isMode() && DI::config()->get('system', 'worker_fork')) {
self::forkProcess($do_cron); self::forkProcess($do_cron);
} else { } else {
DI::system()->run('bin/worker.php', ['no_cron' => !$do_cron]); DI::system()->run('bin/console.php worker', ['no_cron' => !$do_cron]);
} }
if (Worker\Daemon::isMode()) { if (Worker\Daemon::isMode()) {
Worker\IPC::SetJobState(false); Worker\IPC::SetJobState(false);