1 |
I was thinking about the proper way to set-up the autologin some time |
2 |
ago. |
3 |
Some hints which came to my mind : |
4 |
1) should be started as a service so restart/start/stop may be used and |
5 |
doesn't leave an open root shell |
6 |
2) should be restarted with ctrl+alt+backspace without losing the |
7 |
keyboard focus (may be a problem when not using telinit) |
8 |
3) try to avoid the numerous wrappers of login managers in /etc/X11 |
9 |
4) should be able to come back to login manager by modifying only one |
10 |
conf.d file (or env.d ?) |
11 |
--- so below is the way I have set it up for the moment : |
12 |
I did a kind of merge of the xdm and startUS.sh (script found on the |
13 |
gentoo forums) so I don't have x11-apps/xdm but I have a xdm init script |
14 |
(which should have another name but it's just a modified version of the |
15 |
original xdm script) |
16 |
[xdm patch attached] |
17 |
To avoid the unresponsive keyboard : I always use telinit so : |
18 |
x:a:once:/etc/X11/startDM.sh |
19 |
is appended in my /etc/inittab. |
20 |
|
21 |
In startDM.sh a modification is done to make start-stop-daemon drop its |
22 |
privs and set the minimum env needed by startx then xinit. |
23 |
[startDM.sh patch attached] |
24 |
|
25 |
Notice two facts : env X=y start-stop-daemon is used because I was not |
26 |
able to use several --env options. |
27 |
My user's .xinitrc sources its .bash_profile (which source /etc/profile) |
28 |
to initialize the other variables. |
29 |
(I would like to export the bash completion to my whole X session, but it's |
30 |
another problem...) |
31 |
|
32 |
An alternative is the make start-stop-daemon launch 'su -- -l' |
33 |
but it's dirty because of the need to store the pid. |
34 |
|
35 |
So the first problem is that the xdm script doesn't know the pid of xinit |
36 |
because even without 'su', start-stop-daemon knows about startx, not |
37 |
xinit. |
38 |
The second one is that ctrl+alt+backspace isn't trapped correctly. |
39 |
Should 'xinit restart' be the direct work of the daemon in the autologin |
40 |
case ? |
41 |
In the autologin case which imho implies the user has a .xinitrc, startx |
42 |
is only useful for the 2 or 3 lines around mcookie. |
43 |
Should startx be directly in /etc/init.d . |
44 |
(as said in the header it's a old sample of this script) and the deep |
45 |
meaning of runlevel (multiuser / graphic) should be think from the |
46 |
beginning to understand the right way to organise the X11 launch stuff. |
47 |
What about putting startx's $defaultserverarg and $enable_xauth in a |
48 |
/etc/conf.d/xdm (or better : /etc/conf.d/xinit) ? |
49 |
|
50 |
(the local.start is a hacky but short and understandable way to do |
51 |
though :), a quick heavier case is there : http://www.gentoo-wiki.info/TIP_Passwordless_Login) |
52 |
Anyway, I'm still a bit lost in the quest of the cleanest way |
53 |
from system init to ~/xinitrc. |
54 |
So any comment, advice, whatever ... would be greatly appreciated. |
55 |
|
56 |
Raph |
57 |
|
58 |
On Fri, Mar 20, 2009 at 11:09:56PM +0800, fei huang wrote: |
59 |
> I don't have any "xdm", "gdm" stuff but would like to start my windows |
60 |
> manager directly at startup, cause I'm the only one that use it. |
61 |
> |
62 |
> here is my solution: |
63 |
> I use runlevel 3 as default, and add a line of code in |
64 |
> "/etc/conf.d/local.start": |
65 |
> |
66 |
> su - myname -c startx& |
67 |
> |
68 |
> this works just fine except my scim panel would not shown as before, but if |
69 |
> I login in normally with my user name, and type "startx" manually, |
70 |
> everything works perfect. I'm wondering what is the difference with those |
71 |
> two steps that cause the problem, |
72 |
> "ps" shows the scim processes are just running normally, for reference, I |
73 |
> pasted my "xinitrc" here: |
74 |
> |
75 |
> export XMODIFIERS='@im=SCIM' |
76 |
> export GTK_IM_MODULE=scim |
77 |
> scim -d |
78 |
> |
79 |
> xrdb -merge ~/.Xresources |
80 |
> urxvtd -q -f -o |
81 |
> |
82 |
> conky -q & |
83 |
> |
84 |
> exec awesome |
85 |
> |
86 |
> |
87 |
> any ideas? |
88 |
> |
89 |
> thanks |
90 |
> |
91 |
> fei |