Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#47717 - [redshift] systemd service creates a process storm

Attached to Project: Community Packages
Opened by Vorbote (vorbote) - Monday, 11 January 2016, 22:22 GMT
Last edited by Lukas Fleischer (lfleischer) - Thursday, 14 April 2016, 05:37 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Lukas Fleischer (lfleischer)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

As written the user service creates a process storm that results in the application not being loaded at all. When examinig the logs the pattern is like this:

$ journalctl --user-unit=redshit.service

ene 09 06:55:39 arbegas systemd[632]: redshift.service: Main process exited, code=exited, status=1/FAILURE
ene 09 06:55:39 arbegas systemd[632]: redshift.service: Unit entered failed state.
ene 09 06:55:39 arbegas systemd[632]: redshift.service: Failed with result 'exit-code'.
ene 09 06:55:39 arbegas systemd[632]: redshift.service: Service hold-off time over, scheduling restart.
ene 09 06:55:39 arbegas systemd[632]: Stopped Redshift display colour temperature adjustment.
ene 09 06:55:39 arbegas systemd[632]: redshift.service: Start request repeated too quickly.
ene 09 06:55:39 arbegas systemd[632]: Failed to start Redshift display colour temperature adjustment.
ene 09 06:55:39 arbegas systemd[632]: redshift.service: Unit entered failed state.
ene 09 06:55:39 arbegas systemd[632]: redshift.service: Failed with result 'start-limit'.
ene 09 06:58:03 arbegas systemd[632]: Started Redshift display colour temperature adjustment.
ene 09 10:02:12 arbegas systemd[632]: Stopping Redshift display colour temperature adjustment...
ene 09 10:02:14 arbegas systemd[632]: Stopped Redshift display colour temperature adjustment.

The process is started too fast for systemd to cope with and to prevent a DoS by resource exhaustion it kills it for good.

In my laptop (no speed daemon, tbh), I fixed redshift's start by using the followng override lines:

[Unit]
Wants=base.target
After=base.target

[Service]
Restart=on-failure
RestartSec=1sec

I depend on base.target instead of default.target because I want to use redshift even when booting to a console and I set Restart to on-failure, because there will be times when I may need to kill redshift forcefully. RestartSec fixed the process storm.

This task depends upon

Closed by  Lukas Fleischer (lfleischer)
Thursday, 14 April 2016, 05:37 GMT
Reason for closing:  Upstream
Comment by Vorbote (vorbote) - Tuesday, 12 January 2016, 12:43 GMT
After wading through more logs with "journalctl -x" I've found two things: First RestartSec= works if the the sleep time is greater; I've settled on 10 seconds, being on the safe side. Second, default.target is a better choice, but the Wants= (or Required= if you will) is needed. You really want to start redshift after all the session processes have settled, so After= it is.
Comment by Doug Newgard (Scimmia) - Tuesday, 12 January 2016, 16:04 GMT
So why is it not starting the first time? That's the real question.

The service file comes from upstream. If you really think it needs changed, you should contact them.

Loading...