sane crashes

Polytropon freebsd at edvax.de
Sun Mar 29 09:24:10 UTC 2020


On Sat, 28 Mar 2020 20:57:55 -0400, Vlad D. Markov wrote:
> In /etc/rc.local I had this line:
> 
> cd /home/vlad;/usr/bin/su - vlad /usr/local/bin/startx vt6
> 
> Removing it fixed my problem. I did the same thing under Debian
> and skipped logging on going directly into my X session.

Oh, your auto-login to X is the problem? In this case,
FreeBSD offers a convenient solution:



1. Create an entry in /etc/gettytab for your username
that should be automatically logged in, "vlad":

	autologin:\
		:al=vlad:tc=Pc:

You can add this infront of the other entries.



2. Use that profile for the 1st console in /etc/ttys:

	ttyv0 "/usr/libexec/getty autologin" xterm on secure

This will now automatically login "vlad" after system
startup (as the profile "autologin" will be used).
In order to run X for that user, use his local
configuration files. I assume you're using FreeBSD's
default shell configuration; changes might be needed
if you're using Bash, Zsh, or something else.



3. In you ~/.login file,

	#!/bin/sh
	mesg y
	[ ! -f /tmp/.X0-lock ] && startx

This makes sure there will be no attempt to start further
X sessions in case there's an additional console login.

Add the command

	logout

as last line in case you wish the uer to be logged off
(instead of dropped back to the console) if the X session
is terminated.



For proper shell configuration in X, and compatibility
with use of xdm (or any other display manager that honors
user setting, explicitely excludes GDM which doesn't care
about what users want) the following additions are quite
convenient:



4. Make your ~/.xsession file a "pointer to" your regular
X startup file:

	#!/bin/csh
	source ~/.cshrc
	exec ~/.xinitrc

Now you don't need two configuration files, one for if you
use xdm, and one for "startx". This file is ignored in case
you only use "startx", but if you later on introduce a
display manager such as xdm, no surprise about "empty desktop"
will occur.



5. Keep your settings in ~/.xinitrc as you probably already
have, for example:

	#!/bin/sh
	[ -f ~/.xmodmaprc ] && xmodmap ~/.xmodmaprc
	numlockx
	xbindkeys
	xsetroot -solid rgb:3b/4c/7a
	xset b 100 1000 15 &
	xset r rate 250 30 &
	xset s off &
	xset -dpms &
	exec wmaker

This approach should provide maximum flexibility, while needing
to have configuration elements only in _one_ file for each
distinct aspect. :-)



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list