Description of problem: The redshift daemon is not able to start from the user systemd service script. Startup fails because redshift is not able to query RANDR. Note that when running the redshift daemon without the service script it is able to start. I think maybe systemd is not able to access the X session. Version-Release number of selected component (if applicable): redshift-1.9.1-4.fc21 How reproducible: Always Steps to Reproduce: 1. Run the service script with 'systemctl --user start redshift.service' Actual results: Redshift daemon fails to start. Expected results: Redshift daemon starts. Additional info: -- Unit UNIT has begun starting up. Dec 14 14:07:43 pixel systemd[2116]: Started Redshift display colour temperature adjustment. -- Subject: Unit UNIT has finished start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit UNIT has finished starting up. -- -- The start-up result is done. Dec 14 14:07:43 pixel redshift[6691]: `RANDR Query Version' returned error -1 Dec 14 14:07:43 pixel redshift[6691]: Initialization of randr failed. Dec 14 14:07:43 pixel systemd[2116]: redshift.service: main process exited, code=exited, status=1/FAILURE Dec 14 14:07:43 pixel systemd[2116]: Unit redshift.service entered failed state. Dec 14 14:07:43 pixel systemd[2116]: redshift.service failed. Dec 14 14:07:43 pixel systemd[2116]: redshift.service holdoff time over, scheduling restart. Dec 14 14:07:43 pixel systemd[2116]: Stopping Redshift display colour temperature adjustment... -- Subject: Unit UNIT has begun shutting down -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit UNIT has begun shutting down. Dec 14 14:07:43 pixel systemd[2116]: Starting Redshift display colour temperature adjustment... -- Subject: Unit UNIT has begun with start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit UNIT has begun starting up. Dec 14 14:07:43 pixel systemd[2116]: start request repeated too quickly for redshift.service Dec 14 14:07:43 pixel systemd[2116]: Failed to start Redshift display colour temperature adjustment. -- Subject: Unit UNIT has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit UNIT has failed. -- -- The result is failed.
It can be fixed by adding following line in service section: Environment=DISPLAY=:0 See: https://bbs.archlinux.org/viewtopic.php?id=177473
(In reply to Ondrej Holy from comment #1) > It can be fixed by adding following line in service section: > Environment=DISPLAY=:0 > > See: > https://bbs.archlinux.org/viewtopic.php?id=177473 See https://github.com/jonls/redshift/issues/91 Hardcoding the display is not a preffered way, this is atm best handled by the user as sugested in the forum thread.