[PATCH] jail NG schript patch for mounting devfs and procfs automatically

From: Jens Rehsack (rehsack_at_liwing.de)
Date: 07/29/03

  • Next message: Robert Watson: "Re: [PATCH] jail NG schript patch for mounting devfs and procfs automatically"
    Date: Tue, 29 Jul 2003 18:40:26 +0200
    To: FreeBSD-Current List <current@freebsd.org>
    
    
    

    Hi all, hi Clement,

    I updated the rcng jail start script to mount devfs and procfs
    into the jail if wanted. Adding entries to /etc/fstab didn't
    work properly, because the jail filesystem wasn't mounted when
    the startup process wants to mount it.

    Going this way allows us to control which jail could be used
    via ssh (or another remote shell), too.

    Any comments gladly welcome.

    If it's useful for FreeBSD, I will write the rc.conf(5) update,
    too. Please inform me to do this.

    Regards,
    Jens

    
    

    --- etc/rc.d/jail.orig Mon May 5 15:38:41 2003
    +++ etc/rc.d/jail Tue Jul 29 14:49:34 2003
    @@ -53,6 +53,16 @@
                     eval jail_hostname=\"\$jail_${_jail}_hostname\"
                     eval jail_ip=\"\$jail_${_jail}_ip\"
                     eval jail_exec=\"\$jail_${_jail}_exec\"
    + eval jail_devfs=\"\$jail_${_jail}_mount_devfs\"
    + eval jail_procfs=\"\$jail_${_jail}_mount_procfs\"
    + if [ -n "${jail_devfs}" ] && checkyesno jail_devfs ; then
    + echo "Mounting devfs to ${jail_rootdir}/dev"
    + mount -t devfs devfs ${jail_rootdir}/dev
    + fi;
    + if [ -n "${jail_procfs}" ] && checkyesno jail_procfs ; then
    + echo "Mounting procfs to ${jail_rootdir}/proc"
    + mount -t procfs procfs ${jail_rootdir}/proc
    + fi;
                     [ -z ${jail_exec} ] && jail_exec="/bin/sh /etc/rc"
                     
                     jail ${jail_rootdir} ${jail_hostname} ${jail_ip} ${jail_exec}

    
    

    _______________________________________________
    freebsd-current@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-current
    To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"


  • Next message: Robert Watson: "Re: [PATCH] jail NG schript patch for mounting devfs and procfs automatically"

    Relevant Pages

    • New jail related rc.conf variable
      ... there were some variables controlling whether or not I want to mount devfs ... or procfs, I did not found any simple way to use some nullfs or unionfs ... I though that the jail rc script was laking ...
      (freebsd-current)
    • New jail related rc.conf variable
      ... there were some variables controlling whether or not I want to mount devfs ... or procfs, I did not found any simple way to use some nullfs or unionfs ... I though that the jail rc script was laking ...
      (freebsd-current)
    • Re: [fbsd] chrooted named in a jail
      ... me in your replies, I am not subscribed to this list. ... I have a jail in which namedruns. ... Unfortunately, rc.d/named tries to mount devfs in the named_chrootdir, ... Any clue, idea? ...
      (freebsd-questions)
    • Re: [PATCH] jail NG schript patch for mounting devfs and procfs automatically
      ... >> I updated the rcng jail start script to mount devfs and procfs into the ...
      (freebsd-current)
    • RE: jail and NFS
      ... to realize that they're actually in the jail. ... /dev/ad0s1f on /usr (ufs, local, with quotas) ... procfs on /proc ... PID TT STAT TIME COMMAND ...
      (FreeBSD-Security)