Disable autostart for a service without uninstalling?
Solution 1
This should do the trick:
Open terminal (Ctrl + Alt + T) and enter the following command:
sudo update-rc.d tomcat disable
Basically update-rc.d
will modify existing runlevel links for the script /etc/init.d/tomcat
by renaming start links to stop links.
Solution 2
More generic and more visual, with a nice UI: sysv-rc-conf
Uncheck the boxes for tomcat7 (runlevels 2 to 5), quit and that's it.
Solution 3
The disable|enable
API is not stable and might change in the future. I suggest you use the following command to remove all the symlinks in /etc/rc?.d/
:
update-rc.d -f tomcat remove
Solution 4
For upstart jobs, you need to disable service like this (e.g. mysql):
$ sudo -s
# echo "manual" > /etc/init/mysql.override
# exit
or using this one-liner:
$ echo "manual" | sudo tee /etc/init/mysql.override > /dev/null
Related videos on Youtube
Paul
I'm a C#, VB6, ASP (Classic), and Java developer professionally. I do workflow systems, a little Activity Based Costing, and regular old business systems. In my free time I play with php and java on linux.
Updated on September 17, 2022Comments
-
Paul over 1 year
How can I disable autostart for a service without uninstalling? For example, I'd like to leave tomcat installed, but I don't want it turning on every time I restart.
-
ffflabs over 10 yearsThis one worked for me. I had uninstalled tomcat manually yet it was trying to shut it down before any reboot. Disable without -f parameter yelded "file does not exists".
-
STW about 10 yearscool, that's a tool I haven't seen before. It was useful to confirm that the
update-rc.d
command actually had worked -
eaykin over 9 yearsNote that the default tomcat service name is "tomcat7" in ubuntu 14.
-
Erin Drummond about 9 years+ 1 million, this is what worked for me. I was trying to stop transmission-daemon from starting on startup and the update-rc.d method used to work, but it looks like its been converted to an Upstart script now so this is the only method that works
-
Dung almost 8 yearsIf your tomcat is tomcat6 you will need to do "sudo update-rc.d tomcat6 disable" else you will get error.
-
twig almost 8 yearsThanks, this worked for me and disabling mongodb! Couldn't seem to get it working with echo so I did it the oldschool
sudo vi /etc/init/mongodb.override
way -
mlissner about 7 yearsWeirdly, this removed the links, and then created some new ones when I did it for postgresql. Dunno.
-
Sahil Arora about 7 yearsYou might want to consider this message in the
update-rc.d
:The disable|enable API is not stable and might change in the future.