Home  >  Q&A  >  body text

linux - 怎样通过 SSH 正确重启 GNOME Shell?

总有 gnome-shell 卡死的时候, 只好通过 SSH 或 tty2 进入, 或者 tty2 都进不去,,

可如果我直接杀掉进程想起动, 每次都会提示无法打开:

#➤➤ kill -9 2136
#➤➤ eval `gnome-shell --replace`
Window manager error: Unable to open X display
#➤➤ gnome-shell
Window manager error: Unable to open X display
#➤➤ gnome-shell --replace
Window manager error: Unable to open X display

如果重启整个 Window Manager 的话, 桌面上已经开启的应用是不会保存的, 单独重启 gnome-shell 倒是可以, 课我怎样才能单独重启 gnome-shell 呢?

天蓬老师天蓬老师2742 days ago770

reply all(1)I'll reply

  • 大家讲道理

    大家讲道理2017-04-17 11:35:01

    你需要指定 X 服务器的位置,也就是 DISPLAY 环境变量。通常,本地的在 :0 上:

    DISPLAY=:0 gnome-shell --replace
    

    reply
    0
  • Cancelreply