[UPDATE]

The "sudo no tty present and no askpass program specified" problem was
caused by the fact that I'd changed "sudo -u www-data trac-admin" to "sudo
-u www-data /bin/sh".
My sudoers file was configured so that the svn user could only run
trac-admin as www-data (so he couldn't run /bin/sh).

To resolve the problem in a secured fashion, I ended up with:
export PYTHON_EGG_CACHE="/srv/trac/egg-cache/"
sudo -u www-data -E trac-admin /srv/trac/tools/ changeset added $REPOS $REV
(...)

i.e, I passed -E
And I added :SETENV: to the sudoers' configuration, so that svn can use
SETENV when running trac-admin as www-data.


Everything now works and all is well in the world. Especially with Portugal
as European Champions!

Thank you all for the help!
Miguel


On Fri, Jul 15, 2016 at 11:22 AM, Miguel Almeida <[email protected]>
wrote:

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