Re: [PATCH] jail NG schript patch for mounting devfs and procfsautomatically

From: Scot W. Hetzel <hetzels_at_westbend.net>
Date: Thu, 14 Aug 2003 08:36:40 -0500
I just noticed a problem with periodic scripts inside a jail.  I'm getting:

Local system status:
tee: /dev/stderr: Operation not supported

Mail in local queue:
tee: /dev/stderr: Operation not supported

Mail in submit queue:
tee: /dev/stderr: Operation not supported

in the periodic daily, weekly, monthly and security reports.  But if I mount
the fdescfs on the jail, then these errors go away.

So we need to add the following to the new jail script

jail_start()
{
        :
        eval jail_devfs=\"\$jail_${_jail}_devfs\"
        [ -z ${jail_devfs} ] && jail_devfs="NO":

        eval jail_fdescfs=\"\$jail_${_jail}_fdescfs\"
        [ -z ${jail_fdescfs} ] && jail_fdescfs="NO"
        :
        if checkyesno jail_devfs ; then
                mount -t devfs dev ${jail_devdir}
                if checkyesno jail_fdescfs ; then
                        mount -t fdescfs fdesc ${jail_devdir}/fd
                fi
                :
        fi
        :
}

jail_stop()
{
        :
        eval jail_devfs=\"\$jail_${_jail}_devfs\"
        [ -z ${jail_devfs} ] && jail_devfs="NO":

        eval jail_fdescfs=\"\$jail_${_jail}_fdescfs\"
        [ -z ${jail_fdescfs} ] && jail_fdescfs="NO"
        :
        if checkyesno jail_devfs ; then
                if [ -d ${jail_devdir} ] ; then
                        if checkyesno jail_fdescfs; then
                                umount -f ${jail_devdir}/fd >/dev/null 2>&1
                        fi
                        umount -f ${jail_devdir} >/dev/null 2>&1
                fi
        fi
        :
}

The only decsion we need to make is wheter to always mount the fdescfs when
devfs is mounted on the jail, or have a variable to enable mounting of the
fdescfs (jail_*_fdescfs).

Scot
Received on Thu Aug 14 2003 - 06:25:04 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:18 UTC