From 42245e938bfeb958534f68bbc528324fc8339eea Mon Sep 17 00:00:00 2001 From: erdgeist Date: Mon, 26 Sep 2005 01:30:00 +0000 Subject: ezjail now is called ezjail.sh --- Makefile | 4 ++-- ezjail.sh | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ man1/ezjail-admin.1 | 2 +- man5/ezjail.5 | 4 ++-- man5/ezjail.conf.5 | 2 +- 5 files changed, 59 insertions(+), 6 deletions(-) create mode 100755 ezjail.sh diff --git a/Makefile b/Makefile index 6fbe633..37fe5cc 100755 --- a/Makefile +++ b/Makefile @@ -3,10 +3,10 @@ all: install: mkdir -p ${PREFIX}/etc/ezjail/ ${PREFIX}/man/man1 ${PREFIX}/man/man5 cp -p ezjail.conf.sample ${PREFIX}/etc/ - sed s:EZJAIL_PREFIX:${PREFIX}: ezjail > ${PREFIX}/etc/rc.d/ezjail + sed s:EZJAIL_PREFIX:${PREFIX}: ezjail.sh > ${PREFIX}/etc/rc.d/ezjail.sh sed s:EZJAIL_PREFIX:${PREFIX}: ezjail-admin > ${PREFIX}/bin/ezjail-admin sed s:EZJAIL_PREFIX:${PREFIX}: man1/ezjail-admin.1 > ${PREFIX}/man/man1/ezjail-admin.1 sed s:EZJAIL_PREFIX:${PREFIX}: man5/ezjail.conf.5 > ${PREFIX}/man/man5/ezjail.conf.5 sed s:EZJAIL_PREFIX:${PREFIX}: man5/ezjail.5 > ${PREFIX}/man/man5/ezjail.5 - chmod 755 ${PREFIX}/etc/rc.d/ezjail ${PREFIX}/bin/ezjail-admin + chmod 755 ${PREFIX}/etc/rc.d/ezjail.sh ${PREFIX}/bin/ezjail-admin chown root:wheel ${PREFIX}/man/man1/ezjail-admin.1 ${PREFIX}/man/man5/ezjail.conf.5 ${PREFIX}/man/man5/ezjail.5 diff --git a/ezjail.sh b/ezjail.sh new file mode 100755 index 0000000..9e59dc2 --- /dev/null +++ b/ezjail.sh @@ -0,0 +1,53 @@ +#/bin/sh + +# $FreeBSD$ +# +# PROVIDE: ezjail +# +# Note: Add the following lines to $PREFIX/etc/rc.conf to enable ezjail, +# +#ezjail_enable="YES" +# +# Please do not change this file, configure in $PREFIX/etc/ezjail.conf + +# ugly: this variable will be set on port install time +ezjail_prefix=EZJAIL_PREFIX + +. /etc/rc.subr + +name=ezjail +rcvar=`set_rcvar` +load_rc_config $name + +ezjail_enable=${ezjail_enable:-"NO"} + +restart_cmd="do_restart" +start_cmd="do_start" +stop_cmd="do_stop" + +do_start() +{ + [ -n "$*" ] && jail_list=`echo $* | tr /~. ___` || echo " ezjail" + jail_list=${jail_list:-`ls ${ezjail_prefix}/etc/ezjail/`} + for jail in $jail_list; do . ${ezjail_prefix}/etc/ezjail/${jail}; done + sh /etc/rc.d/jail onestart $jail_list +} + +do_restart() +{ + [ -n "$*" ] && jail_list=`echo $* | tr /~. ___`; + jail_list=${jail_list:-`ls ${ezjail_prefix}/etc/ezjail/`} + for jail in $jail_list; do . ${ezjail_prefix}/etc/ezjail/${jail}; done + sh /etc/rc.d/jail onestop $jail_list + sh /etc/rc.d/jail onestart $jail_list +} + +do_stop() +{ + [ -n "$*" ] && jail_list=`echo $* | tr /~. ___` || echo " ezjail" + jail_list=${jail_list:-`ls ${ezjail_prefix}/etc/ezjail/`} + for jail in $jail_list; do . ${ezjail_prefix}/etc/ezjail/${jail}; done + sh /etc/rc.d/jail onestop $jail_list +} + +run_rc_command $* diff --git a/man1/ezjail-admin.1 b/man1/ezjail-admin.1 index c2b1263..11298c2 100755 --- a/man1/ezjail-admin.1 +++ b/man1/ezjail-admin.1 @@ -92,7 +92,7 @@ is considered a good idea. .T4 EZJAIL_PREFIX/etc/ezjail.conf .br -EZJAIL_PREFIX/etc/rc.d/ezjail +EZJAIL_PREFIX/etc/rc.d/ezjail.sh .SH "SEE ALSO" ezjail(5), ezjail.conf(5), jail(8), devfs(5), fdescfs(5), procfs(5) .SH AUTHOR diff --git a/man5/ezjail.5 b/man5/ezjail.5 index 5ead85a..77725e8 100755 --- a/man5/ezjail.5 +++ b/man5/ezjail.5 @@ -2,7 +2,7 @@ .SH NAME ezjail \- A simple jail setup framework .SH SYNOPSIS -EZJAIL_PREFIX/etc/rc.d/ezjail +EZJAIL_PREFIX/etc/rc.d/ezjail.sh .SH DESCRIPTION The ezjail framework provides a simple way to create many virtual FreeBSD servers by using FreeBSD's jail system. It requires little administration @@ -37,7 +37,7 @@ config file. .SH FILES EZJAIL_PREFIX/etc/ezjail.conf .br -EZJAIL_PREFIX/etc/rc.d/ezjail +EZJAIL_PREFIX/etc/rc.d/ezjail.sh .SH "SEE ALSO" ezjail-admin(1), ezjail.conf(5), jail(8), mount_nullfs(8) .SH AUTHOR diff --git a/man5/ezjail.conf.5 b/man5/ezjail.conf.5 index 529c4a3..b1ae6e1 100755 --- a/man5/ezjail.conf.5 +++ b/man5/ezjail.conf.5 @@ -89,7 +89,7 @@ for more information). .SH FILES EZJAIL_PREFIX/etc/ezjail.conf .br -EZJAIL_PREFIX/etc/rc.d/ezjail +EZJAIL_PREFIX/etc/rc.d/ezjail.sh .SH "SEE ALSO" ezjail-admin(1), ezjail(5), jail(8), devfs(5), fdescfs(5), procfs(5) .SH AUTHOR -- cgit v1.2.3