View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 58 posts ] 
Go to page Previous  1, 2, 3, 4  Next

Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject:
PostPosted: Wed Mar 21, 2007 1:17 am 
Offline
Joined: Sat Sep 02, 2006 1:46 pm
Posts: 44
I think all that is needed is an entry in your /etc/sudoers file. The format is something like this:

Code:
mythtv  ALL=NOPASSWD:[command 1],[command 2], ...


mythshutdown should already be in that list and all I had to do was add my set wakeup time script and I was fine. With an entry in the /etc/sudoers and the right permissions it should work.


Top
 Profile  
 
PostPosted: Fri Mar 23, 2007 12:41 am 
Offline
Joined: Tue Oct 24, 2006 8:13 pm
Posts: 40
Thanks by the way for all the patience you folks are affording me. I must be the last one to figure this thing out. The last tip about permissions was a good one!

I've isolated the problem to Myth not calling setwakeup.sh (I added a line to echo to a file if it's been run). I can manually run the Nvram-Wakeup Command (sudo /usr/bin/setwakeup.sh) and it works (it echo's out to the test file OK). But when I turn the PC off and back on, I don't get an echo in the test file. In myth, I've got a scheduled recording at 10pm pending. Any ideas?


Top
 Profile  
 
PostPosted: Fri Mar 23, 2007 2:21 am 
Offline
Joined: Mon Jun 21, 2004 5:28 am
Posts: 700
Location: Germany
pairajacks wrote:
But when I turn the PC off and back on, I don't get an echo in the test file. In myth, I've got a scheduled recording at 10pm pending. Any ideas?
How did you turn off the PC? If you manually turn it off (ex. shutdown -h), the scripts won't run. You have to set it up so that the backend shuts down the computer. The backend will run the scripts just before it shuts down. The easiest way to do this is to set up mythwelcome. See the wiki on mythwelcome.

If you do have mythwelcome set up, check to see all the necessary mythtv setup parameters are set up correctly. Also remember that if the alarm time is already correct, it won't run the script.

_________________
ASUS AT3N7A-I (Atom 330)
TBS 8922 PCI (DVB-S2)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 01, 2007 9:43 pm 
Offline
Joined: Tue Oct 24, 2006 8:13 pm
Posts: 40
Yes, I was using (from root)
shutdown -h now

Still struggling with this, however, at one point I stumbled on it actually working (turning on and off after recording). Does exit (from knoppmyth desktop) and Poweroff (from within the blue Mythtv? i.e. Mythtv/Knoppmyth/Poweroff) equally shutdown the backend properly allow the setwakeup script to run?

I think it started working when I changed the Command to shutdown from the suggested "sudo shutdown -h" to "/sbin/poweroff".

Also I noticed that from terminal "sudo shutdown -h" results in error; it expects a time (after the h). ... So when user mythtv runs this command, it probably does nothing?

The /etc/sudoers file is another possible area for errors. Is there a limit to how many characters per line?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 01, 2007 10:43 pm 
Offline
Joined: Wed Apr 28, 2004 10:42 pm
Posts: 405
Location: Bendigo, Victoria, Australia
The wakeup time is only set if the backend initiates the shutdown. The backend wont shutdown if is doing stuff like recording or commercial flagging, or if a mythfrontend client is connected. So if you are at the mythtv menu then you are connected and the backend will not shutdown. If you exit mythfrontend and can just see the desktop wallpaper then the backend will shutdown when it is idle.

Because it isn't very user friendly to just quit to the X desktop, most people setup their system to use Mythwelcome. You set it to run at startup instead of the mythfrontend, and it will show a nice mythtv style display showing the status of the mythbackend and the tuners on the system.

Mythwelcome can recognize when you start the system manually and wont shutdown until you have been into the frontend and exited it.

_________________
Paul Turpie
-------------
<--Is your location in your profile? Why not?


Top
 Profile  
 
PostPosted: Mon Apr 02, 2007 8:19 pm 
Offline
Joined: Tue Oct 24, 2006 8:13 pm
Posts: 40
Thanks, I'll try that.

I've got mythwelcome in the [startup] script in fluxbox/apps, however, when I start the PC, I'm still in the original desktop window. I believe that when the PC starts up from an alarm, it opens up to the mythwelcome screen.

There must be some other start up location for normal PC turn on...? How do I set it to mythwelcome?

Also, it's hard to get to the desktop once you're in the Myth frontend and Mythwelcome screens; you exit out of Myth and it dumps you into Mythwelcome, and the only thing you can do in Mythwelcome is open the frontend. You need a keyboard and know the key combination to get to the desktop.

Telling the wife she needs to exit out of myth and let mythwelcome time out for shutdown (or else recordings will not work) is going to be problematic. Is there a way to add a menu item to a myth menu that would exit the frontend, then shutdown the backend? Since you do this everytime your're on the PC, it should be a big fat hard to miss button.


Top
 Profile  
 
PostPosted: Mon Apr 02, 2007 10:14 pm 
Offline
Joined: Wed Apr 28, 2004 10:42 pm
Posts: 405
Location: Bendigo, Victoria, Australia
pairajacks wrote:
Thanks, I'll try that.

I've got mythwelcome in the [startup] script in fluxbox/apps, however, when I start the PC, I'm still in the original desktop window. I believe that when the PC starts up from an alarm, it opens up to the mythwelcome screen.

There must be some other start up location for normal PC turn on...? How do I set it to mythwelcome?
What exactly is the line you used in /home/mythtv/.fluxbox/apps

pairajacks wrote:
Also, it's hard to get to the desktop once you're in the Myth frontend and Mythwelcome screens; you exit out of Myth and it dumps you into Mythwelcome, and the only thing you can do in Mythwelcome is open the frontend. You need a keyboard and know the key combination to get to the desktop.
I use the Menu button on my remote to bring up the mythwelcome menu which lets me quit it.

pairajacks wrote:
Telling the wife she needs to exit out of myth and let mythwelcome time out for shutdown (or else recordings will not work) is going to be problematic.
I just removed the other shutdown options from the main menu (I had already customised the menu structure.)
And removed the "Do you really want to exit?" confirmation screen in the frontend options, so that hitting Escape from the main menu would just drop back to mythwelcome. Just make sure you dont set the backends idle timeout to something stupid like 5 seconds, I have it set to 3 minutes but might drop it back to 90 seconds.

pairajacks wrote:
Is there a way to add a menu item to a myth menu that would exit the frontend, then shutdown the backend? Since you do this everytime your're on the PC, it should be a big fat hard to miss button.
I believe the next version of the mythshutdown command will have an option (-x) to allow you to do this. See the 0.21 release notes.
Note: This will be in the next MythTv release, which may be after the next Knoppmyth release.

_________________
Paul Turpie
-------------
<--Is your location in your profile? Why not?


Top
 Profile  
 
PostPosted: Fri Apr 06, 2007 11:27 am 
Offline
Joined: Tue Oct 24, 2006 8:13 pm
Posts: 40
Thanks, that makes sense, however, I think I'm still having a permissions problem. I assume all the scripts in mythwelcome --setup and mythtv-setup should work manually (ie sudo xxx) from a terminal as mythtv user.

Is there a limit to how long the "ALL=NOPASSWORDS" line in the sudoer file can be? It didn't seem to work with two smaller lines either (asks for a password)

sh-3.00$ whoami
mythtv
sh-3.00$ sudo mythshutdown --check
Password:
sh-3.00$

From my sudoers file
root@mythtv:/home/mythtv# visudo

knoppix ALL=NOPASSWD: ALL
#mythtv ALL=NOPASSWD:/usr/bin/setwakeup.sh,/sbin/shutdown,/usr/bin/mythshutdown
mythtv ALL=NOPASSWD:/usr/sbin/nvram-wakeup,/usr/local/bin/kmhalt.sh,/usr/bin/eject,/sbin/halt,/sbin/reboot,/bin/mount,/bin/umount,/usr/local/bin/mythbackup,/usr/local/bin/mythrestore,/etc/init.d/mythtv-backend,/usr/local/sbin/hibernate,/usr/bin/setwakeup.sh,/sbin/shutdown,/usr/bin/mythshutdown


Also, I've never been able to get " sudo shutdown -h " to work manually as mythtv user. It only works with a time after the "h", yet the wiki says "shutdown -h" ?????
sudo shutdown -h ...nothing happens
sudo shutdown -h now ...machine shuts down.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 22, 2007 9:13 am 
Offline
Joined: Mon May 10, 2004 1:28 pm
Posts: 28
Location: Newcastle on Tyne, United Kingdom
I'm struggling to get the wakeup via ACPI to actually work, before getting any scripts to run.

My motherboard is a Gigabyte 7n400v. I have the RTC alarm set to disabled in the bios, and I have tried all the tricks on the mythtv wiki.

Echoing a date and time into /acpi/alarm for a few minutes forward, and then catting it back for confirmation, always looks correct, but then when I power down the box, it does not restart.

Checking /acpi/alarm after the box is restarted displays the year and the inserted restart time correcly, but the month and days are at 00.

Does anybody have any more suggestions on whether or how I can get this to work.
Thanks

Gary


Top
 Profile  
 
 Post subject: alarm display
PostPosted: Wed Apr 25, 2007 6:47 pm 
Offline
Joined: Tue Oct 24, 2006 8:13 pm
Posts: 40
I have the same issue; look at previous pages of this post. Some motherboards apparently have to be awakened each day to see if there's any recording set for the day.

Restarting is tricky as well. You should shutdown from Mythwelcome, otherwise the scripts aren't run.

The shutdown command is confusing as well; sudo shutdown doesn't work from the terminal (it needs a time... like sudo shutdown now)


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 28, 2007 11:00 am 
Offline
Joined: Mon Aug 29, 2005 4:04 pm
Posts: 729
Location: Philadelphia, PA US
i am trying to get ACPI shutdown working and a little confused on the fussy BIOS fix.
Apparently I have a fussy BIOS 1 that uses UTC time. It won't wakeup after manually setting /proc/acpi/alarm via command
Code:
echo "+00-00-00 00:05:00" > /proc/acpi/alarm

Then shuting down using
Code:
shutdown -h now

BUT if I use
Code:
echo 5 > /proc/acpi/sleep
to shut down it wakes fine.

My question is do I APPEND the below FUSSY BIOS script to the end of /etc/init.d/hwclock.sh (before "hwclocksh "$@"" line)?

Or do I replace ALL the contents of /etc/init.d/hwclock.sh with the FUSSY BIOS script?

Both methods seems to work, but want to make sure I am doing the most correct method, while not allowing my hardware clock to get out of sync.

Code:
ACPITIME=`cat /proc/acpi/alarm`
                if [ "$HWCLOCKACCESS" != no ]
                then
                    if [ "$VERBOSE" != no ]
                    then
                        echo "Saving the System /etc/init.d/hwclock.shClock time to the Hardware Clock..."
                    fi
                    [ "$GMT" = "-u" ] && GMT="--utc"
                        /sbin/hwclock --systohc $GMT $BADYEAR
                    if [ "$VERBOSE" != no ]
                    then
                        echo "Hardware Clock updated to `date`."
                    fi
echo "$ACPITIME" > /proc/acpi/alarm


Thanks...


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 28, 2007 5:02 pm 
Offline
Joined: Thu Jan 05, 2006 5:53 pm
Posts: 24
I too am wondering that question. I think you are just supposed to add the two lines
Code:
 ACPITIME=`cat /proc/acpi/alarm`

and
Code:
echo "$ACPITIME" > /proc/acpi/alarm
but I could be wrong.

*edit* My answer is obviously wrong because I tried what I thought I was supposed to do and it never woke up. I also tried adding the whole section of code before the } at the end of the hwclock.sh script and that didn't work either, I am going to try it after that curly bracket now.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 13, 2007 9:14 pm 
Offline
Joined: Sat Oct 29, 2005 6:57 am
Posts: 176
I am following your how to. I am confused on step 5:
tohc1 wrote:
Heres my notes of what I did:

5) Disable the time update on shutdown, in /etc/init.d hwclock.sh (the clock is saved to the bios in setwakeup.sh before the alarm is set)



How do I do this? I don't see an obvious line in the hwclock.sh to edit. I am very new at this so please excuse me if this is a silly question.

Rkshack
Central time zone
R5f51
Winfast MoBo


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 14, 2007 5:41 am 
Offline
Joined: Mon Aug 29, 2005 4:04 pm
Posts: 729
Location: Philadelphia, PA US
Quote:
I am following your how to. I am confused on step 5:


See my previous post, I appended the section of code above in specified area and worked for me.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 14, 2007 7:58 am 
Offline
Joined: Sat Oct 29, 2005 6:57 am
Posts: 176
spalVl wrote:
See my previous post, I appended the section of code above in specified area and worked for me.


Is the specified area the end? Also shutdown -h does not work for me, but shutdown -h now will shut the compter down. Should I use that in the shutdown and the reboot area on mythwelcome setup?


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 58 posts ] 
Go to page Previous  1, 2, 3, 4  Next



All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 19 guests


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 post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu