On Fri, Jul 15, 2016 at 11:12 AM, Jun Omae <[email protected]> wrote:

> On Fri, Jul 15, 2016 at 7:05 PM, Jun Omae <[email protected]> wrote:
> > 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----
>
> Well, the env command isn't needed. The following is simpler than.
>
> echo "repos: " $REPOS >>  /srv/svn/test
> echo "rev: " $REV >>  /srv/svn/test
> sudo -u www-data /bin/sh <<EOF
>   export PYTHON_EGG_CACHE="/srv/trac/egg-cache/"
>   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
>

I think this is definitely what I want, although now I'm getting a "sudo no
tty present and no askpass program specified" which, for some reason, I
wasn't getting when I ran the sudo commands one by one instead of within he
EOF!



>
>
> --
> Jun Omae <[email protected]> (大前 潤)
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Trac Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/trac-users/dOkdYT4nRK4/unsubscribe.
> To unsubscribe from this group and all its topics, 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.
>

-- 
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