On Saturday 10 February 2007, Dirk Meyer wrote:
> Harm Geerts wrote:
> > The problem is that setup.py imports freevo.conf which sets up the
> > DATADIR, LOGDIR and the logfile handler. I'm using FEATURES="usersandbox"
> > which tries to run as much as possible under the portage user (which has
> > uid 250).
>
> Should be fixed in svn. I hope I don't get a sandbox violation for
> creating stuff in /tmp.

You'll get a sandbox violation writing everywhere except the staging area.
The staging area is a temporary install image where portage installs the 
application before committing it to the live filesystem.
So yes, you would get a violation for writing to /tmp

If you want to make changes to the live filesystem you can do so in the 
ebuilds pgk_preinst and pkg_postint functions.

If you simply want to create an additional directory (like the LOGDIR) you can 
do this in the src_install function. I imagine it would be something like 
this:

# dev-python/freevo-core.ebuild
src_install() {
        # call the distutils.eclass install function
        # this uses setup.py to install the appliction
        # we have to call this because we override the src_install function
        distutils_src_install

        # create the logdirectory with world writable permissions
        # and tell portage to keep the directory even if it's empty
        # this creates a directory in the staging area, not the live filesystem
        diropts -m0777
        keepdir /var/log/freevo
}

The ebuild 5 manpage [1] has more information about what goes where and what 
tools you can use to achieve certain goals. 

Automatically creating systemwide files/directories when importing a module is 
a bad combination on a distro like gentoo. These things should be done when 
installing rather then at runtime (as shown in the src_install function 
above). A sanity check to see if certain files/directies exist at runtime 
should be enough.

For userspecific settings/logging it's no problem as the portage user is 
allowed to write to it's own $HOME (which is removed after the install is 
successfull)

Some additional information about gentoo's sandbox can be found at [2].

[1] http://gentoo-wiki.com/MAN_ebuild_5
[2] http://bugday.gentoo.org/sandbox.html

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freevo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-users

Reply via email to