You are not logged in.

#1 2019-10-17 11:53:14

taumeister
Member
Registered: 2019-01-06
Posts: 31

change shutdown/restart to kill program first

I use the KDE / Plasma Desktop and have applications that prevent my PC from restarting or shutting down.
For example 'keepassxc' or 'virtualbox'.
The second time I hit the restart-button always works.

Can I manipulate the 'shutdown' script or program somehow so that it exits a program or unmounts a drive before it tries to restart or shutdown?

Last edited by taumeister (2019-10-17 11:54:25)

Offline

#2 2019-10-17 12:00:41

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: change shutdown/restart to kill program first

I remember KDE has a way to add your own scripts to run at login and logoff somewhere in the KDE settings tool.

EDIT:

I found this here:

https://userbase.kde.org/System_Settings/Autostart

That screen is named "autostart", but in that same screen you can also configure shutdown scripts through that "run on" column of the table.

Last edited by Ropid (2019-10-17 12:03:35)

Offline

#3 2019-10-17 12:09:17

taumeister
Member
Registered: 2019-01-06
Posts: 31

Re: change shutdown/restart to kill program first

Unfortunately I only find the possibility to influence the autostart and to select the login screen etc. under 'Start and Exit'.

But surely systemd is used somehow and you can manipulate that, right?

Offline

#4 2019-10-17 12:09:49

taumeister
Member
Registered: 2019-01-06
Posts: 31

Re: change shutdown/restart to kill program first

ahh..sorry ..I will read first.

Offline

#5 2019-10-17 12:10:10

seth
Member
Registered: 2012-09-03
Posts: 50,957

Re: change shutdown/restart to kill program first

Depending on when an how this fails you can add a hook to /usr/lib/systemd/system-shutdown/

Offline

Board footer

Powered by FluxBB