LinHES Forums http://forums.linhes.org/ |
|
Shell Script for /etc/init.d/gdm restart ? http://forums.linhes.org/viewtopic.php?f=17&t=5520 |
Page 1 of 3 |
Author: | ThisPageIntentionallyLeft [ Thu Jul 28, 2005 1:51 pm ] |
Post subject: | Shell Script for /etc/init.d/gdm restart ? |
Hi, and thanks in advance to your help. I've only noticed one bug in this latest build that prevents it from being great for use by non-technical end users: the GUI becomes unresponsive at times. When I'm using the system myself, I'm often logged in via ssh from my PowerBook, and so I quickly solve the problem with one command as root: /etc/init.d/gdm restart After one second of blah, blah, everything's back to normal. If I were a shell script hipster, I'd write a script that maps /etc/init.d/gdm restart, oh, for instance to Ctrl-Alt-R or Ctrl-Alt-. -- something like that. Armed with this, my intelligent yet uneducated roommates could easily solve any problems themselves. Of course, feel free to make a suggestion if you think you know of something better to use than /etc/init.d/gdm restart . Are there any shell script hipsters that can show me how? Thank you very much. ![]() Peter |
Author: | Xsecrets [ Thu Jul 28, 2005 3:35 pm ] |
Post subject: | |
well lets see a completely bland with no error checking or anything fancy would look something like Code: #!/bin/bash
/etc/init.d/gdm restart if would of course then have to be made executable and now that I think of it you would have to be root to run it unless you enabled sudo then you would have to add sudo to the script. also there are some posts about having the remote do this for you, though it would depend on just how unresponsive the system has become as to wether or not it would work. you may want to search for those. |
Author: | ThisPageIntentionallyLeft [ Thu Jul 28, 2005 3:53 pm ] |
Post subject: | |
Thanks. Yes, the script would have to run as root to work. I found this article: http://wilsonet.com/mythtv/tips.php (Scroll down to "Make Myth even more wife-friendly".) That's where I got the original idea, but why use the remote when many posts point out that the installations of various things breaks this functionality? Also, we don't have much call to use the remote. We have Dish Network, which as you probably know doesn't have the proper serial interface to make channel changing possible. Hmmm, unless you mean that I can hack into the Dish Network remote. That would be cool. But I don't think that's what you meant. ![]() Is there a way to make this executable by root even when the normal user executes it with a single keyboard command? Would you think it better to restart the myth frontend or gdm for this application? Thanks. |
Author: | Xsecrets [ Thu Jul 28, 2005 6:45 pm ] |
Post subject: | |
If you don't have anything setup to change the channels on the dish box how do you record what you want to? And if you don't have or use a remote with mythtv how do you pause rewind or fast forward? |
Author: | ThisPageIntentionallyLeft [ Thu Jul 28, 2005 6:51 pm ] |
Post subject: | |
Like everyone with Dish Network, we leave in on the channel we want to record and use a post-it note for people. It certainly llimits the functionality, but doesn't erase it. And it could be an incentive for us to switch. Anyhow, can we map this to our wireless keyboard? That would be more useful than mapping it to the remote. |
Author: | Xsecrets [ Thu Jul 28, 2005 6:56 pm ] |
Post subject: | |
most people I've talked to with satelite use an irblaster so that myth can change the channel on the statelite box itself when it's ready to record. I don't know of any way to map it to a key on the keyboard, but I haven't messed with that kind of stuff very much, so It might be possible. |
Author: | ThisPageIntentionallyLeft [ Thu Jul 28, 2005 7:01 pm ] |
Post subject: | |
Well, its good to know that people have had success with Dish Network. I'll start reading up on ir blaster. However, that will take time and experimentation. Hopefully, I'll find some keyboard solution in the meantime. Thanks. |
Author: | ThisPageIntentionallyLeft [ Fri Jul 29, 2005 5:50 pm ] |
Post subject: | |
Hi. I've found something that works for now, but that restart gdm command would be quicker. Darn. Here's the deal: Crtl-Alt-Backspace works except the uneducated end user have to wait 30 seconds for it to begin to re-login. If you exit Myth and Right-Click on the Desktop, you can select Apps --> System --> GDM Setup then authenticate and lood at the General tab. Lower the timer for the auto login to 5 seconds and then click close. Now it relogs in after 5 seconds. Bummer: You can set it for less than 5 seconds but it don't work! It will override you and countdown from 5 anyway. Again, this will help make this more "roommate friendly", but I'm hoping someone can post a solution that maps a keyboard command to root activation of /etc/init.d/gdm restart since it is much faster and doesn't restart stuff that doesn't need restarting. I've found some keyboard mapping software, but most is for KDE, not Gnome. For the stuff that looks like it might work, I'm still studying and googling cuz I just don't understand everything they're talking about. Check out: http://rick.vanrein.org/linux/funkey/ and http://www.geocities.com/wmalms/#XHKEYS Thanks for reading my post. |
Author: | Xsecrets [ Fri Jul 29, 2005 6:17 pm ] |
Post subject: | |
well before you waste too much time knoppmyth does not use gnome. it just uses the gdm from it. for a window manager it uses fluxbox. |
Author: | ThisPageIntentionallyLeft [ Fri Jul 29, 2005 6:26 pm ] |
Post subject: | |
Thank you. I was unaware of the subtle differences between GDM and Gnome. I'd thought it just stood for Gnome Display Manager and was the same thing. No wonder I wasn't finding the conf file everyone was talking about! Now googling flux info... |
Author: | ThisPageIntentionallyLeft [ Fri Jul 29, 2005 11:01 pm ] |
Post subject: | |
From my research, this works; in reality, it does not. How can I bend space and time to make this work? Thanks. create the shell script: nano /usr/local/bin/gdm_restart.sh add text: #!/bin/bash /etc/init.d/gdm restart.sh Ctrl-x y Set it to continue to be owned by root, but executable my a common slob and act with root permissions when it does: chmod a+s /usr/local/bin/gdm_restart.sh Edit the fluxbox keyboard commands to make Ctrl-Alt-r execute it: nano /etc/X11/fluxbox/keys add this at the bottom of the file: Mod1 r :ExecCommand ./usr/local/bin/restart_gdm.sh Ctrl-x y I'm hoping that I'm doing one small thing wrong that fresh eyes may spot. ![]() Bibliography: http://fluxbox.sourceforge.net/docbook.php http://linuxreviews.org/beginner/Bash-B ... index.html |
Author: | Xsecrets [ Fri Jul 29, 2005 11:03 pm ] |
Post subject: | |
while you were modding it to run su root did you also mod it to be executable? |
Author: | ThisPageIntentionallyLeft [ Fri Jul 29, 2005 11:20 pm ] |
Post subject: | |
Thank you very much. I just ran: chmod +x /usr/local/bin/restart_gdm.sh and the output from: ls -l /usr/local/bin/restart_gdm.sh is -rwsr-sr-x 1 root root 37 Jul 29 20:56 /usr/local/bin/restart_gdm.sh And it doesn't work. Drag. Another dumb mistake? |
Author: | tjc [ Sat Jul 30, 2005 10:21 am ] |
Post subject: | |
The setuid and setgid bits aren't honored on shell scripts... This is mostly because the #! magic actually ends up running /bin/bash with the script file as an argument and bash is not setuid/setgid. There are various other reasons associated with security however. |
Author: | ThisPageIntentionallyLeft [ Sat Jul 30, 2005 10:33 am ] |
Post subject: | |
Thanks for getting back to me. Guess I'm groping in the dark. As you know, I would love to have some keyboard command run as root: /etc/init.d/gdm restart because that very quickly unsticks the GUI when stuck. I'm happy to read documentation and try to figure it out (as I have been), but if I'm approaching this from the wrong direction, please let me know. Is there a command on one line that I can enter into fluxbox? Or is there a way to make that command doable by the mythtv user in addition to the super user? I've been reading multiple Linux newbie guides and googling things like '"shell script" "as root"', etc. |
Page 1 of 3 | All times are UTC - 6 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |