Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[gentoo-user] start X at startup without a login manager

122 views
Skip to first unread message

fei huang

unread,
Mar 20, 2009, 11:20:16 AM3/20/09
to
I don't have any "xdm", "gdm" stuff but would like to start my windows manager directly at startup, cause I'm the only one that use it.

here is my solution:
I use runlevel 3 as default, and add a line of code in "/etc/conf.d/local.start":

su - myname -c startx&

this works just fine except my scim panel would not shown as before, but if I login in normally with my user name, and type "startx" manually,
everything works perfect. I'm wondering what is the difference with those two steps that cause the problem,
"ps" shows the scim processes  are just running normally, for reference, I pasted my "xinitrc" here:

export XMODIFIERS='@im=SCIM'
export GTK_IM_MODULE=scim
scim -d

xrdb -merge ~/.Xresources
urxvtd -q -f -o

conky -q &

exec awesome


any ideas?

thanks

fei

Nikos Chantziaras

unread,
Mar 20, 2009, 12:20:09 PM3/20/09
to
fei huang wrote:
> I don't have any "xdm", "gdm" stuff but would like to start my windows
> manager directly at startup, cause I'm the only one that use it.

Install it anyway and use the "autologin" feature. I know that KDM
supports it, and probably GDM too.

Florian Philipp

unread,
Mar 20, 2009, 2:10:09 PM3/20/09
to
fei huang schrieb:

> I don't have any "xdm", "gdm" stuff but would like to start my windows
> manager directly at startup, cause I'm the only one that use it.
>
You know that this is a possible security thread? Anyone who has access
to your computer can simply press Ctrl+Alt+F1 and enter the console
session you used to start x-server.
Locking your X-session won't help against that.

signature.asc

Joshua D Doll

unread,
Mar 20, 2009, 2:30:10 PM3/20/09
to
You can disable vt switching with:

Option "DontVTSwitch" "boolean" in the server section of the xorg.conf

--Joshua Doll

James Ausmus

unread,
Mar 20, 2009, 2:50:07 PM3/20/09
to
I don't think so - with the local.start method that he's talking about, the Virtual Console isn't logged in - X is started in the initscripts, not from a logged in console...

Fei - try checking the value of the "HOME" and other environment variable with the local.start method - I think that, since the initscripts are not running in an "interactive" login prompt, some necessary env vars are not being populated correctly. Maybe if you changed your su command to "su myuser -c "source /etc/profile && startx &"?

HTH-

-James

Sebastian Günther

unread,
Mar 20, 2009, 4:30:11 PM3/20/09
to
* Florian Philipp (lists@f_philipp.fastmail.net) [20.03.09 19:09]:
You did read, that he wants to start it via the local service, and from
the commandline?

Propably not, since then your advice is pointless.

--
" Religion ist das Opium des Volkes. " Karl Marx

SEB@STI@N GÜNTHER mailto:sam...@guenther-roetgen.de

Sebastian Günther

unread,
Mar 20, 2009, 4:30:15 PM3/20/09
to
* Nikos Chantziaras (rea...@arcor.de) [20.03.09 17:18]:

Well in that case, slim should be the better choice: no dependencies on
one of the two a little bloated DEs, and also has the autologin feature.

Sebastian

Paul Hartman

unread,
Mar 20, 2009, 4:40:07 PM3/20/09
to
On Fri, Mar 20, 2009 at 10:09 AM, fei huang <daniel....@gmail.com> wrote:
> I don't have any "xdm", "gdm" stuff but would like to start my windows
> manager directly at startup, cause I'm the only one that use it.

I agree with Sebastian, you should try "slim"

http://en.gentoo-wiki.com/wiki/SLiM

Sebastian Günther

unread,
Mar 20, 2009, 4:40:13 PM3/20/09
to
* fei huang (daniel....@gmail.com) [20.03.09 16:12]:

> su - myname -c startx&
>

> any ideas?

RTFM:

-, -l, --login
Provide an environment similar to what the user would expect had the user
logged in directly.

!>> When - is used, it must be specified as the last su option.

The other forms (-l and --login) do not have this restriction.

>
> thanks
>
> fei

HTH

Tom

unread,
Mar 20, 2009, 10:30:17 PM3/20/09
to
Or use qingy :)

It uses directfb, but its very lean, and you can set it to autologin I
think...which would probably not even use dircetfb, as qingy also has a
'text-fallback-mode'.

Try it, you'll like it ;-)

Tom

fei huang

unread,
Mar 20, 2009, 11:30:18 PM3/20/09
to
thank you all for the help!
the problem is finally solved.

thanks James!  I realized that the bash is not a login shell when invoked that way, and my locale variable in .bash_profile did not take effect. the command line now becomes:

su -l myname -c '-l' 'startx'

and worked!

thanks  Sebastian Günther,  this is really a important comment in the man page that I missed totally, I changed to "-l" instead to avoid the trick


and many nice login manager recommended here, I'll try them out later, compiling QT or GNOME components is a heavy work for my poor celeron processor.



thanks again..

fei

Florian Philipp

unread,
Mar 21, 2009, 3:20:11 AM3/21/09
to
Sebastian Günther schrieb:

> * Florian Philipp (lists@f_philipp.fastmail.net) [20.03.09 19:09]:
>> fei huang schrieb:
>>> I don't have any "xdm", "gdm" stuff but would like to start my windows
>>> manager directly at startup, cause I'm the only one that use it.
>>>
>> You know that this is a possible security thread? Anyone who has access
>> to your computer can simply press Ctrl+Alt+F1 and enter the console
>> session you used to start x-server.
>> Locking your X-session won't help against that.
>>
> You did read, that he wants to start it via the local service, and from
> the commandline?
>
> Propably not, since then your advice is pointless.
>

Err, right. Sorry for the noise.

signature.asc

gibb...@gmail.com

unread,
Mar 22, 2009, 9:10:17 AM3/22/09
to
I was thinking about the proper way to set-up the autologin some time
ago.
Some hints which came to my mind :
1) should be started as a service so restart/start/stop may be used and
doesn't leave an open root shell
2) should be restarted with ctrl+alt+backspace without losing the
keyboard focus (may be a problem when not using telinit)
3) try to avoid the numerous wrappers of login managers in /etc/X11
4) should be able to come back to login manager by modifying only one
conf.d file (or env.d ?)
--- so below is the way I have set it up for the moment :
I did a kind of merge of the xdm and startUS.sh (script found on the
gentoo forums) so I don't have x11-apps/xdm but I have a xdm init script
(which should have another name but it's just a modified version of the
original xdm script)
[xdm patch attached]
To avoid the unresponsive keyboard : I always use telinit so :
x:a:once:/etc/X11/startDM.sh
is appended in my /etc/inittab.

In startDM.sh a modification is done to make start-stop-daemon drop its
privs and set the minimum env needed by startx then xinit.
[startDM.sh patch attached]

Notice two facts : env X=y start-stop-daemon is used because I was not
able to use several --env options.
My user's .xinitrc sources its .bash_profile (which source /etc/profile)
to initialize the other variables.
(I would like to export the bash completion to my whole X session, but it's
another problem...)

An alternative is the make start-stop-daemon launch 'su -- -l'
but it's dirty because of the need to store the pid.

So the first problem is that the xdm script doesn't know the pid of xinit
because even without 'su', start-stop-daemon knows about startx, not
xinit.
The second one is that ctrl+alt+backspace isn't trapped correctly.
Should 'xinit restart' be the direct work of the daemon in the autologin
case ?
In the autologin case which imho implies the user has a .xinitrc, startx
is only useful for the 2 or 3 lines around mcookie.
Should startx be directly in /etc/init.d .
(as said in the header it's a old sample of this script) and the deep
meaning of runlevel (multiuser / graphic) should be think from the
beginning to understand the right way to organise the X11 launch stuff.
What about putting startx's $defaultserverarg and $enable_xauth in a
/etc/conf.d/xdm (or better : /etc/conf.d/xinit) ?

(the local.start is a hacky but short and understandable way to do
though :), a quick heavier case is there : http://www.gentoo-wiki.info/TIP_Passwordless_Login)
Anyway, I'm still a bit lost in the quest of the cleanest way
from system init to ~/xinitrc.
So any comment, advice, whatever ... would be greatly appreciated.

Raph

init.d_xdm.patch
X11_startDM.sh.patch

fei huang

unread,
Mar 23, 2009, 12:30:13 AM3/23/09
to

I think we've got too far for it, the startx in local.start does have some drawbacks, the system will become nonresponsive if I switch back to the console, and the X seems running on VT2 instead of VT7, I studied the xdm script and found I've missed lots of important steps, for stability, I tried a login manager "slim" that they recommended, it worked perfect for me,  everything are back to normal now! 

thanks again guys.

fei

Mick

unread,
Mar 25, 2009, 4:10:07 PM3/25/09
to

What is the benefit of SLiM compared to vanilla xdm + Fluxbox?
--
Regards,
Mick

signature.asc

Paul Hartman

unread,
Mar 25, 2009, 4:30:11 PM3/25/09
to

The original poster apparently did not want to use XDM. SLiM is
simplistic (no remote access, etc), and supposedly more secure (does
not need to run as root).

Sebastian Günther

unread,
Mar 25, 2009, 4:30:13 PM3/25/09
to
* Mick (michael...@gmail.com) [25.03.09 21:04]:

autologin, shutdown and reboot

0 new messages