Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

bash script

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming
View previous topic :: View next topic  
Author Message
liaty



Joined: Tue Mar 14, 2006 5:10 pm
Posts: 30

PostPosted: Tue Jul 25, 2006 8:49 pm    Post subject: bash script Reply with quote

I'm trying to create a single link to enable/disable xgl.

So far I have two bash scripts.


#!/bin/bash
gnomesu start_xgl

which calls

#!/bin/bash
gnome-xgl-switch --enable-xgl;killall gdm;gdm

The problem I have I think is that the script itself is being shutdown with gnome session.
It worked once, xgl was enabled, gdm shutdown and then gdm logged into gnome session.

Most of the time though it crashes the x server and a reboot is needed.
Other times it gets to the console but does not restart gdm.

Can anyone see where I am going wrong?
Is there a better way to restart gdm?
Back to top
View user's profile Send private message
towy71
Moderator


Joined: Wed Apr 06, 2005 3:11 pm
Posts: 4257
Location: wild West Wales

PostPosted: Tue Jul 25, 2006 10:34 pm    Post subject: RE: bash script Reply with quote

you don't say which distro you're using and how you install xgl etc.?
_________________
still looking for that door into summer
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8453
Location: Warrington, UK

PostPosted: Tue Jul 25, 2006 11:07 pm    Post subject: RE: bash script Reply with quote

If you are running the script from an X terminal, it will stop when the X session shuts down.

Try having the first script do
Code:
gnomesu screen start_xgl

_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
liaty



Joined: Tue Mar 14, 2006 5:10 pm
Posts: 30

PostPosted: Tue Jul 25, 2006 11:23 pm    Post subject: Reply with quote

Thanks, got it with.
/etc/init.d/xdm restart in the second script

I can now call start/stop xgl from links on desktop.
Distro is OpenSuse 10.1
For other distros the command could be /etc/init.d/gdm restart
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> 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
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast