Using the ‘service’ command on Ubuntu (and other handy tools)

Here’s how to get handy equivalents of the RedHat service and chkconfig commands on Ubuntu.

I’ve been using Ubuntu as my main desktop on my T41p Thinkpad for – what seems like – ever but is actually only since sometime last Summer. Before that, I used RedHat Enterprise Workstation for a time and, as RH isn’t (or, at least, wasn’t) quite so user-friendly as Ubuntu, and I’d recently been on a Linux Networking course, I quickly got used to using the service command to restart networking or whatever, and, occasionally, the chkconfig command to set which services started/stopped at boot. My main use of the chkconfig command was to stop the vmware service from starting at boot because the extra networking interfaces confused my VPN connection (IIRC).

When I moved to Ubuntu, I soon forgot the existence of such commands with the arrival of the lovely (but, unfortunately, slightly buggy) Network Manager GUI. Yesterday, I wanted to stop the vmware service from starting at boot as I used to (not for any particular reason but just because it seemed silly to be starting when I’m not always needing it). So I started to hunt it down…

System > Administration > Services seemed the obvious way to go…and, indeed, it did reveal a GUI listing some services. I’m not sure, however, how that particular GUI decides which services to list. Maybe it’s a lucky dip? Whatever. They’re certainly not all there. I’ve not yet found that GUI at all useful (unlike the GUI it replaced, which was probably daunting for new users but much more useful than the current one).

I started to google and found some useful tools. I never actually found the vmware service listed anywhere – if anyone knows how on earth I can prevent it starting at boot, I’d love to hear from you. In the meantime, here are the handy utilities that I did find…

Boot-Up Manager (BUM)

It’s childish, I know, but apt-get install bum makes me smirk. So, I installed BUM – it doesn’t seem to get added to the Applications menu but you can just type sudo bum in a terminal to start the BUM GUI:

Screenshot of BUM GUI

It seems to be a more useful alternative to the Services GUI that comes in Ubuntu.

sysv-rc-conf

This is fairly close to chkconfig (but in a terminal-based GUI) or the GUI that you used to get in Gnome that listed all the services and the runlevels at which they’d start on your system. Less pretty than BUM but looks okay:

Screenshot of sysv-rc-conf

sysvconfig (provides the service command)

And finally, this is just a package you install which contains the service command. Once you’ve installed the package, you can type things like sudo service vmware restart to restart the vmware service (which did work, btw, despite not being able to actually *see* the vmware service listed anywhere).

So, there you go! All of these are available in the Ubuntu Gutsy repository.

5 thoughts on “Using the ‘service’ command on Ubuntu (and other handy tools)

  1. You kids and your newfangled shortcut commands. What the heck is wrong with /etc/rc.d/syslog restart? You should try being sysadmin for a bunch of obsolete SLES 8 boxes. Now there’s having a good time.

    *grumble, grumble*

  2. Well, to stop service from starting on boot you can always go the old fashioned way and delete symlinks in /etc/rc[123456].d directories. The SySV startup relies on symlinks with names starting with S and 2 numbers. Say, if you have a symlink /etc/rc3.d/S99vmware it means that vmware will be started on runlevel 3 after all the other services started (priority 99). There will also be K99vmware links meaning that at these runlevels vmware should be stopped. Just find and delete these and it will not bother you again. Also Debian derivatives should have a update-rc.d script that works more or less like chkconfig command. Obviously service command is just a shortcut, what you need to do is /etc/init.d/vmware stop|start|restart.

  3. if i,m right you,ll find vmware in the syn package man., be carefull what you del., and let me know how you suceed? you pages are very interesting,by for now

Leave a Reply

Your email address will not be published. Required fields are marked *