From 8a63fc5ca747908966c479300efd255e25cf4497 Mon Sep 17 00:00:00 2001 From: ben-utzer Date: Wed, 4 Apr 2018 14:16:05 +0530 Subject: [PATCH 1/5] Addition of systemd timer/service --- mods/readme.txt | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/mods/readme.txt b/mods/readme.txt index 83878aefb3..41e06c2f88 100644 --- a/mods/readme.txt +++ b/mods/readme.txt @@ -2,6 +2,20 @@ sample-Lighttpd.config sample-nginx.config Sample configuration files to use Friendica with Lighttpd - or Nginx. Pleas check software documentation to know how modify - these examples to make them work on your server. + or Nginx. Pleas check software documentation to know how modify + these examples to make them work on your server. + +sample-systemd.timer +sample-systemd.service + + Sample .timer and .service file to start worker.php + + Please place them in the correct location for your system, + typically this is /etc/systemd/system/friendicaworker.timer + and /etc/systemd/system/friendicaworker.service. + Please report problems and improvements to + !helpers@forum.friendi.ca and @utzer@social.yl.ms or open an + issue in Github (https://github.com/friendica/friendica/issues). + This is for usage of systemd instead of cron to start the worker.php + periodically, the solution is work-in-progress and can surely be improved. From eb5404740a5a485a7b92b08cf06749d8c44535bf Mon Sep 17 00:00:00 2001 From: ben-utzer Date: Wed, 4 Apr 2018 14:24:28 +0530 Subject: [PATCH 2/5] .service file for systemd unit --- mods/sample-systemd.service | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 mods/sample-systemd.service diff --git a/mods/sample-systemd.service b/mods/sample-systemd.service new file mode 100644 index 0000000000..a3c350ff54 --- /dev/null +++ b/mods/sample-systemd.service @@ -0,0 +1,8 @@ +[Unit] +Description=Friendica Worker + +[Service] +User=http +#Adapt the path in the following line to your system, use 'which php' to find php path, +#provide the absolute path for worker.php +ExecStart=/usr/bin/php /www/path/bin/worker.php & From 00ceb4acd23903eaf34ec41375697b21818da325 Mon Sep 17 00:00:00 2001 From: ben-utzer Date: Wed, 4 Apr 2018 14:28:26 +0530 Subject: [PATCH 3/5] Readme extended for systemd unit files --- mods/readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/readme.txt b/mods/readme.txt index 41e06c2f88..4ff8e1067a 100644 --- a/mods/readme.txt +++ b/mods/readme.txt @@ -9,7 +9,7 @@ sample-nginx.config sample-systemd.timer sample-systemd.service - Sample .timer and .service file to start worker.php + Sample systemd unit files to start worker.php periodically. Please place them in the correct location for your system, typically this is /etc/systemd/system/friendicaworker.timer From 9fdcc28fe1f9dc6cc61a7a10824d735c53ee3560 Mon Sep 17 00:00:00 2001 From: utzer Date: Wed, 4 Apr 2018 14:51:51 +0530 Subject: [PATCH 4/5] systemd timer unit --- mods/sample-systemd.timer | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 mods/sample-systemd.timer diff --git a/mods/sample-systemd.timer b/mods/sample-systemd.timer new file mode 100644 index 0000000000..59f328ca95 --- /dev/null +++ b/mods/sample-systemd.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Run Friendica Poller every n minutes + +[Timer] +OnBootSec=120 +OnUnitActiveSec=120 + +[Install] +WantedBy=timers.target From 2bb4f2b57ec949eb3f283556f1cdf8f8e9e1673c Mon Sep 17 00:00:00 2001 From: utzer Date: Wed, 4 Apr 2018 14:54:07 +0530 Subject: [PATCH 5/5] comment about user --- mods/sample-systemd.service | 1 + 1 file changed, 1 insertion(+) diff --git a/mods/sample-systemd.service b/mods/sample-systemd.service index a3c350ff54..aae2e5825c 100644 --- a/mods/sample-systemd.service +++ b/mods/sample-systemd.service @@ -2,6 +2,7 @@ Description=Friendica Worker [Service] +#User should be the same as the user the webserver runs under, typically http or www User=http #Adapt the path in the following line to your system, use 'which php' to find php path, #provide the absolute path for worker.php