Stop pgAdmin 4 from launching on boot (ubuntu 16.04)
772
Lately, pgAdmin would automatically launch on boot. I'm using KDE, and there is no entry for pgAdmin in Autostart, nor was there any in ~/.config/autostart (tho' I'm guessing Autostart uses the file from there anyway).
Facing the same issue on Ubuntu 18.04 with KDE Plasma 5.12.6. The key problem is that KDE saves desktop session and restores it on reboot. That's why pgAdmin 4 starts automatically if it was running before reboot.
In order to fix this go to "System Settings", select "Startup and Shutdown" tab in "Workspace" section and then select "Desktop session":
You will see that "Restore previous session" box is enabled in "On Login" section there. If you want to exclude pgAdmin 4 only from being restored on login then just type a full path to its executable in "Applications to be excluded from sessions":
/usr/bin/pgAdmin4
You can detect a path by running:
which pgAdmin4
If you don't want to save desktop session related data then another simple solution is to tick "Start with an empty session" box.
After that click "Apply" button and reboot the system. Now pgAdmin 4 will start and open a browser only when you make it explicitly.
Turns out it was due to pgadmin4 was still running in the background, so it would launch itself again on next logins. I just killed the process with old school pkill -f pgAdmin4 and it would no longer automatically launch itself on next logins. There's no need to stop postgresql service.
EDIT 26/12/2018: I've instead marked @Ezze's answer as the solution as that's indeed a better way to do it in my case.
Facing the same issue on Ubuntu 18.04 with KDE Plasma 5.12.6. The key problem is that KDE saves desktop session and restores it on reboot. That's why pgAdmin 4 starts automatically if it was running before reboot.
In order to fix this go to "System Settings", select "Startup and Shutdown" tab in "Workspace" section and then select "Desktop session":
You will see that "Restore previous session" box is enabled in "On Login" section there. If you want to exclude pgAdmin 4 only from being restored on login then just type a full path to its executable in "Applications to be excluded from sessions":
You can detect a path by running:
If you don't want to save desktop session related data then another simple solution is to tick "Start with an empty session" box.
After that click "Apply" button and reboot the system. Now pgAdmin 4 will start and open a browser only when you make it explicitly.
Turns out it was due to
pgadmin4
was still running in the background, so it would launch itself again on next logins. I just killed the process with old schoolpkill -f pgAdmin4
and it would no longer automatically launch itself on next logins. There's no need to stoppostgresql
service.EDIT 26/12/2018: I've instead marked @Ezze's answer as the solution as that's indeed a better way to do it in my case.
You can disable startup services using: