Bug 1174024 - Redshift systemd service script fails to start service
Summary: Redshift systemd service script fails to start service
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: redshift
Version: 21
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Miloš Komarčević
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-12-14 22:14 UTC by Matt Spaulding
Modified: 2015-02-07 20:16 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-02-07 20:16:48 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Matt Spaulding 2014-12-14 22:14:40 UTC
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.

Comment 1 Ondrej Holy 2015-02-05 22:04:13 UTC
It can be fixed by adding following line in service section:
Environment=DISPLAY=:0

See:
https://bbs.archlinux.org/viewtopic.php?id=177473

Comment 2 Miloš Komarčević 2015-02-07 20:16:48 UTC
(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.


Note You need to log in before you can comment on or make changes to this bug.