Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 07-16-2010, 12:48 PM   #1
Registered: Jul 2010
Location: Portugal
Distribution: Arch Linux
Posts: 31

Rep: Reputation: 1
Start X on boot under a user login on Ubuntu (no gdm, kdm or xdm)

Hi, I'm trying to get rid of gnome as much as possible since I consider it bloated. I have everything according to my taste but when I boot I need to start x by hand (through xinit) and I would like it to start automatically.

So I created a script in /etc/init.d/ to do that. If I just execute xinit on the script it runs X as root (we all know that's highly not recommended), so I tried su - username -c "xinit" to no avail. However if I start another program, say rtorrent, like that (replacing xinit with rtorrent) it works perfectly.

What do I need to do start X under a username on login? I don't want a login manager just to do something which I am so close to do.
Old 07-16-2010, 12:54 PM   #2
Registered: Feb 2010
Distribution: Arch Linux
Posts: 68

Rep: Reputation: 19
I use Arch Linux, and found this a little while ago in their wiki:

It gives instructions on how to accomplish this in the /etc/inittab file. Even though Ubuntu doesn't have an /etc/inittab file, I think you probably could just use the command on the wiki page in your script.

/bin/su PREFERED_USER -l -c "/bin/bash --login -c /usr/bin/startx >/dev/null 2>&1"
1 members found this post helpful.
Old 07-16-2010, 01:24 PM   #3
Registered: Jul 2010
Location: Portugal
Distribution: Arch Linux
Posts: 31

Original Poster
Rep: Reputation: 1
Thanks! Worked perfectly I still find it a bit strange to have to do it this way, but it works under my conditions so I'd say solved.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot login into GDM, KDM, XDM anymore (X issue) robbbert Linux - General 11 10-19-2006 08:04 AM
KDM, GDM, XDM login problems TomJ Linux - Software 2 10-04-2004 11:14 AM
Cannot start xdm, kdm or gdm icisyd Linux - Newbie 13 09-23-2004 06:38 PM
kdm cannot login to KDE, but gdm and xdm work fine?? ming0 Slackware 2 09-01-2004 02:08 AM
X login screen XDM/KDM/GDM jesselong Linux - Software 4 06-12-2004 10:02 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:31 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration