I've installed mongodb v3.4. This starts up on boot.
So I'm wondering, how to I find out what is starting this up (and how to disable it from starting on boot)?
The following did not work:
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Sign up to join this communityI've installed mongodb v3.4. This starts up on boot.
So I'm wondering, how to I find out what is starting this up (and how to disable it from starting on boot)?
The following did not work:
As far as I now, services are automatically enabled in Ubuntu, so when you install something like Apache
it will be started at boot.
To find out all services that have been run at startup:
systemctl list-units --type service
this will show all services that has been loaded at boot and are active now. If you want to get a list of all services no matter they are active or not:
systemctl list-units --type service --all
Another thing you can do is to run:
systemctl list-dependencies --type service
then hit /
and search for mongodb
see what service
/target
depends on it and runs it.
Also you can run :
locate mongodb.service
Which produces something like:
/lib/systemd/system/multi-user.target.wants/mongodb.service
then you will know that it's being started as a part of multi-user target, alternative to this is:
$ systemctl cat mongodb.service | grep -i wantedby
WantedBy=multi-user.target
To find out that if it's active (Will be run at startup/boot-time):
systemctl is-active mongodb
It's either active
or inactive
; In your case it should be active
.
To stop it from being started at boot time we should disable it:
sudo systemctl disable mongodb
And to make sure nothing else (No other service) can start it, we mask it:
systemctl mask mongodb
so it will be linked to /dev/null
and can't be started automatically or manually anymore.
I'm not aware of mongodb
service name, try hitting the tab it will be completed. I guess it's mongodb
;)
systemctl list-units --type service
will not show users services. Wondering is there a way to show all = system and all users services ?
To know if a service is enabled at boot time, the right command is :
systemctl is-enabled apache2
enabled
You can try by yourself by changing the state with
systemctl enable apache2
systemctl disable apache2
(this isn't intended to be the answer)
Also have a look at Settings -> Session and Startup -> Application Autostart to see if your application is mentioned there.
service --status-all
list all the services. You can refer this