Bug 452820 - Option to auto shutdown PC after Discover finished updates, not just reboot
Summary: Option to auto shutdown PC after Discover finished updates, not just reboot
Status: RESOLVED FIXED
Alias: None
Product: Discover
Classification: Applications
Component: Updates (offline) (show other bugs)
Version: 5.24.4
Platform: Neon Linux
: NOR wishlist
Target Milestone: ---
Assignee: Dan Leinir Turthra Jensen
URL:
Keywords:
: 479245 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-04-21 09:05 UTC by BOF
Modified: 2024-10-14 13:46 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.2.0
Sentry Crash Report:


Attachments
Discover - auto restart option on update (74.04 KB, image/png)
2022-04-21 09:05 UTC, BOF
Details

Note You need to log in before you can comment on or make changes to this bug.
Description BOF 2022-04-21 09:05:53 UTC
Created attachment 148280 [details]
Discover - auto restart option on update

SUMMARY
There currently is an option to automatically restart the PC once the updates are finished. I did not find any option in discover to *shut down* the PC once the update is finished.

ENCHANTMENT REQUEST
Either to be able to switch the current button to shutdown instead of restart or a button that "Action after completion: XXX". 'XXX' would be a drop down menu with entries "Nothing", "Restart" and "Shutdown".

I'm not sure how the update cycle fully works regarding if the updates are only applied after restart. If so an option to shutdown the PC could be to restart the PC, apply the updates and then shutdown the PC.

PURPOSE
I would like to update + shutdown my PC at the end of the day. I don't want it to restart, but rather complete the update and fully turn off.

SOFTWARE/OS VERSIONS
Discover Version: 5.24.4

Operating System: KDE neon 5.24
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.93.0
Qt Version: 5.15.3
Kernel Version: 5.13.0-40-generic (64-bit)
Graphics Platform: X11
Processors: 16 × AMD Ryzen 7 4800H with Radeon Graphics
Memory: 30.8 GiB of RAM
Graphics Processor: AMD RENOIR
Comment 1 BOF 2022-04-21 09:08:40 UTC
EDIT: It would be nice if the option could be selected before you click on "update".
So that you can first select what to do (eg. shutdown) and then kick off the update process. Then you can just leave the PC alone and it would auto shutdown/restart itself.
Comment 2 postix 2023-10-11 10:24:11 UTC
BOF, isn't your wish basically the same as bug #436928? :)
Comment 3 Nate Graham 2023-10-11 15:48:54 UTC
Not quite, this is independent of offline updates.
Comment 4 Nate Graham 2024-02-16 00:45:27 UTC
*** Bug 479245 has been marked as a duplicate of this bug. ***
Comment 5 Thomas Duckworth 2024-08-10 17:27:31 UTC
I opened a possibly relevant merge request, https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4596
Comment 6 Thomas Duckworth 2024-08-10 17:29:26 UTC
(In reply to Thomas Duckworth from comment #5)
> I opened a possibly relevant merge request,
> https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4596

This links to one with Discover as well which I'll just put here:
https://invent.kde.org/plasma/discover/-/merge_requests/899
Comment 7 Nate Graham 2024-08-12 15:47:21 UTC
In progress with https://invent.kde.org/plasma/discover/-/merge_requests/899.
Comment 8 Nate Graham 2024-08-19 14:06:10 UTC
The first half has now been implemented with https://invent.kde.org/plasma/discover/-/merge_requests/899. This lets you do it from Discover.

The second half allowing you to do it from the logout screen is in progress with https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4596.
Comment 9 Nate Graham 2024-08-20 22:44:18 UTC
Git commit 4c5c66bdfcebb439eb6e1ccd35088762a1addf7d by Nate Graham, on behalf of Thomas Duckworth.
Committed on 20/08/2024 at 22:44.
Pushed by ngraham into branch 'master'.

Add Install Updates & Shut Down feature to Logout page

Depends on https://invent.kde.org/frameworks/breeze-icons/-/merge_requests/392

This feature reboots the computer, does an offline update, then shuts
down after the offline update has completed, rather than booting into
the operating system again.

The idea with this is that you can set your computer to update and
shut down and then walk away. Currently, there's no way to do this in
Plasma, so you can't leave the computer to update when you're done
with it; you have to wait for it to update then turn it off again.

Windows has similar functionality that this emulates, but this does
have to reboot the computer into the offline updater, and then shut
down from there, which is something that should be changed upstream
in PackageKit. Regardless, it's better than what we have now, and
it's not a big change to set it to shutdown and then apply updates
on the next boot.

Some code modernization and clean-up was also done in shutdowndlg.cpp.

See also https://invent.kde.org/plasma/discover/-/merge_requests/899
which exposes this functionality from Discover.
FIXED-IN: 6.2.0

M  +10   -6    CMakeLists.txt
M  +6    -0    logout-greeter/CMakeLists.txt
M  +96   -53   logout-greeter/shutdowndlg.cpp
M  +10   -2    logout-greeter/shutdowndlg.h
M  +57   -23   lookandfeel/org.kde.breeze/contents/logout/Logout.qml

https://invent.kde.org/plasma/plasma-workspace/-/commit/4c5c66bdfcebb439eb6e1ccd35088762a1addf7d
Comment 10 John 2024-10-09 14:17:59 UTC
is this working?

I've just updated to Plasma 6.2 and a few hours later, after the update was completed, i got new some more updates to cups but, even if they show up in discover and i do get the notification icon, 

when i try to Shutdown the PC (or even restart it) i don't get any option to "Install Updates and Shutdown"

(yes, i have "Apply System Updates" set to "After Rebooting")
Comment 11 Thomas Duckworth 2024-10-09 14:20:52 UTC
(In reply to John from comment #10)
> is this working?
> 
> I've just updated to Plasma 6.2 and a few hours later, after the update was
> completed, i got new some more updates to cups but, even if they show up in
> discover and i do get the notification icon, 
> 
> when i try to Shutdown the PC (or even restart it) i don't get any option to
> "Install Updates and Shutdown"
> 
> (yes, i have "Apply System Updates" set to "After Rebooting")

What distro are you on?
Comment 12 John 2024-10-09 14:22:06 UTC
(In reply to Thomas Duckworth from comment #11)
> (In reply to John from comment #10)
> > is this working?
> > 
> > I've just updated to Plasma 6.2 and a few hours later, after the update was
> > completed, i got new some more updates to cups but, even if they show up in
> > discover and i do get the notification icon, 
> > 
> > when i try to Shutdown the PC (or even restart it) i don't get any option to
> > "Install Updates and Shutdown"
> > 
> > (yes, i have "Apply System Updates" set to "After Rebooting")
> 
> What distro are you on?

Hi.

i'm on neon
Comment 13 John 2024-10-09 14:24:13 UTC
(In reply to Thomas Duckworth from comment #11)

> What distro are you on?

more specifically:

Operating System: KDE neon 6.2
KDE Plasma Version: 6.2.0
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.2
Kernel Version: 6.2.0-32-generic (64-bit)
Graphics Platform: Wayland
Comment 14 Thomas Duckworth 2024-10-09 14:25:46 UTC
(In reply to John from comment #13)
> (In reply to Thomas Duckworth from comment #11)
> 
> > What distro are you on?
> 
> more specifically:
> 
> Operating System: KDE neon 6.2
> KDE Plasma Version: 6.2.0
> KDE Frameworks Version: 6.6.0
> Qt Version: 6.7.2
> Kernel Version: 6.2.0-32-generic (64-bit)
> Graphics Platform: Wayland
Do you get an option to update and restart as normal? Does the issue still persist when you update then reboot? Try downgrading something and then seeing if it works again. Funny feeling this is a Neon issue - worked on Fedora.
Comment 15 John 2024-10-09 14:40:41 UTC
> Do you get an option to update and restart as normal? 
No. I just get "Shut Down Now" and "Cancel"

> Does the issue still persist when you update then reboot? 
No way of doing it! 
The only way is to go to discover and force the updates manually and then reboot also manually. But then i have no other new updates to test on ATM

> Try downgrading something and then seeing if it works again. 
I'm kind of having difficulties in downgrading anything... I don't seem to find the option neither in discover neither in Synaptic...

> Funny feeling this is a Neon issue - worked on Fedora.
It had to be this feature!!! It was the one i was most waiting for from 6.2. It had to be this!!! ahah
Comment 16 Thomas Duckworth 2024-10-09 14:41:57 UTC
(In reply to John from comment #15)
> > Do you get an option to update and restart as normal? 
> No. I just get "Shut Down Now" and "Cancel"
> 
> > Does the issue still persist when you update then reboot? 
> No way of doing it! 
> The only way is to go to discover and force the updates manually and then
> reboot also manually. But then i have no other new updates to test on ATM
> 
> > Try downgrading something and then seeing if it works again. 
> I'm kind of having difficulties in downgrading anything... I don't seem to
> find the option neither in discover neither in Synaptic...
> 
> > Funny feeling this is a Neon issue - worked on Fedora.
> It had to be this feature!!! It was the one i was most waiting for from 6.2.
> It had to be this!!! ahah

I mean when you press restart, can you update and restart like before 6.2
Comment 17 John 2024-10-09 14:49:18 UTC
(In reply to Thomas Duckworth from comment #16)

> I mean when you press restart, can you update and restart like before 6.2
I don't know. Before 6.2 i had the "Apply System Updates" set to "Immediately"... and i also took the time to go press the "Update now" button on Discover.
Comment 18 John 2024-10-09 14:52:54 UTC
Still, i now have gone into Discover and pressed the "Update Now" button and it downloaded the updated.

I now have a "restart and install updates now" on discover and now it also shows on the Logout page.

But i had to go to Discover press the Update Now. Is this how it's suppose to be?! 

Because i was under the impression the system would download and get the files ready for installing all by itself (it's what makes sense to me)
Comment 19 Thomas Duckworth 2024-10-09 14:54:25 UTC
(In reply to John from comment #18)
> Still, i now have gone into Discover and pressed the "Update Now" button and
> it downloaded the updated.
> 
> I now have a "restart and install updates now" on discover and now it also
> shows on the Logout page.
> 
> But i had to go to Discover press the Update Now. Is this how it's suppose
> to be?! 
> 
> Because i was under the impression the system would download and get the
> files ready for installing all by itself (it's what makes sense to me)

Yes, you actually have to trigger the update first. You can set up automatic updates though.
Comment 20 John 2024-10-09 15:06:00 UTC
> Yes, you actually have to trigger the update first. 
That doesn't make much sense (to me, naturally!).
I just want my system updated and i really don't want to have to go trigger the thing every-single-day like i've been doing...

> You can set up automatic updates though.
Can you tell me how/where, please?
Comment 21 Thomas Duckworth 2024-10-12 06:09:09 UTC
(In reply to John from comment #20)
> > Yes, you actually have to trigger the update first. 
> That doesn't make much sense (to me, naturally!).
> I just want my system updated and i really don't want to have to go trigger
> the thing every-single-day like i've been doing...
> 
> > You can set up automatic updates though.
> Can you tell me how/where, please?

In Software Update settings in System Settings.
Comment 22 John 2024-10-14 13:46:08 UTC
(In reply to Thomas Duckworth from comment #21)
> In Software Update settings in System Settings.

OK.
Then that's what i had already set!

From what i was able to figure, it was suppose to - after 15min of pc idle - start the update process by it's own, without the user having to go to discover and trigger it from the Update All button, and at shut down, offer the update installation... 

Am i understanding this wrong???