We have an RC script for xdm nowadays

main
Chris Rees 3 years ago
parent 1c7144822f
commit 4d8cfb575f

@ -1790,20 +1790,11 @@ To return to the X session, switch to the virtual console running X. If X was st
[[xdm-boot]]
=== How do I start XDM on boot?
There are two schools of thought on how to start man:xdm[1]. One school starts `xdm` from [.filename]#/etc/ttys# (see man:ttys[5]) using the supplied example, while the other runs `xdm` from [.filename]#rc.local# (see man:rc[8]) or from an [.filename]#X# script in [.filename]#/usr/local/etc/rc.d#. Both are equally valid, and one may work in situations where the other does not. In both cases the result is the same: X will pop up a graphical login prompt.
There are two schools of thought on how to start man:xdm[1]. One school starts `xdm` from [.filename]#/etc/ttys# (see man:ttys[5]) using the supplied example, while the other sets `xdm_enable=yes` in [.filename]#/etc/rc.conf#. Both are equally valid, and one may work in situations where the other does not. In both cases the result is the same: X will pop up a graphical login prompt.
The man:ttys[5] method has the advantage of documenting which vty X will start on and passing the responsibility of restarting the X server on logout to man:init[8]. The man:rc[8] method makes it easy to `kill xdm` if there is a problem starting the X server.
If loaded from man:rc[8], `xdm` should be started without any arguments. `xdm` must start _after_ man:getty[8] runs, or else `getty` and `xdm` will conflict, locking out the console. The best way around this is to have the script sleep 10 seconds or so then launch `xdm`.
When starting `xdm` from [.filename]#/etc/ttys#, there still is a chance of conflict between `xdm` and man:getty[8]. One way to avoid this is to add the `vt` number in [.filename]#/usr/local/lib/X11/xdm/Xservers#:
[.programlisting]
....
:0 local /usr/local/bin/X vt4
....
The above example will direct the X server to run in [.filename]#/dev/ttyv3#. Note the number is offset by one. The X server counts the vty from one, whereas the FreeBSD kernel numbers the vty from zero.
When using the man:rc[8] method, `xdm_tty` (default `ttyv8`) can be set in [.filename]#/etc/rc.conf# to choose which vty man:xdm[1] opens on.
[[xconsole-failure]]
=== Why do I get Couldn't open console when I run xconsole?

Loading…
Cancel
Save