Opened 13 years ago

Closed 13 years ago

#3176 closed patch (fixed)

mythshutdown "Set Scheduled Wakeup Time" and "Detect Recording in Progress"

Reported by: anonymous Owned by: paulh
Priority: minor Milestone: unknown
Component: mythtv Version: head
Severity: medium Keywords: mythshutdown schedule recording test check
Cc: mythtv-dev@… Ticket locked: no

Description

This patch modifies mythshutdown so it can be used to shutdown the machine immediately, after performing checks for in-progress recordings and setting the wakeup time for the next recording.

Changes

-s/--status - An additional return value of 8 specifies that a recording is in progress.

Two new command-line parameters are available:

-t/--setscheduledwakeuptime - Gets the next scheduled recording and sets the wakeup time using the command specified in MythWelcome/MythShutdown? wakup command settings.

-x/--safeshutdown - equivalent to -c -t -q. This checks there is no recording in progress, sets the wakeup time for the next scheduled recording and shuts down the machine if everything completed successfully.

Use Cases:

1. Scripts want to quickly check if a recording is in progress:

mythshutdown -s returns 8 if a recording is in progress.

2. Scripts want to set wakeup time for next scheduled recording.

mythshutdown -t interrogates scheduler and places wakeup time in MythShutdownNextScheduled?.

3. Shutdown scripts - for example ACPI power button press, remote control power button press.

In most cases here the desired behaviour would be to shutdown the machine. However,

a) If there is a recording in progress the user would probably want the recording to continue.

b) The user would probably want the box to wake up in time for the next recording.

By using mythshutdown -x for these actions it will automatically check if a recording is in progress, get the scheduled wakeup time and shutdown the machine if successful.

Attachments (1)

mythtv-mythshutdown.diff (8.7 KB) - added by devel@… 13 years ago.
mythshutdown "Set Scheduled Wakeup Time" and "Detect Recording in Progress"

Download all attachments as: .zip

Change History (3)

Changed 13 years ago by devel@…

Attachment: mythtv-mythshutdown.diff added

mythshutdown "Set Scheduled Wakeup Time" and "Detect Recording in Progress"

comment:1 Changed 13 years ago by paulh

Owner: changed from Isaac Richards to paulh

comment:2 Changed 13 years ago by paulh

Resolution: fixed
Status: newclosed

(In [13101]) Apply a modified version of the patch by devel (at) mrwire.co.uk

From the ticket :-

Changes

  • -s/--status - An additional return value of 8 specifies that a recording is in progress.

Two new command-line parameters are available:

  • -t/--setscheduledwakeuptime - Gets the next scheduled recording and sets the wakeup time using the command specified in MythWelcome/MythShutdown? wakeup command settings.
  • -x/--safeshutdown - equivalent to -c -t -q. This checks there is no recording in progress, sets the wakeup time for the next scheduled recording and shuts down the machine if everything completed successfully.

The changes I made where to make the retrieving of the recording status optional because it just duplicates what MythWelcome? already does and has the side effect of opening a connection to the backend every time it wants the recording status which, if using the default verbose setting, causes the backend log to fill will HandleAnnounce? and adding: xxxx as a client messages.

Closes #3176.

Note: See TracTickets for help on using tickets.