On Fri, Jul 15, 2016 at 6:55 PM, Miguel Almeida
<[email protected]> wrote:
> #Trac notification
> export PYTHON_EGG_CACHE="/srv/trac/egg-cache/"
> echo "repos: " $REPOS >>  /srv/svn/test
> echo "rev: " $REV >>  /srv/svn/test
> sudo -u www-data trac-admin /srv/trac/iwrs/ changeset added $REPOS $REV
> sudo -u www-data trac-admin /srv/trac/tools/ changeset added $REPOS $REV
> sudo -u www-data trac-admin /srv/trac/bibliovigilance/ changeset added
> $REPOS $REV
>
> But the log is still saying the Python egg cache directory is currently set
> to: /home/svn/.python-eggs
>
> This is definitely related with the users running these commands.
> - From the error log, the user that is seen is svn (so it is searching for
> the cache in /home/svn/...
> - svn is running via /usr/bin/svnserve, which is a process
> - However, as seen above trac-admin should be running with user www-data
> - I've also tried adding sudo -E (to preserve the environment variables),
> but apparently this can't be done here (sudo: sorry, you are not allowed to
> preserve the environment)
>
> Still searching for the solution.

env_reset option for sudo is enabled by default. The PYTHON_EGG_CACHE
variable doesn't pass to trac-admin via sudo. Instead, try env
PYTHON_EGG_CACHE="..." like this:

---->8---->8---->8---->8---->8---->8---->8----
echo "repos: " $REPOS >>  /srv/svn/test
echo "rev: " $REV >>  /srv/svn/test
sudo -u www-data env PYTHON_EGG_CACHE="/srv/trac/egg-cache/" /bin/sh <<EOF
  trac-admin /srv/trac/iwrs/ changeset added $REPOS $REV
  trac-admin /srv/trac/tools/ changeset added $REPOS $REV
  trac-admin /srv/trac/bibliovigilance/ changeset added $REPOS $REV
EOF
---->8---->8---->8---->8---->8---->8---->8----


-- 
Jun Omae <[email protected]> (大前 潤)

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to