Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
living without xdm, gdm, kdm
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
f.kater
Guru
Guru


Joined: 23 May 2002
Posts: 342
Location: Berlin

PostPosted: Wed Feb 12, 2003 11:17 pm    Post subject: living without xdm, gdm, kdm Reply with quote

Hi
since some time now I try to find a way how to boot into X as a user without typing username and password. gdm offers this way but it must go without gdm and gnome stuff somehow...

So I deleted the xdm script from the default runlevel and added my one one:

Code:

#!/sbin/runscript
 
depend() {
#    need bar
   after *
}
 
start() {
    ebegin "Starting X"
    su - userme /home/userme/.xstarter.sh
    eend $? "Failed to start X"
}


Whereas .xstarter.sh contains the following lines:

Code:

export PATH="/usr/local/bin:/usr/bin:/bin:/usr/i686-pc-linux-gnu/gcc-bin/3.2:/opt/Acrobat5:/usr/X11R6/bin: /opt/blackdown-jdk-1.3.1/bin:/opt/blackdown-jdk-1.3.1/jre/bin"
/usr/X11R6/bin/startx


With this I boot directly into X as the user 'userme'. The problem is that a lot of X things do not work as expected later on... E.g. the mpg-player doesn't find /dev/dsp (?) anymore and so on.

I think my scripts have got some big errors somewhere... Something of my concept is wrong. What would be a better way to do it?

Maybe I should use the xdm script (with the special 'a' runlevel thing) and change it a bit but I didn't succeed ...

Do you have any idea what I should do next?

Thanks


(I post an extract of the original xdm script here..:)

Code:
setup_dm() {
   source /etc/profile.env
   export PATH="/bin:/sbin:/usr/bin:/usr/sbin:${ROOTPATH}"

   case "$(echo ${DISPLAYMANAGER} | awk '{ print toupper($1) }')" in
      KDM|KDE|KDE2|KDE3)   
         EXE="$(which kdm)"
         ;;
      GDM|GNOME)
         EXE=/usr/bin/gdm
         ;;
      *)   
         EXE=/usr/X11R6/bin/xdm
         ;;
   esac

   test ! -x "${EXE}" && EXE=/usr/X11R6/bin/xdm

   SERVICE="${EXE##*/}"
}

start() {
   setup_dm
   
   ebegin "Setting up ${SERVICE}"
   #save the prefered DM
   save_options "service" "${EXE}"
   #tell init to run /etc/X11/startDM.sh after current
   #runlevel is finished (should *not* be in the "boot"
   #                      runlevel).
   /sbin/telinit a &>/dev/null
   eend 0
}
Code:



EDIT: Added a space in PATH so it would wrap to next line. -- kanuslupus
Back to top
View user's profile Send private message
dennis
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jun 2002
Posts: 84

PostPosted: Thu Feb 13, 2003 1:58 am    Post subject: Reply with quote

looks like that user isnt in the audio group. thats not a problem with you script though
Back to top
View user's profile Send private message
Delphiki
Guru
Guru


Joined: 04 Oct 2002
Posts: 337
Location: A2

PostPosted: Thu Feb 13, 2003 3:00 am    Post subject: Reply with quote

A source /etc/profile in the .xstarter.sh might help some of your problems.
_________________
Excellent..
Back to top
View user's profile Send private message
f.kater
Guru
Guru


Joined: 23 May 2002
Posts: 342
Location: Berlin

PostPosted: Thu Feb 13, 2003 8:53 pm    Post subject: Reply with quote

Delphiki wrote:
A source /etc/profile in the .xstarter.sh might help some of your problems.

Thank You. But this didn't help.

What *could* be the reason why using my startup scripts make mpg123 not find /dev/dsp (while with normal xdm oder gdm startup it does find it)? What do I actually change without knowing of it?

I've got no idea where to begin...

'bye
Back to top
View user's profile Send private message
BlackBart
Apprentice
Apprentice


Joined: 07 Oct 2002
Posts: 252

PostPosted: Fri Feb 14, 2003 12:34 am    Post subject: Reply with quote

what's wrong with .xauthority?
Back to top
View user's profile Send private message
f.kater
Guru
Guru


Joined: 23 May 2002
Posts: 342
Location: Berlin

PostPosted: Sun Feb 16, 2003 8:24 pm    Post subject: Reply with quote

BlackBart wrote:
what's wrong with .xauthority?

Hi BlackBart, sorry, I don't understand what you mean...

Meanwhile things have changed a little.
When I use my own boot scipts to start X (see new versions below) I can't use mpg123 as a *user* but after su at least root *can* start mpg123 and play songs. But what's the problem with the user? I haven't changed the rights to /dev/dsp (and with normal xdm boot script the user could use mpg123 of course). I wouldn't like to change the rights to /dev/dsp but understand what's wrong.

Here are my new boot scripts. Now, I am using runlevel 'a' like azarah recommends to start X:

This is /etc/init.d/xdm2

Code:
#!/sbin/runscript
# Start X Font Server before X
depend() {
   use xfs hotplug
}

start() {
   #tell init to run /etc/X11/startDM.sh after current
   #runlevel is finished
   /sbin/telinit a &>/dev/null
   eend 0
}

This is my version of /etc/X11/startDM.sh:
Code:
source /etc/init.d/functions.sh
source /etc/profile
export GDK_USE_XFT=1
su - userme -c /home/userme/.xstarter.sh

Thank You!
Back to top
View user's profile Send private message
jstuart
n00b
n00b


Joined: 03 Dec 2002
Posts: 57

PostPosted: Mon Feb 17, 2003 7:53 am    Post subject: Reply with quote

what are your permissions to /dev/dsp and whatever it links to?

SOunds like a perms problem to me...
_________________
Jeff Stuart
JAHGU (Just another happy Gentoo User)
Back to top
View user's profile Send private message
f.kater
Guru
Guru


Joined: 23 May 2002
Posts: 342
Location: Berlin

PostPosted: Mon Feb 17, 2003 11:35 am    Post subject: Reply with quote

jstuart wrote:
what are your permissions to /dev/dsp and whatever it links to?


Hi, your question led me to another hint in this issue: With normal xdm boot there are other permissions than with my special boot script!

While the permissions of /dev/dsp (a link) stay the same ...
Code:
lr-xr-xr-x    1 root     root            9 2003-02-17 11:14 /dev/dsp -> sound/dsp


... the permissions to /dev/sound/dsp change:
In case of a normal xdm boot it is
Code:
crw-------    1 userme   audio     14,   3 1970-01-01 01:00 /dev/sound/dsp

With my boot script it is however
Code:
crw-------    1 root     audio     14,   3 1970-01-01 01:00 /dev/sound/dsp

So, I think the problem could be solved if I add userme to the audio group - but still I would like to understand why (in case of my special boot script) the permissions are other than with a normal boot script.
Any idea? It seems that I am missing some basic knowledge about /dev/-permissions...
Back to top
View user's profile Send private message
f.kater
Guru
Guru


Joined: 23 May 2002
Posts: 342
Location: Berlin

PostPosted: Mon Feb 17, 2003 3:27 pm    Post subject: Reply with quote

dennis wrote:
looks like that user isnt in the audio group. thats not a problem with you script though

Hi dennis,
now that I review the whole issue here I realize that you recommended exactly the right thing - sorry that I didn't concider it earlier. Thanks for that.

Having done this make things work. Seems that I've got my own working boot scripts and full control over shutdown and reboot processes without xdm, kdm, gdm! Great.

Nevertheless I am curious to know why the permissions to /dev/sound/dsp change with these two different boot scripts...
Back to top
View user's profile Send private message
BlackBart
Apprentice
Apprentice


Joined: 07 Oct 2002
Posts: 252

PostPosted: Tue Feb 18, 2003 4:33 am    Post subject: Reply with quote

f.kater wrote:
BlackBart wrote:
what's wrong with .xauthority?

Hi BlackBart, sorry, I don't understand what you mean...


sorry, I was thinking of .xsession. It sounds to me like you are trying te execute a script on logging in from XDM, can't you just stick the script in ~/.xsession and have it execute?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum