add start/stop/restart single jail to /etc/rc.d/jail

Kevin L. Kane kevin.kane at gmail.com
Fri Dec 28 19:38:23 PST 2007


I was getting very annoyed at the fact that when I do /etc/rc.d/jail
restart it restarts all jails and there didnt seem to be an easy way
to do that for only one jail on a machine.

The attached patch allows you to do
/etc/rc.d/jail (stop/start/restart) (jailname)

Something that might need more thinking(this works well enough for me)
but on stop it searchs the jail list for a jail referenced by
jailname.  It then finds the JID based on hostname and issues jexec
JID kill -TERM -1.  If your jls gets filled up with multiple entries
for the same hostname it gets kinda broken, also if you have jails
that do in fact have the same hostname you also get confusion.  Maybe
it should match all fields instead of just hostname?

-Kevink
-- 
Kevin L. Kane
kevin.kane at gmail.com
Attachment:
startstopindividualjails.patch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bin00002.bin
Type: application/octet-stream
Size: 2419 bytes
Desc: "Description: Binary data"
URL: <http://lists.dragonflybsd.org/pipermail/submit/attachments/20071228/85656b6a/attachment-0018.bin>


More information about the Submit mailing list