You are not logged in.

#1 2011-04-09 09:33:28

konos5
Member
Registered: 2011-03-16
Posts: 56

inittab script question and qingy..

Hi everyone,

I was reading the https://wiki.archlinux.org/index.php/St … .2Finittab and would like to
ask a question about the following entry:

x:5:once:/bin/su - -- PREFERRED_USER -l -c '/usr/bin/startx </dev/null'

Can someone explain to me the line above step-by-step?

I only know so far that the double dash '--' prevents the shell from reorganizing the arguments..but..

1)What is the 'PREFERRED_USER'?
2)What is this '</dev/null?

One more thing...I installed qingy to close the "security hole" but for some reason each character I type on the terminal
is echoed by a factor of 2 making me unable to login...!
How can I fix that?

Thank you all in advance!

Last edited by konos5 (2011-04-09 09:53:55)

Offline

#2 2011-04-09 14:20:27

koomi
Member
Registered: 2010-09-26
Posts: 17

Re: inittab script question and qingy..

1)'PREFERRED_USER' is the user you want to login as.
2)I don't know what '</dev/null' does here. My guess is it should read '>/dev/null' which would redirect the output of the 'startx' command to /dev/null so it doesn't spam your terminal. '</dev/null' returns an end-of-file which I can't make any sense of in this case.

What this line does:
When your PC enters runlevel 5 (x:5:) at boot the command 'su' with the '-' option is executed which invokes a login shell where you can login to PREFERRED_USER. The '--' makes sure the following arguments are parsed to the shell and not to su. The -c option makes the shell execute the command at the end of the line immediatly and makes it run in non-interactive mode which also means it doesn't do the login thing unless you tell it to with the -l (short for --login) option.
Oh and everything happens only once after boot so you can close X and login to the terminal normally (the 'once:').

I'm pretty sure you don't need the '- --' part, it should work without as well.

Offline

#3 2011-04-09 15:53:29

konos5
Member
Registered: 2011-03-16
Posts: 56

Re: inittab script question and qingy..

right...I do understand what u are saying but now I'm a little confused with the order things are happening...

so my guess is...

1) su is executed first but has to wait for its arguments..
2) the 'PREFERRED_USER' is an environmental variable which gets set after '-l' is executed in the shell
3) the user types its username/password, the PREFERRED_USER gets set and is put as an argument to su
4) after su is complete and the user is logged in, the rest of the command is executed which somehow starts the X server (startx)

Is that correct?

P.S. what would be the difference if we did:

x:5:once:/bin/su - PREFERRED_USER -- -l -c '/usr/bin/startx </dev/null'

??

Last edited by konos5 (2011-04-09 15:53:55)

Offline

#4 2011-04-09 20:51:25

koomi
Member
Registered: 2010-09-26
Posts: 17

Re: inittab script question and qingy..

Ah no there's a misunderstanding here, PREFERRED_USER is just a placeholder for your login name. In the script you write konos5 instead or whatever you normally login as.

After reading in the newsgroup linked in the wiki article a little I realised this is more complicating than I thought. There seems to be some issue with invoking bash as a login shell through su, thus the -l option needs to be passed to bash directly (what should do the same as the - option of su). The issue in the newsgroup is in su version 5.2.1 though, we're at 8.10.

As for the order I think it's like this:
1) su is executed with the - option. The - option doesn't seem to have any effect though
2) su invokes a shell with the -l and -c options, thus it's a login shell
3) the user enters his password
4) the shell executes the argument of the -c option (startx)

The -- has to be either right before or right after the username, see http://linux.derkeiler.com/Newsgroups/c … 00718.html.

Offline

#5 2011-04-10 11:37:24

konos5
Member
Registered: 2011-03-16
Posts: 56

Re: inittab script question and qingy..

And as for my first question I quote from the wiki...

"Synaptic touchpad and keyboard issue

Qingy (and quite possibly other DirectFB applicationss) has some issues using Synaptics touchpad. Also the keyboard can behave strangely (like if each keys were pressed twice).

This can be solved by adding:

disable-module=linux_input

to /etc/directfbrc. If the file does not exist, create it. This will enable you to use your touchpad, however some extra functionality like tapping or tap-dragging might not work. "

Thank you very much for your time and effort!

Last edited by konos5 (2011-04-10 11:38:02)

Offline

Board footer

Powered by FluxBB