From owner-freebsd-questions Sat Sep 13 17:34:37 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id RAA08798 for questions-outgoing; Sat, 13 Sep 1997 17:34:37 -0700 (PDT) Received: from w2xo.pgh.pa.us (w2xo.pgh.pa.us [206.210.70.5]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id RAA08793 for ; Sat, 13 Sep 1997 17:34:34 -0700 (PDT) Received: from w2xo.pgh.pa.us (w2xo.pgh.pa.us [206.210.70.5]) by w2xo.pgh.pa.us (8.8.5/8.8.4) with SMTP id UAA12724; Sat, 13 Sep 1997 20:34:54 -0400 (EDT) Message-ID: <341B312E.167EB0E7@w2xo.pgh.pa.us> Date: Sat, 13 Sep 1997 20:34:54 -0400 From: Jim Durham Organization: Dis- X-Mailer: Mozilla 3.01Gold (X11; I; FreeBSD 3.0-970618-SNAP i386) MIME-Version: 1.0 To: "Bryan K. Ogawa" CC: freebsd-questions@FreeBSD.ORG, Michael Richards <026809r@dragon.acadiau.ca> Subject: Re: Making X go right away References: <199709131312.KAA06001@dragon.acadiau.ca> <341AC9A0.15FB7483@w2xo.pgh.pa.us> <199709131938.MAA10120@foo.primenet.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk 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//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