Modify

Ticket #8160 (closed defect: fixed)

You must read the TicketHowTo before creating a new ticket or commenting on an existing ticket.

Opened 2 years ago

Last modified 19 months ago

Shutdown with user script from menu broken in trunk

Reported by: chrisl Owned by: jyavenard
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

use_user_shutdown_script.patch Download (1.6 KB) - added by chrisl 23 months ago.
set_default_values.patch Download (1.3 KB) - added by chrisl 23 months ago.

Change History

comment:1 Changed 23 months 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 23 months ago by paulh

  • Owner changed from ijr to jyavenard
  • Priority changed from minor to major
  • Status changed from new to assigned
  • Milestone changed from unknown to 0.23

Changed 23 months ago by chrisl

comment:3 Changed 23 months ago by chrisl

I have attached a fix. Please provide any comments.

comment:4 Changed 23 months 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 23 months ago by superm1@…

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

Changed 23 months ago by chrisl

comment:6 Changed 23 months 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 23 months ago by jyavenard

  • Status changed from assigned to closed
  • Resolution set to fixed

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 23 months ago by superm1@…

  • Status changed from closed to new
  • Resolution fixed deleted

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 23 months ago by jyavenard

  • Status changed from new to closed
  • Resolution set to fixed

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 19 months ago by mdean

(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.

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.