Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[For 1.8] Enable Systemd Timers to Handle MyBB Task System
#1
Create the following two files in your /etc/systemd/system/ directory:

/etc/systemd/system/mybb.service
Code:
[Unit]
Description=MyBB Tasks

[Service]
User=www-data
ExecStart=/usr/bin/php /var/www/mybb/task.php

/etc/systemd/system/mybb.timer
Code:
[Unit]
Description=Runs MyBB tasks every minute

[Timer]
OnBootSec=5min
OnUnitActiveSec=1min
Unit=mybb.service

[Install]
WantedBy=multi-user.target

Now, run the following commands in your terminal:
Code:
systemctl daemon-reload
systemctl enable mybb.timer
systemctl start mybb.timer
Reply
#2
I am not familiar with systemd tasks, I want to know will it not require any admin authentication to run tasks ?
Reply
#3
No authentication needed at all, the /task.php file is executed as the system user you specify in the mybb.service file (User=www-data).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)