Difference between revisions of "Mythshutdown"

From MythTV Official Wiki
Jump to: navigation, search
m (Using mythshutdown to block shutdown)
(Link to MythShutdown on MythWelcome page)
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{Incomplete}}
 
{{Incomplete}}
=== Using mythshutdown to block shutdown ===
+
=== Using Mythshutdown to block shutdown ===
 
Mythshutdown can be used to block an automatic shutdown.  Since 0.21 it is possible to call mythshutdown --lock from each script so that shutdown will remain blocked until the last script has terminated and called mythshutdown --unlock.
 
Mythshutdown can be used to block an automatic shutdown.  Since 0.21 it is possible to call mythshutdown --lock from each script so that shutdown will remain blocked until the last script has terminated and called mythshutdown --unlock.
  
Line 15: Line 15:
 
</pre>}}
 
</pre>}}
  
See, also, [[Mythwelcome]].
+
 
 +
The full command-line options are (taken from version 0.25.1 output):
 +
{{Code box|mythshutdown --help|<pre>
 +
Misc. Options:
 +
-c OR --check                Check whether shutdown is possible
 +
--lock                        disable shutdown
 +
-x OR --safeshutdown          Check if shutdown is possible, and shutdown
 +
-t OR --setscheduledwakeup    Set wakeup time to the next scheduled recording
 +
-w OR --setwakeup            Set the wakeup time (yyyy-MM-ddThh:mm:ss)
 +
-h OR --help OR --usage      Display this help printout, or give detailed information of selected option.
 +
--version                    Display version information.
 +
--shutdown                    Apply wakeup time to nvram and shutdown.
 +
-p OR --startup              Check startup status
 +
-s OR --status                check current status
 +
-u OR --unlock                enable shutdown
 +
 
 +
Logging Options:
 +
--loglevel                    Set the logging level.  All log messages at lower levels will be discarded.
 +
                              In descending order: emerg, alert, crit, err, warning, notice, info, debug
 +
                              defaults to info
 +
--logpath                    Writes logging messages to a file in the directory logpath with filenames in the format: applicationName.date.pid.log.
 +
                              This is typically used in combination with --daemon, and if used in combination with --pidfile, this can be used with log rotators, using the HUP call to inform MythTV to reload the file
 +
--nodblog                    Disable database logging.
 +
-q OR --quiet                Don't log to the console (-q).  Don't log anywhere (-q -q)
 +
--syslog                      Set the syslog logging facility.
 +
                              Set to "none" to disable, defaults to none.
 +
-v OR --verbose              Specify log filtering. Use '-v help' for level info.
 +
 
 +
 
 +
</pre>}}
 +
 
 +
 
 +
See, [[Mythwelcome]] for more information on using MythShutdown.

Revision as of 14:50, 11 July 2012

Incomplete.png Incomplete, needs to be expanded. Please help to fill the gaps or discuss the issue on the talk page

Using Mythshutdown to block shutdown

Mythshutdown can be used to block an automatic shutdown. Since 0.21 it is possible to call mythshutdown --lock from each script so that shutdown will remain blocked until the last script has terminated and called mythshutdown --unlock.


Script.png script.sh
#!/bin/bash
# Unlock if the script is terminated for any reason
trap "/usr/local/bin/mythshutdown --unlock" 0 SIGHUP SIGINT SIGQUIT SIGABRT SIGKILL SIGALRM SIGSEGV SIGTERM

# Lock shutdown
/usr/local/bin/mythshutdown --lock

# Do script stuff


The full command-line options are (taken from version 0.25.1 output):

Script.png mythshutdown --help
Misc. Options:
-c OR --check                 Check whether shutdown is possible
--lock                        disable shutdown
-x OR --safeshutdown          Check if shutdown is possible, and shutdown
-t OR --setscheduledwakeup    Set wakeup time to the next scheduled recording
-w OR --setwakeup             Set the wakeup time (yyyy-MM-ddThh:mm:ss)
-h OR --help OR --usage       Display this help printout, or give detailed information of selected option.
--version                     Display version information.
--shutdown                    Apply wakeup time to nvram and shutdown.
-p OR --startup               Check startup status
-s OR --status                check current status
-u OR --unlock                enable shutdown

Logging Options:
--loglevel                    Set the logging level.  All log messages at lower levels will be discarded.
                              In descending order: emerg, alert, crit, err, warning, notice, info, debug
                              defaults to info
--logpath                     Writes logging messages to a file in the directory logpath with filenames in the format: applicationName.date.pid.log.
                              This is typically used in combination with --daemon, and if used in combination with --pidfile, this can be used with log rotators, using the HUP call to inform MythTV to reload the file
--nodblog                     Disable database logging.
-q OR --quiet                 Don't log to the console (-q).  Don't log anywhere (-q -q)
--syslog                      Set the syslog logging facility.
                              Set to "none" to disable, defaults to none.
-v OR --verbose               Specify log filtering. Use '-v help' for level info.



See, Mythwelcome for more information on using MythShutdown.