Ubuntu 18.04.3 gnome shell 3.28.4
I have a shell script that, when I manually run it, successfully does what I want it to do: It disables a specified gnome-shell extension. The script is simple, it is this:
nohup gnome-shell-extension-tool -d [email protected]
It works great, when the extension is enabled, if I run this script, the extension gets disabled.
I then created a custom systemd
service to run that script at shutdown, here is what it looks like:
[Unit]
Description=disable ExtensionName on shutdown, reboot, etc.
DefaultDependencies=no
Before=shutdown.target reboot.target halt.target
[Service]
Type=oneshot
ExecStart=/home/main1/DisableExtensionName.sh
[Install]
WantedBy=halt.target reboot.target shutdown.target
I saved that file in /etc/systemd/system
, with owner of root:root, and permissions of 644.
Then, I thought I need to both enable that service, and then start it. So, I ran the command
sudo systemctl enable DisableExtensionName.service
.
Then, I ran the command to start the service:
sudo systemctl start DisableExtensionName.service
.
Then, to check things out, I ran this command:
sudo systemctl status DisableExtensionName.service
and got these errors in the output:
Loaded: loaded (/etc/systemd/system/DisableExtensionName.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2019-11-20 09:15:09 CST; 25s ago
Process: 11008 ExecStart=/home/main1/DisableExtensionName.sh (code=exited, status=
Main PID: 11008 (code=exited, status=1/FAILURE)
system1 systemd[1]: Starting disable ExtensionName on shutdown, reboot, etc....
Nov 20 09:15:09 system1 DisableExtensionName.sh[11008]: '[email protected]' is not enabled or installed.
Nov 20 09:15:09 system1 systemd[1]: DisableExtensionName.service: Main process exited, code=exited, status=1/FAILURE
Nov 20 09:15:09 system1 systemd[1]: DisableExtensionName.service: Failed with result 'exit-code'.
Nov 20 09:15:09 system1 systemd[1]: Failed to start disable ExtensionName on shutdown, reboot, etc..
I don't understand these errors. Especially, the error above that says this:
DisableExtensionName.sh[11008]: '[email protected]' is not enabled or installed.
That is clearly in error, I know for sure that gnome-shell extension is both installed and enabled.
Of course, when I shut down my computer, this service does not work - I know it doesn't work because when I start the computer again, that gnome-shell extension is immediately enabled, instead of the computer starting with that gnome-shell extension being in a disabled state, which is what I want.
Why does the message tell me that the gnome-shell extension is not installed and enabled when in fact it is?
How do I change my shell script and/or my custom systemd file so that gnome-shell extension is disabled when I shutdown my computer (or log out of my user)?
Thank you for any help.
0 Answers