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?
0 Answers