Anyone have a shutdown script for MMS on Ubuntu?

Moderator: Moderator

User avatar
marko-polo
Posts: 20
Joined: Sat Mar 08, 2008 2:56 am
Contact:

Anyone have a shutdown script for MMS on Ubuntu?

Postby marko-polo » Mon May 19, 2008 2:44 am

I just noticed the line in /etc/mms/Config that can call a shutdown script. Does anyone have a script they would be willing to share that will work on Ubuntu?

If not, is it a good idea for me to try modifying one of the mythTV shutdown scripts for MMS?

User avatar
Mikka
veteran
Posts: 173
Joined: Sun Apr 08, 2007 1:50 pm
Contact:

Postby Mikka » Mon May 19, 2008 7:15 am

hi,

you dont need a shutdown script.
you can use a shutdown script or simple a command

shutdown_script = sudo halt

or put a script like
shutdown_script = /usr/local/bin/shutdown

#!/bin/sh
#
echo 'System is going down!'
sudo halt

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Re: Anyone have a shutdown script for MMS on Ubuntu?

Postby acmelabs » Mon May 19, 2008 7:28 am

marko-polo wrote:I just noticed the line in /etc/mms/Config that can call a shutdown script. Does anyone have a script they would be willing to share that will work on Ubuntu?

If not, is it a good idea for me to try modifying one of the mythTV shutdown scripts for MMS?

As long as you don't plan to do magic with your script, you can use a simple shutdown -h 0
My local magic here consists of a S3 ( suspend to RAM ) script and was already posted into this forum here :)

Regards
Andreas

User avatar
marko-polo
Posts: 20
Joined: Sat Mar 08, 2008 2:56 am
Contact:

Postby marko-polo » Mon May 19, 2008 10:27 am

I tried adding the shutdown command to the Config file, but no success. Here is an excerpt for my /etc/mms/Config:

# Examples:
# "shutdown -h now" will shut the computer down when quiting mms
#
shutdown_script = sudo shutdown -h now


I can't figure out how it's possible for MMS to run the shutdown command in the first place, since that requires the user to be a superuser or get superuser privileges via sudo.

I tried shutdown_script = sudo halt too, but no luck there either.


One more note, when attempting to shutdown the computer in MMS, I am selecting "Halt System" instead of "Quit" - I guess that is right.

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Postby acmelabs » Mon May 19, 2008 11:01 am

@Lorenzo: What's the cleanest way to shutdown the system without having started MMS as root?

Regards,
Andreas

User avatar
magicamun
master
Posts: 688
Joined: Thu Feb 28, 2008 7:42 am
Location: Germany

Postby magicamun » Mon May 19, 2008 11:12 am

Consider using /etc/sudoers.

There is no magic to shutdown without being root.

lorenzodes
master
Posts: 772
Joined: Sun Mar 11, 2007 4:50 pm
Location: move.l 4.w,a6

Postby lorenzodes » Mon May 19, 2008 12:38 pm

acmelabs wrote:@Lorenzo: What's the cleanest way to shutdown the system without having started MMS as root?

Regards,
Andreas


sudo shutdown -h now

It requires user to be added in sudoers (with the NOPASSWD flag) for the command above.
"I’m not frightened of dying, anytime will do, I don’t mind. Why should I be frightened of dying? There’s no reason for it, you gotta go sometime"

parti02
veteran
Posts: 232
Joined: Sat Jun 16, 2007 5:52 pm

Postby parti02 » Mon May 19, 2008 1:31 pm

on gutsy i add
shutdown_script = sudo /sbin/halt
in the Config file.

and add these line with visudo in /etc/sudoers
mms ALL = NOPASSWD: /sbin/halt

Gruß
Dirk

zakmes
Posts: 17
Joined: Mon Jun 16, 2008 8:15 am
Location: Germany
Contact:

Postby zakmes » Tue Jun 24, 2008 11:55 am

parti02 wrote:on gutsy i add
shutdown_script = sudo /sbin/halt
in the Config file.

and add these line with visudo in /etc/sudoers
mms ALL = NOPASSWD: /sbin/halt

Gruß
Dirk

thats what i did.

if i do run /sbin/halt from console, shutdown works with user "mms". if i press the power button in mms only x stops, but the system keeps running.. anyone know how to fix that?

edit:
i also tried this script (wiki)

#!/bin/sh
/usr/bin/sudo -u root /sbin/halt -p

same effect..

lorenzodes
master
Posts: 772
Joined: Sun Mar 11, 2007 4:50 pm
Location: move.l 4.w,a6

Postby lorenzodes » Tue Jun 24, 2008 12:29 pm

I guess logs are the only place where you can find why the script fails.
"I’m not frightened of dying, anytime will do, I don’t mind. Why should I be frightened of dying? There’s no reason for it, you gotta go sometime"

zakmes
Posts: 17
Joined: Mon Jun 16, 2008 8:15 am
Location: Germany
Contact:

Postby zakmes » Tue Jun 24, 2008 1:12 pm

i still have not figured out where mms stores the logs?

lorenzodes
master
Posts: 772
Joined: Sun Mar 11, 2007 4:50 pm
Location: move.l 4.w,a6

Postby lorenzodes » Tue Jun 24, 2008 7:27 pm

zakmes wrote:i still have not figured out where mms stores the logs?


I meant system logs.
"I’m not frightened of dying, anytime will do, I don’t mind. Why should I be frightened of dying? There’s no reason for it, you gotta go sometime"

zakmes
Posts: 17
Joined: Mon Jun 16, 2008 8:15 am
Location: Germany
Contact:

Postby zakmes » Wed Jun 25, 2008 12:10 pm

i checked the syslog: there is nothing in there related to mms or shutdown messages...

edit:
solved.

quit -> halt system works.
i think i misunderstood the mapping of the mms shutdown key. it actually stops mms but does not perform a shutdown. im now using lircrc with irexec to execute my shutdown script.

User avatar
Uatschitchun
Overlord
Posts: 3189
Joined: Tue Dec 06, 2005 6:55 pm
Location: Germany
Contact:

Postby Uatschitchun » Wed Jun 25, 2008 2:27 pm

Why don't you use the Menu-Entry "Quit" to shutdown?
Lg
Roman

zakmes
Posts: 17
Joined: Mon Jun 16, 2008 8:15 am
Location: Germany
Contact:

Postby zakmes » Thu Jun 26, 2008 10:38 am

because this only stop X - it doesnt shutdown the system. at alteast thats the situation i have here.


Return to “general discussion”

Who is online

Users browsing this forum: No registered users and 2 guests