Skip to main content

Friendica Support reshared this.

AFAIK @utzer is doing so.
@Michael Vogel @Tealk only the deamon, since you told me that is better.

But yes, I have it running with systemd and it works fine.
@utzer how does your .service file look like?
@Tealk I was just looking for it, here it is:

Description=Friendica worker daemon

User=www-data #same user as the webserver runs with
ExecStart=/web/base/path/bin/daemon.php start
ExecStop=/web/base/path/daemon.php stop

@Tealk the daemon will run continously anyway... it works like this, don't ask me how I came up with this, it was a long time ago.
@utzer do you have the same path for the pid in systemd and in the friendica config?
@Tealk yes. Now I wonder if the systemd PIDFile setting is to check for the PID file or to create one?!
@utzer actually the daemon.php and the systemd should create a pid file

now i'm just confused why running php works and you don't need the php command
usr/bin/php7.4 bin/daemon.php start

bin/daemon.php start
@Tealk I guess daemon.php is executable ? But I also think it does not matter if you use the full php path.

So you say there should be one PID for each of them? Hmm but it works like this, I guess systemd just checks if there is a PID file and gives a fault if there is? Not sure.
@utzer I just thought you had to specify ExecStart/Stop to run with php as well. How else does Systemd know how to run it?

I have always understood PIDFile so that systemd creates a file, maybe it does not bother in this case because the daemon also just enters the pid
I just thought you had to specify ExecStart/Stop to run with php as well. How else does Systemd know how to run it?

The script starts with a shebang:

If it is executable, the kernel will parse that first line and if it starts with shebang it will instead call that binary and pass the script path to it as an argument. So it will really execute "/usr/bin/env php <path to your daemon.php script>" (and env will just resolve the path of the php binary and call that with all arguments - it's needed because not all UNICES have their binaries in the same paths).
This entry was edited (3 months ago)
@elrido @Tealk cool, I learned two things, first what a bang is... like in !Friendica Support, it is a !-bang mention.

And I learned how that thing is called in the first line of a normal shell script, it is a shell bang. :-D


Diese Webseite verwendet Cookies zur Erkennung von eingeloggten und wiederkehrenden Nutzern. Durch die weitere Benutzung der Webseite akzeptieren Sie die Verwendung der Cookies. PS: Wenn du einen Ad-block verwendest kann es sein das du diesen deaktivieren musst um die Meldung zu quittieren.(benötigst du bei uns sowieso nicht)