Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Sep 1997 20:34:54 -0400
From:      Jim Durham <durham@w2xo.pgh.pa.us>
To:        "Bryan K. Ogawa" <bkogawa@primenet.com>
Cc:        freebsd-questions@FreeBSD.ORG, Michael Richards <026809r@dragon.acadiau.ca>
Subject:   Re: Making X go right away
Message-ID:  <341B312E.167EB0E7@w2xo.pgh.pa.us>
References:  <199709131312.KAA06001@dragon.acadiau.ca> <341AC9A0.15FB7483@w2xo.pgh.pa.us> <199709131938.MAA10120@foo.primenet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Bryan K. Ogawa wrote:
> 
> >Michael Richards wrote:
> >>
> >> Does anyone know how to make X fire up right away? I remember I just changed
> >> something in inittab for linux, but FreeBSD seems to be a little different
> >> :)
> 
> >You just need to put "startx" or "xinit" in a startup script in
> >/usr/local/etc/rc.d in 3.0, or perhaps in /etc/rc.local in earlier
> >versions.
> 
> Hm... I've never tried this, but it seems like this would start your X
> server as a root user.  Does startx/xinit know enough to start xdm ?
> 
> >There is also a trick you can play that will log you in automatically
> >and start up your desktop. Instead of the above, try
> >putting a file in your home directory called 'xstart' or whatever
> >with only the line 'xinit &' in it. Then in your startup script do:
> 
> >su username < /usr/home/<user>/xstart &
> 
> >Be *sure* to make these scripts 700 or 744 .
> 
> Hm.  This does sound like you're starting your X server as root, which
> seems a more insecure than need be, under the principle of least
> privelige.
> 
> You can also start xdm in your rc.local, which will provide an X-based
> login screen.  When you log in, all of the x clients will run as the
> user logged in.
> 
You're right...I answered too fast.  I actually use the 2nd method here.
If you actually did it the first way, you could probably exclose the
whole
thing in parens and do: '(su username ; xinit ) &' or some such. I
haven't
tried this. I use the su username < script method.
The way this works is that it starts up a shell running under the
specified
username and then reads in the script. Since the scripts says "xinit &",
it starts up X under that user name.

I have a need for this because I have a process that needs to run all
the
time that lives in an X window. I want it to come up automatically on
reboot.
My computer is in my home and it's OK to have it automatically come up
with
an X screen under my user ID, as nobody "bad" can get access to the
console.

Works for me ! 8-) 
-- 
Jim Durham <Television Engineer-Unitel Mobile Video, Pittsburgh>
  <Computer Consultant/Hobbyist> <Amateur Radio: W2XO>
  <Web:http://www.w2xo.pgh.pa.us>; <Packet:W2XO@W2XO.#SWPA.PA.USA.NOAM>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?341B312E.167EB0E7>