On Sat, 7 Aug 2010 19:33:58 -0500, Antonio Olivares <olivares14...@gmail.com> 
wrote:
> Polytropon,
> 
> So if I delete the file /etc/rc.local and make a file ~/.login, make
> it executable (chmod +x ~/.login), and add the line
> 
> 
>        [ -f /tmp/.X0-lock ] && startx
> in that file and I will have the same result but without loggin in as
> root?

Correct. The user specified by the autologin directive will
be the user who runs the "startx" command, so no need for
using "su".


Here's an example from a working FreeBSD 5 system:

/etc/ttys:

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

Intead of "Pc", the profile to be used is named "autologin".

/etc/gettytab:

        autologin:\
                :al=praxis:tc=Pc:

The name "praxis" is the user's account name for the user
to be logged in automatically. All capabilities defined
in "Pc" will also be incorporated.

/home/praxis/.login:

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

This makes sure the same username can be used for an SSH
login (and it WON'T try to start another X then), or it
can be used to log in via text mode console. When X is
shut down, the user will be dropped to the text mode CLI.
If you don't want to do that, add "logout" as the next
line in ~/.login, or enclose the whole "startx" line in
a loop. But this can lead to problems when X is not
working properly.






-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to