Project

General

Profile

Parabola OpenRC: notify-send not working from cron

ThisIsMyAccount - almost 5 years ago -

I've noticed since switching from systemd to Parabola OpenRC, any of my cron jobs that use notify-send no longer have the notification pop up. I am able to run notify-send from the terminal as both my user and as root. It's only cron that doesn't seem to work. Back when I was setting this up for Parabola systemd, I know I had to add these lines at the top of my crontab:

XDG_RUNTIME_DIR="/run/user/1000"
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DISPLAY=:0

The XDG and DBUS lines no longer seem to have an effect, which seems to be because I no longer have a /run/user directory. Does anyone know if these need to be changed to something else when using OpenRC? I do have dbus-openrc installed and running as a service, as well as cronie-openrc.


Replies (2)

RE: Parabola OpenRC: notify-send not working from cron - freemor - almost 5 years ago -

Are the cronjobs in your cron tab or in roots crontab or in /etc/rc.d/???

It sounds like a permission problem. Root wouldn't be able to write to your xserver without a xhosts settings being config'd for that

RE: Parabola OpenRC: notify-send not working from cron - ThisIsMyAccount - almost 5 years ago -

Just mentioned this in the IRC, but turns out the solution was to remove those lines from my crontab that were setting XDG_RUNTIME_DIR and DBUS_SESSION_BUS_ADDRESS. They're not needed when using OpenRC with polkit-elogind. This is why it was working from the terminal, so I didn't have those set as root or my user. All set now, thanks for having a look!

    (1-2/2)