Getting error message "Trying to run as user instance, but $XDG_RUNTIME_DIR is not set."

Solution Verified - Updated -

Issue

When running cron jobs, getting "$XDG_RUNTIME_DIR is not set so can't start instance. some crontab sessions not running" error message and cron jobs fail.

Environment

  • RHEL 8.2
  • systemd-239-31.el8_2.2.x86_64

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content