nixpkgs/nixos/modules/services
8573 34435a9502 redshift: Fix default value of $DISPLAY (#17746)
Before commit 54fa0cfe4e, the `redshift`
service was run with the environment variable `DISPLAY` set to `:0`.

Commit 54fa0cfe4e changed this to
instead use the value of the `services.xserver.display` configuration
option in the value of the `DISPLAY` variable. In so doing, no default
value was provided for the case where `services.xserver.display` is
`null`.

While the default value of `services.xserver.display` is `0`, use of
which by the `redshift` module would result in `DISPLAY` again being
set to `:0`, `services.xserver.display` may also be `null`, to which
value it is set by, e.g., the `lightdm` module.

In the case that `services.xserver.display` is `null`, with the change
made in commit 54fa0cfe4e, the `DISPLAY`
variable in the environment of the `redshift` service would be set to
`:` (a single colon), which, according to my personal experience,
would result in —

  - the `redshift` service failing to start; and

  - systemd repeatedly attempting to restart the `redshift` service,
    looping indefinitely, while the hapless `redshift` spews error
    messages into the journal.

It can be observed that the malformed value of `DISPLAY` is likely at
fault for this issue by executing the following commands in an
ordinary shell, with a suitable `redshift` executable, and the X11
display not already tinted:

  - `redshift -O 2500` — This command should reduce the color
    temperature of the display (making it more reddish).

  - `DISPLAY=':' redshift -O 6500` — This command should raise the
    color temperature back up, were it not for the `DISPLAY`
    environment variable being set to `:` for it, which should cause
    it to, instead, fail with several error messages.

This commit attempts to fix this issue by having the `DISPLAY`
environment variable for the `redshift` service default to its old
value of `:0` in the case that `services.xserver.display` is `null`.

I have tested this solution on NixOS, albeit without the benefit of a
system with multiple displays.
2016-08-17 13:34:26 +02:00
..
amqp
audio mopidy service: add default value for configuration (#17385) 2016-07-31 18:35:09 +02:00
backup crashplan: Wait for filesystems to be mounted before starting 2016-08-14 11:56:21 +02:00
cluster
computing slurm service: robust reference to slurm bin output 2016-05-28 15:28:21 +02:00
continuous-integration gocd-agent: 16.7.0 startup fixes + test improvements 2016-08-10 15:47:29 -04:00
databases further fix manual evaluation 2016-08-10 15:51:01 +01:00
desktops gnome-keyring: add gcr dependency to service 2016-05-10 19:53:33 +02:00
development hoogle service: fixups 2016-04-22 03:58:08 +02:00
editors nixos manual: add Emacs section (fixes #13217) 2016-08-02 11:17:52 +01:00
games Merge pull request #17479 from elitak/factorio 2016-08-07 04:09:52 +02:00
hardware Revert "Merge branch 'modprobe-fix' of git://github.com/abbradar/nixpkgs" 2016-08-15 19:05:52 -04:00
logging logstash: 1.5.3 -> 2.3.4 2016-07-27 17:45:38 +02:00
mail rspam module: use mkEnableOption 2016-07-28 07:06:35 +02:00
misc gitlab service: add option for db_key_base secret 2016-08-17 13:17:47 +02:00
monitoring dd-agent: support jmx, needs a separate daemon nowadays. 2016-07-29 12:42:07 +00:00
network-filesystems Revert "Merge branch 'modprobe-fix' of git://github.com/abbradar/nixpkgs" 2016-08-15 19:05:52 -04:00
networking unifi: Open required ports by default. 2016-08-16 21:01:49 +01:00
printing cups service: use cups.out everywhere 2016-04-16 21:26:33 +02:00
scheduling
search nixos/elasticsearch: Set a group on the user 2016-07-01 18:21:42 +02:00
security Fixes #16181 - using bin output for Go services 2016-06-13 23:32:16 +02:00
system services.dbus module: more complete docstring 2016-06-28 08:24:32 +01:00
torrent transmission service: robust lib references in apparmor profile 2016-05-22 20:01:29 +02:00
ttys
web-apps mattermost service: init 2016-08-15 04:15:11 +02:00
web-servers phpfpm: allow old config format as well (#17754) 2016-08-15 14:41:26 +02:00
x11 redshift: Fix default value of $DISPLAY (#17746) 2016-08-17 13:34:26 +02:00