[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

trigger ezjail-admin restart from within the jail(s)



Hi,

might be useful for someone here...

https://github.com/sg2342/ezjail_restartd contains a FreeBSD port that
installs two files,

%%PREFIX%%/sbin/ezjail_restartd: a daemon that uses kevent(2) to watch
on "trigger" files and executes 'ezjail-admin restart' if a write
event occures

and

%%PREFIX%%/etc/rc.d/ezjail_restartd: the daemon command script

usage:

 - install the port in the host system
 - create /usr/jails/$JAIL/var/reboot and
   touch /usr/jails/$JAIL/var/reboot/trigger for each $JAIL that should
   have the ability to be restarted from within (chflags uunlink might
   be a good idea)
 - set ezjail_restartd_enable="YES" in /etc/rc.conf of the host system
 - execute 'service ezjail_restartd start' in the host system

limitations:

 - does only work for ezjails that have the default a common base dir  
 - no documentation
 - daemon needs to be restarted when new a trigger is added



best regards 

Stefan Grundmann