
我兩天前更新了系統,現在發現 startx systemd 腳本無法啟動。這似乎是由於 Arch 預設啟動到 tty1 造成的。切換到 tty7 並重新啟動 startx systemd 腳本運作正常,大概是因為 systemd 腳本指定了 tty7。僅執行“startx”命令會導致兩天前出現以下錯誤:
(==) Log file: "/home/XXXXX/.local/share/xorg/Xorg.0.log", Time: Wed Feb 10 19:13:22 2016
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE)
Fatal server error:
(EE) parse_vt_settings: Cannot open /dev/tty0 (No such file or directory)
(EE)
(EE)
Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.
(EE) Please also check the log file at "/home/XXXXX/.local/share/xorg/Xorg.0.log" for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error
Couldn't get a file descriptor referring to the console
以下是 systemd 腳本的相關片段:
TTYPath=/dev/tty7
ExecStart = /usr/bin/xinit /usr/bin/dbus-launch --exit-with-session /usr/bin/kodi-standalone -- :0 -nolisten tcp vt7
Restart = on-abort
StandardInput = tty
通常系統啟動到 tty7,無論是否指定 tty7,GUI 應用程式啟動都沒有問題,現在 startx 嘗試預設使用 tty0,這似乎不存在。預設行為有變化嗎?如何解決這個問題?
答案1
我終於找出原因了。我編輯了 Kodi 所需的 Xwrapper.config,並從那時起更改了它以測試它的要求。更新必須更改了某些內容,從而再次需要它。
sudo nano /etc/X11/Xwrapper.config
allowed_users=anybody
needs_root_rights = yes // no value caused issues
sudo startx 仍然可以在沒有任何選項的情況下工作,儘管運行它並退出將導致無法切換到 tty7。
我仍然不知道為什麼需要它,因為我的理解是 startx 不需要 root 權限。