Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#8160 closed defect (fixed)

Shutdown with user script from menu broken in trunk

Reported by: chrisl Owned by: JYA
Priority: major Milestone: 0.23
Component: MythTV - General Version: head
Severity: medium Keywords: shutdown
Cc: Ticket locked: no

Description

I upgraded from .22-fixes to trunk, and my shutdown script is no longer called when I select "Yes, Exit and Shutdown" from the exit menu. It ignores my script and simply shuts down.

Strangely my shutdown script gets called when I press menu from the main menu to get the System Menu and select "Shutdown" from that menu. It just doesn't work from the exit menu.

Attachments (2)

use_user_shutdown_script.patch (1.6 KB) - added by chrisl 10 years ago.
set_default_values.patch (1.3 KB) - added by chrisl 10 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 10 years ago by chrisl

This bug was initiated in ticket #7749.

If the user is running under a managed session, then the user's shutdown script will be ignored.

The logic for shutting down should be first to use the user shutdown script if provided. If not, then use the D-Bus shutdown, and the last option is shutdown with a hardcoded halt.

comment:2 Changed 10 years ago by paulh

Milestone: unknown0.23
Owner: changed from Isaac Richards to JYA
Priority: minormajor
Status: newassigned

Changed 10 years ago by chrisl

comment:3 Changed 10 years ago by chrisl

I have attached a fix. Please provide any comments.

comment:4 Changed 10 years ago by superm1@…

I think if you are going to invert those settings, then you should also make sure that HaltCommand? and RebootCommand? are set to empty initially in mythfrontend rather than being filled with 'halt' and 'reboot' respectively.

comment:5 Changed 10 years ago by superm1@…

(mythfrontend/globalsettings.cpp is what i'm referring to btw)

Changed 10 years ago by chrisl

Attachment: set_default_values.patch added

comment:6 Changed 10 years ago by chrisl

Good idea. I attached a patch that sets the halt and reboot command blank by default, so that if the user does not have a custom script then it will shutdown via the managed session if available.

comment:7 Changed 10 years ago by JYA

Resolution: fixed
Status: assignedclosed

r23979

Use user configured scripts to reboot/shutdown if they are configured before trying other methods. For backward compatibility reasons, the scripts are initialised by default ; most users will want to clear the settings to use d-bus/hal. Patch by chrisl

comment:8 Changed 10 years ago by superm1@…

Resolution: fixed
Status: closednew

I can understand for compatibility reasons wanting to still support user scripts. But if "most users" will want to clear the settings by default, shouldn't they just not be initialized as was done in chrisl's second patch?

Note: that will *only* affect new frontends that don't contain settings in the DB.

The whole point of the original patch was to make the shutdown experience better for more users, and this will defeat that purpose.

comment:9 Changed 10 years ago by JYA

Resolution: fixed
Status: newclosed

I agree 100% with you...

But no need to re-open the ticket... this ticked is resolved ; it fixes the problem reported originally.

This belongs to a different ticket now.

I haven't given hope of removing the default user scripts. Just need approval from other devs to incorporate that change

comment:10 Changed 9 years ago by sphery

(In [25433]) Fixes #8291. Remove the default values for the "Reboot command" and "Halt command" settings.

The given values likely will not work on most systems without at least a sudo (and possibly path information), and including default values prevents dbus shutdown from working. Therefore, more systems are likely to just do the right thing without the default values. Users wanting to use a script can simply provide the appropriate command invocation (which is almost definitely different from the former default values). This change will only affect new setups, not existing setups. Refs #8160. Refs #7749.

Note: See TracTickets for help on using tickets.