Skip to content

Commit 3f8752a

Browse files
author
jdv
committed
added env twek to cron task trick
1 parent 1cc4bae commit 3f8752a

File tree

1 file changed

+3
-0
lines changed
  • crowdsec-docs/unversioned/getting_started/installation

1 file changed

+3
-0
lines changed

crowdsec-docs/unversioned/getting_started/installation/cloudways.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@ if grep "$TODAY" "$LOG_FILE" | grep -qE "$ERROR_PATTERN"; then
238238
# Log the action
239239
echo "$(date): Error found, restarting CrowdSec service" >> /home/master/crowdsec/logs/crowdsec_rotation_fail.log
240240

241+
# Providing env context to the cron job
242+
export XDG_RUNTIME_DIR=/run/user/$(id -u)
243+
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus
241244
# Restart the CrowdSec service
242245
systemctl restart --user crowdsec
243246

0 commit comments

Comments
 (0)