starting redshift via systemd always fails:
-bash-4.4# systemctl start redshift
-bash-4.4# systemctl status redshift
● redshift.service - Redshift display colour temperature adjustment
Loaded: loaded (/usr/lib/systemd/system/redshift.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2020-01-06 20:37:30 CET; 5s ago
Process: 26184 ExecStart=/usr/bin/redshift (code=exited, status=1/FAILURE)
Main PID: 26184 (code=exited, status=1/FAILURE)
Jan 06 20:37:30 localhost systemd: redshift.service: Service RestartSec=100ms expired, scheduling restart.
Jan 06 20:37:30 localhost systemd: redshift.service: Scheduled restart job, restart counter is at 5.
Jan 06 20:37:30 localhost systemd: Stopped Redshift display colour temperature adjustment.
Jan 06 20:37:30 localhost systemd: redshift.service: Start request repeated too quickly.
Jan 06 20:37:30 localhost systemd: redshift.service: Failed with result 'exit-code'.
Jan 06 20:37:30 localhost systemd: Failed to start Redshift display colour temperature adjustment.
Starting on command line works:
Standortanbieter »geoclue2« wird versucht …
Anbieter »geoclue2« wird verwendet.
Methode »randr« wird benutzt.
Es wird gewartet, bis der anfängliche Standort verfügbar ist …
Standort: XX° N, YY° O
Thank you for reporting this.
$ urpmq -l redshift includes:
Assigning to wally as registered & active 'redshift' maintainer.
redshift unit does not work =>
redshift does not start as a service, but does from command line.
I don't think redshift should be run as a service as it needs to run owned by
the user running the desktop environment.
As it's not enabled by default I hadn't noticed that it has a service file,
which was not present when I first started using it under Mageia 1. I've
been using it since then with kde, then plasma as my primary desktop.
To run it, I first manually ran redshift-gtk which creates
~/.config/autostart/redshift-gtk.desktop. I then enabled the desktop file
in systemsettings5, Workspace, Startup and Shutdown, Autostart.
I also created the config file as per the man page with ...
$ cat ~/.config/redshift.conf
; Global settings
; The location provider and adjustment method settings
; are in their own sections.
; In this example screen 1 is adjusted by vidmode. Note
; that the numbering starts from 0, so this is actually
; the second screen.
I've been using it for some time, but suddenly it was not started anymore, so I thought the "new" systemd files have replaced the startup in desktop.
I've removed my "old" redshift.desktop file which is not launched anymore (?). The new file is some different, haven't tested if this works now.
If this is the case, the systemd files should not be shipped.
Systemd service files should work with --user. They were just at the wrong place.
Moved files from /usr/lib/systemd/system to /usr/lib/systemd/user in redshift-1.12-5.mga8.
And as the issue was filed against mga7, the fix is also available in core/updates_testing for mga7.
Updated pkgs in core/updates_testing adds also post/preun scriptlets for systemd user service files.
Hasn't been assigned to qa yet, but I decided to test now anyway.
I disabled the autostart of redshift-gtk by plasma.
We need a way to ensure users know that each user who wants it, must run
$ systemctl --user enable redshift-gtk.service
and then either start the service or logout/in. A README.urpmi with this
info might be appropriate. Likewise with the redshift.service if the user
is not using redshift-gtk too.
At present, redshift-gtk is failing on Mageia 7 though due to a segfault.
From systemctl --user status redshift-gtk.service
Process: 3043 ExecStart=/usr/bin/redshift-gtk (code=dumped, signal=SEGV)
On this install, I use run level 3 (multi-user.target) as my default.target,
and then manually run startx, to start whichever desktop environment I want.
Not sure at this point if that is why it's failing with the segfault. Will
test later on an install that uses run level 5 (graphical.target) as it's
After enabling and starting redshift.service manually, it's working.
$ systemctl --user status redshift.service
● redshift.service - Redshift display colour temperature adjustment
Loaded: loaded (/usr/lib/systemd/user/redshift.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2020-01-09 10:31:27 EST; 9min ago
Main PID: 4040 (redshift)
Jan 09 10:31:27 x3.hodgins.homeip.net systemd: Started Redshift display colour temperature adjustment.
Jan 09 10:31:27 x3.hodgins.homeip.net redshift: Waiting for initial location to become available...
Jan 09 10:31:27 x3.hodgins.homeip.net redshift: Location: 42.97 N, 81.24 W
After a reboot, I manually have to start the service after starting plasma,
as it fails 5 times in between the login and the manual running of startx.
As most run level 3 users are advanced users, it's ok if we have to use
a workaround to ensure it's started after plasma starts, but it would be
nice if the startup could handle this situation too.
The redshift-gtk segfault must be fixed. A README or other documentation
explaining the change in the startup method should be added, and it would
be nice if easier support for run level 3 users could be added.
I added RestartSec=30 to the [Service] section of /usr/lib/systemd/user/redshift.service and that works for me. The journal shows ...
Jan 09 11:46:03 systemd: redshift.service: Service RestartSec=30s expired, scheduling restart.
Jan 09 11:46:03 systemd: redshift.service: Scheduled restart job, restart counter is at 1.
Jan 09 11:46:03 systemd: Stopped Redshift display colour temperature adjustment.
Jan 09 11:46:03 systemd: Started Redshift display colour temperature adjustment.
Jan 09 11:46:03 redshift: Waiting for initial location to become available...
Jan 09 11:46:03 redshift: Location: 42.97 N, 81.24 W
As expected, switching to using sddm to start plasma has no effect.
redshift-gtk still segfaults. Other then the .service files, what else
I had no problems with fresh install from core/udpates_testing in mga7 with Xfce. Redshift appeared to tray after reboot.
%post systemd macros seems to handle currently only fresh pkg installation and not updates.
(In reply to Dave Hodgins from comment #7)
> On this install, I use run level 3 (multi-user.target) as my default.target,
> and then manually run startx, to start whichever desktop environment I want.
> Not sure at this point if that is why it's failing with the segfault.
Does startx call /etc/X11/xinit/xinitrc.d/*.sh files, especially 50-systemd-user.sh, to set $DISPLAY? It's needed for redshift.
What's the output of 'systemctl --user show-environment'?
$ systemctl --user show-environment
Pretty sure the problem is due to something I've done on my system.
It appears more than one copy of redshift is trying to run, causing the
While I'm currently running plasma, I have all desktop environments installed,
and have redshift autostart set up in each of those that support autostart.
I've disabled the autostart in plasma, but something is still starting it,
and clearly it doesn't handle having more than one copy running.
Unfortunately all of my test installs have redshift already set up, so I'll
have to do another install to test it properly.
Added two patches:
1. Don't start both redshift and redshift-gtk service
2. Wait 5 secs before trying to restart systemd services
Seems to be working ok. I did notice that with redshift-gtk, left clicking on
it's icon shows that it has it's own Autostart checkbox, which luckily appears
to no longer have any impact.
This bug has to be assigned to qa before the update can be validated.