Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an Ubuntu Server 12.04 box acting as a home file server. At times I would like to be able to brings down all my normal network services (nfs-kernel-server and friends, netatalk, nmbd, smbd, backuppc, subsonic, and transmission-daemon) without bringing down sshd. I would also like to be able to boot the machine without starting all of these services but with sshd running.

Before upstart, this would have been simple. Set the default runlevel to 3. Set the above-mentioned network services to start at runlevels 3-5, but not 2. Leave sshd starting at 2-5. Then, to bring down everything except sshd, run telinit 2. Or to boot without starting all those services, append 3 to the kernel command line.

However, some of these services (idmapd, statd, rpcbind, nmbd, and smbd) have been converted to upstart jobs. As a test, I tried adding and runlevel [345] to the start condition of smbd and nmbd, but it didn't seem to do anything:

start on (local-filesystems and net-device-up and runlevel [345])
stop on runlevel [!345]

What am I missing? How can I get these upstart jobs to respond to runlevel changes?

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.