Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos-rebuild switch restarted X server #40218

Closed
qknight opened this issue May 9, 2018 · 7 comments
Closed

nixos-rebuild switch restarted X server #40218

qknight opened this issue May 9, 2018 · 7 comments

Comments

@qknight
Copy link
Member

qknight commented May 9, 2018

Issue description

during my last update, which was probably between revision 1445 and 1449 a nixos-rebuild switch restarted my X-server which was quite a surprise.

  services.xserver = {
    enable = true;
    videoDrivers = [ "intel" ];
    deviceSection = ''
      Option      "AccelMethod"  "uxa"
    '';
    layout = "us";
    xkbOptions = "eurosign:e";
    config = ''
      Section "InputClass"
        Identifier "Logitech"
        MatchProduct "Logitech USB Laser Mouse"
        MatchIsPointer "true"
        MatchDevicePath "/dev/input/event*"
        # maps MMB to a different button
        Option "ButtonMapping" "1 8 3 4 5 6 7 2"
      EndSection
      Section "InputClass"
        Identifier "TPPS/2 IBM TrackPoint"
        MatchProduct "TPPS/2 IBM TrackPoint"
        MatchDevicePath "/dev/input/event*"
        Option "EmulateWheel" "true"
        Option "EmulateWheelButton" "2"
        Option "Evdev Wheel Emulation Timeout" "200"
      EndSection
    '';
    windowManager.i3.enable = true;
    displayManager = {
      sessionCommands = with pkgs; ''
        # synchronize clipboards
        ${autocutsel}/bin/autocutsel -s PRIMARY &
      '';
    };
  };

i'm not sure where to start but it could either be a systemd dependency which restarted xorg or it could be xorg itself.

  • nixos/modules/services/x11/xserver.nix (looks good)
  • nixos/modules/services/x11/window-managers/i3.nix (looks good)
  • display-manager (?)

display-manager

systemctl cat display-manager
# /nix/store/z6xpl883ms9vzyz849cic9d3zzcalkka-unit-display-manager.service/display-manager.service
[Unit]
After=systemd-udev-settle.service local-fs.target acpid.service systemd-logind.service
Description=X11 Server
Wants=systemd-udev-settle.service

[Service]
Environment="LD_LIBRARY_PATH=/run/opengl-driver/lib"
Environment="LOCALE_ARCHIVE=/nix/store/8kw71xqs5bz6s68dylv6y13082zn0023-glibc-locales-2.27/lib/locale/locale-archive"
Environment="PATH=/nix/store/jy9knxp7nmw80jkf932axrs1b4p9k4hi-coreutils-8.29/bin:/nix/store/n7km6qpl46bd9lkvf9cvzwv6gks7szls-findutil>
Environment="SLIM_CFGFILE=/nix/store/kphy4z1i4w9bs2gqvfh26m31jzf85zcl-slim.cfg"
Environment="SLIM_THEMESDIR=/nix/store/kmc39z5yxzyq2bh64ak3rfsv6lm3487a-slim-theme"
Environment="TZDIR=/nix/store/w4wn1sk992qshff66i8wf3xmmzqvaimv-tzdata-2017c/share/zoneinfo"

X-RestartIfChanged=false


ExecStart=/nix/store/476v5p12d00x5zlhsp9x5vc8rjrdi2vd-unit-script/bin/display-manager-start 
ExecStartPre=/nix/store/12n4894wz3s8dx59d281bzdzn2bxlppv-unit-script/bin/display-manager-pre-start
Restart=always
RestartSec=200ms
StartLimitBurst=3
StartLimitInterval=30s
SyslogIdentifier=display-manager

the Restart=always, is that new?

revisions

root@lenovo-t530 ~# nix-env -p /nix/var/nix/profiles/system --list-generations
1445   2018-04-24 15:31:23   
1446   2018-05-04 11:05:00   
1447   2018-05-08 19:29:00   
1448   2018-05-08 19:34:39   
1449   2018-05-09 00:14:40   (current)

nix-channel --list

nix-channel --list
nixos https://nixos.org/channels/nixos-unstable

nixos-version

nixos-version
18.09.af55a0c-nixcloud_0aee8ab (Jellyfish)

oh and i can't re-trigger this.

@qknight
Copy link
Member Author

qknight commented May 9, 2018

just added some bogus into:

    displayManager = {
      sessionCommands = with pkgs; ''
        # synchronize clipboards
        # bogus added
        ${autocutsel}/bin/autocutsel -s PRIMARY &
      '';
    };

and rebuilding shows:

nixos-rebuild switch
building Nix...
building the system configuration...
these derivations will be built:
  /nix/store/26sa766wkvw0q9zgq4az08f2ank14d51-xsession.drv
  /nix/store/wxlkkk23r5pmxghkmsq6hfbzkrncwpk8-desktops.drv
  /nix/store/xpncgy6r3zc454d4wpchs3wxycdchn88-slim.cfg.drv
  /nix/store/yb0gqgjapjq9qvs5nz5dsywagjmrwqgc-unit-display-manager.service.drv
  /nix/store/pc6v9h8if1ph1avc47n7avh4q9vgsw2v-system-units.drv
  /nix/store/cqysvrrqpxhziy01dbcag35ny73vv5ch-etc.drv
  /nix/store/frvbvs0glj49wxs1f6psl7lf4xfsly4n-nixos-system-lenovo-t530-18.09.af55a0c-nixcloud_0aee8ab.drv
building '/nix/store/26sa766wkvw0q9zgq4az08f2ank14d51-xsession.drv'...
building '/nix/store/wxlkkk23r5pmxghkmsq6hfbzkrncwpk8-desktops.drv'...
building '/nix/store/xpncgy6r3zc454d4wpchs3wxycdchn88-slim.cfg.drv'...
building '/nix/store/yb0gqgjapjq9qvs5nz5dsywagjmrwqgc-unit-display-manager.service.drv'...
building '/nix/store/pc6v9h8if1ph1avc47n7avh4q9vgsw2v-system-units.drv'...
building '/nix/store/cqysvrrqpxhziy01dbcag35ny73vv5ch-etc.drv'...
building '/nix/store/frvbvs0glj49wxs1f6psl7lf4xfsly4n-nixos-system-lenovo-t530-18.09.af55a0c-nixcloud_0aee8ab.drv'...
updating GRUB 2 menu...
NOT restarting the following changed units: display-manager.service
activating the configuration...
setting up /etc...
setting up tmpfiles


@qknight
Copy link
Member Author

qknight commented May 9, 2018

journalctl -u display-manager.service

here is the part where the restart takes place...

Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0):         3020350056502100001e000000fd0023
Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0):         781e5311000a202020202020000000fc
Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0):         003237373047340a2020202020200159
Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0):         020327f14b101f051404130312021101
Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0):         230907078301000065030c001000681a
Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0):         000001012378008c0ad08a20e02d1010
Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0):         3e96005650210000188c0ad090204031
Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0):         200c405500565021000018011d007251
Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0):         d01e206e28550056502100001eab22a0
Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0):         a050841a303020360056502100001a00
Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0):         00000000000000000000000000000047
Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0): Printing probed modes for output HDMI3
Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0): Modeline "1920x1080"x60.0  148.50  1920 2008 2052 2200  1080 1084 1089 1125 +hsync +vsync (67.5 kHz eP)
Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0): Modeline "1920x1080"x50.0  148.50  1920 2448 2492 2640  1080 1084 1089 1125 +hsync +vsync (56.2 kHz e)
Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0): Modeline "1920x1080"x59.9  148.35  1920 2008 2052 2200  1080 1084 1089 1125 +hsync +vsync (67.4 kHz e)
Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0): Modeline "1920x1080i"x60.0   74.25  1920 2008 2052 2200  1080 1084 1094 1125 interlace +hsync +vsync (33.8 kHz e)
Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0): Modeline "1920x1080i"x50.0   74.25  1920 2448 2492 2640  1080 1084 1094 1125 interlace +hsync +vsync (28.1 kHz e)
Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0): Modeline "1920x1080i"x59.9   74.18  1920 2008 2052 2200  1080 1084 1094 1125 interlace +hsync +vsync (33.7 kHz e)
Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0): Modeline "1280x1024"x75.0  135.00  1280 1296 1440 1688  1024 1025 1028 1066 +hsync +vsync (80.0 kHz e)
Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0): Modeline "1280x1024"x60.0  108.00  1280 1328 1440 1688  1024 1025 1028 1066 +hsync +vsync (64.0 kHz e)
Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0): Modeline "1440x900"x59.9   88.75  1440 1488 1520 1600  900 903 909 926 +hsync -vsync (55.5 kHz e)
Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0): Modeline "1280x720"x60.0   74.25  1280 1390 1430 1650  720 725 730 750 +hsync +vsync (45.0 kHz e)
Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0): Modeline "1280x720"x50.0   74.25  1280 1720 1760 1980  720 725 730 750 +hsync +vsync (37.5 kHz e)
Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0): Modeline "1280x720"x59.9   74.18  1280 1390 1430 1650  720 725 730 750 +hsync +vsync (45.0 kHz e)
Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0): Modeline "1024x768"x120.0  115.50  1024 1072 1104 1184  768 771 775 813 +hsync -vsync (97.6 kHz e)
Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0): Modeline "1024x768"x100.0  113.27  1024 1096 1208 1392  768 769 772 814 -hsync +vsync (81.4 kHz)
Apr 12 17:50:16 lenovo-t530 display-manager[3026]: (II) intel(0): Modeline "1024x768"x75.0   78.75  1024 1040 1136 1312  768 769 772 800 +hsync +vsync (60.0 kHz e)
Mai 08 19:29:00 lenovo-t530 systemd[1]: Stopping X11 Server...
Mai 08 19:29:33 lenovo-t530 systemd[1]: Starting X11 Server...
Mai 08 19:29:33 lenovo-t530 systemd[1]: Started X11 Server.
Mai 08 19:29:33 lenovo-t530 display-manager[16488]: /nix/store/4clqqwqnnwiin3ggkmfgsdlyc90w8p6d-xsession "xterm+i3" - xterm+i3
Mai 08 19:29:33 lenovo-t530 display-manager[16488]: /nix/store/4clqqwqnnwiin3ggkmfgsdlyc90w8p6d-xsession "xterm" - xterm
Mai 08 19:29:33 lenovo-t530 display-manager[16488]: /nix/store/4clqqwqnnwiin3ggkmfgsdlyc90w8p6d-xsession "none+i3" - none+i3
Mai 08 19:29:33 lenovo-t530 display-manager[16488]: /nix/store/4clqqwqnnwiin3ggkmfgsdlyc90w8p6d-xsession "xterm+i3" - xterm+i3
Mai 08 19:29:33 lenovo-t530 display-manager[16488]: /nix/store/4clqqwqnnwiin3ggkmfgsdlyc90w8p6d-xsession "xterm" - xterm
Mai 08 19:29:33 lenovo-t530 display-manager[16488]: /nix/store/4clqqwqnnwiin3ggkmfgsdlyc90w8p6d-xsession "none+i3" - none+i3
Mai 08 19:29:33 lenovo-t530 display-manager[16488]: /nix/store/4zqp44mppbk0y6msl1ap4hsgk2p6f04s-xauth-1.0.10/bin/xauth:  file /var/run/slim.auth does not exist
Mai 08 19:29:33 lenovo-t530 display-manager[16488]: slim: waiting for X server to begin accepting connections
Mai 08 19:29:33 lenovo-t530 display-manager[16488]: X.Org X Server 1.19.6
Mai 08 19:29:33 lenovo-t530 display-manager[16488]: Release Date: 2017-12-20
Mai 08 19:29:33 lenovo-t530 display-manager[16488]: X Protocol Version 11, Revision 0
Mai 08 19:29:33 lenovo-t530 display-manager[16488]: Build Operating System: Linux 4.9.56 x86_64
Mai 08 19:29:33 lenovo-t530 display-manager[16488]: Current Operating System: Linux lenovo-t530 4.14.29 #1-NixOS SMP Wed Mar 21 11:06:45 UTC 2018 x86_64
Mai 08 19:29:33 lenovo-t530 display-manager[16488]: Kernel command line: BOOT_IMAGE=(hd0,msdos1)//kernels/ag7kn4vxlqi9i53r8bmifgfkvb0k8srr-linux-4.14.29-bzImage systemConfig=/nix/store/bias92lpl2bpzr3cknnnbya5ikl8q5lj-nixos-system-lenovo-t530-18.09.ea145b6-nixcloud_91a10>
Mai 08 19:29:33 lenovo-t530 display-manager[16488]: Build Date: 09 April 2018  10:15:01AM

@teto
Copy link
Member

teto commented May 9, 2018

Not sure if it 's for the same reasons or/and because I mixed home-manager i3 config + system's awesome but that did occur to me several times. The way nixos kicks us out of X is kinda violent IMO. I don't know if it can be warned upon/deferred/disallowed with a flag but that could prove helpful.

@xeji
Copy link
Contributor

xeji commented May 9, 2018

see also #37739

@primeos
Copy link
Member

primeos commented May 11, 2018

I think #37739 is a bit different (17.09 -> 18.03, IIRC I was fine on nixos-unstable at the time of that issue) but both seem to be related to systemd.

But #39791 could be identical. The same thing happend to me recently on nixos-unstable and is reproducible. Unfortunately I didn't had time to have a closer look yet. In my case I suspect that it was due to restarting systemd-logind (After=systemd-logind.service) or systemd (systemctl daemon-reexec).

Restart=always is fine ("Configures whether the service shall be restarted when the service process exits, is killed, or a timeout is reached", see man systemd.service).

@stale
Copy link

stale bot commented Jun 4, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 4, 2020
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Apr 22, 2024
@samueldr
Copy link
Member

(Triaging)

Hi @qknight,

With the changes over the past 6 years, including some I know about, I suspect this particular shouldn't be an issue anymore.

If you can still reproduce this issue, please feel free to re-open this issue.

(@primeos: same goes to you, if you can reproduce the issue again, feel free to add details and re-open.)

To anyone else: if you think you are experiencing a similar issue, please open a new issue. Feel free to cross-reference this issue. It is more likely that you are observing the same symptoms, but are having different issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants