You are not logged in.

#1 2018-08-23 21:48:48

LiamMayfair
Member
Registered: 2018-08-23
Posts: 3

[SOLVED] Redshift systemd unit not autostarting

Hi everyone,

I installed Redshift recently and enabled its systemd unit so it'd autostart at boot-up, however it's crashing and fails to load. These are the logs:

● redshift.service - Redshift display colour temperature adjustment
   Loaded: loaded (/usr/lib/systemd/user/redshift.service; enabled; vendor preset: enabled)
   Active: failed (Result: core-dump) since Thu 2018-08-23 21:45:00 BST; 5min ago
     Docs: http://jonls.dk/redshift/
  Process: 611 ExecStart=/usr/bin/redshift (code=dumped, signal=SEGV)
 Main PID: 611 (code=dumped, signal=SEGV)

Aug 23 21:45:00 eir systemd[564]: redshift.service: Failed with result 'core-dump'.
Aug 23 21:45:00 eir systemd[564]: redshift.service: Service RestartSec=100ms expired, scheduling restart.
Aug 23 21:45:00 eir systemd[564]: redshift.service: Scheduled restart job, restart counter is at 5.
Aug 23 21:45:00 eir systemd[564]: Stopped Redshift display colour temperature adjustment.
Aug 23 21:45:00 eir systemd[564]: redshift.service: Start request repeated too quickly.
Aug 23 21:45:00 eir systemd[564]: redshift.service: Failed with result 'core-dump'.
Aug 23 21:45:00 eir systemd[564]: Failed to start Redshift display colour temperature adjustment.
Aug 23 21:45:00 eir systemd-coredump[613]: Process 611 (redshift) of user 1000 dumped core.
                                           
                                           Stack trace of thread 611:
                                           #0  0x00007f7631752ee4 wl_proxy_marshal_constructor (libwayland-client.so.0)
                                           #1  0x000056203ff841d8 n/a (redshift)
                                           #2  0x000056203ff81475 n/a (redshift)
                                           #3  0x000056203ff7fd50 n/a (redshift)
                                           #4  0x00007f763017c223 __libc_start_main (libc.so.6)
                                           #5  0x000056203ff8115e n/a (redshift)

If I start it manually via systemctl, it doesn't crash. I think this could be because systemd is trying to load redshift too soon and perhaps its dependencies are not up yet. How could I configure the systemd unit to ensure its dependencies are up? My current systemd file is:

[Unit]
Description=Redshift display colour temperature adjustment
Documentation=http://jonls.dk/redshift/

[Service]
ExecStart=/usr/bin/redshift
Restart=always

[Install]
WantedBy=default.target

Only change I made to this file was removing the `After=display-manager.service` directive as this wiki article instructs, since I don't use a display manager at all.

I use Wayland (sway 0.15.2) and the `redshift-wayland-git` package, which is patched to support Redshift on Wayland.

Last edited by LiamMayfair (2018-08-31 19:41:49)

Offline

#2 2018-08-24 06:03:45

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: [SOLVED] Redshift systemd unit not autostarting

Only change I made to this file

… is obviously what makes it start before there's any display manager.

What is your graphical session (display server) and how do you start it? What is the default.target?

Offline

#3 2018-08-28 23:14:59

LiamMayfair
Member
Registered: 2018-08-23
Posts: 3

Re: [SOLVED] Redshift systemd unit not autostarting

Hi seth,

I use Sway, so Wayland. No display manager or login session manager whatsoever. I just boot up my laptop, login via the login shell and launch sway manually just by invoking it.

The default target unit file looks like this

[Unit]
Description=Graphical Interface
Documentation=man:systemd.special(7)
Requires=multi-user.target
Wants=display-manager.service
Conflicts=rescue.service rescue.target
After=multi-user.target rescue.service rescue.target display-manager.service
AllowIsolate=yes

Offline

#4 2018-08-29 05:59:11

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: [SOLVED] Redshift systemd unit not autostarting

Yeah, I got as much. THe problem is, that this cannot work. The redshift service needs to be started after the display server (wayland/sway in your case)
You either need to wrap sway into a service and depend on that or just run it from eg. your ~/.config/sway/config

Offline

#5 2018-08-31 19:41:19

LiamMayfair
Member
Registered: 2018-08-23
Posts: 3

Re: [SOLVED] Redshift systemd unit not autostarting

Yeah, you were right, I ended up adding an exec onto my sway conf which starts up redshift when I launch sway. Thanks.

Offline

#6 2018-10-30 13:20:48

checkmate
Member
Registered: 2018-10-30
Posts: 1

Re: [SOLVED] Redshift systemd unit not autostarting

redshift doesn't work on Wayland though.

Offline

Board footer

Powered by FluxBB