Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How do I (temporarily) specify an IPv4 rsync server?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
curmudgeon
Veteran
Veteran


Joined: 08 Aug 2003
Posts: 1610

PostPosted: Fri Jun 26, 2020 9:09 am    Post subject: How do I (temporarily) specify an IPv4 rsync server? Reply with quote

Does some way exist even to do that? Yes, I know that I can set a specific mirror, but sometimes I find myself connecting to the internet in places where the hardware doesn't support IPv6. I would like to have the capability of specifying IPv4 on the command line (something like "emerge -4 --sync", or even having portage failover to IPv4 when it can't connect to an IPv6 address.

Thank you in advance.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6626

PostPosted: Fri Jun 26, 2020 10:36 am    Post subject: Reply with quote

`ip -6 route flush scope global` might help, should cause it to fail immediately trying to connect to outside v6 addresses.
Back to top
View user's profile Send private message
curmudgeon
Veteran
Veteran


Joined: 08 Aug 2003
Posts: 1610

PostPosted: Sun Jun 28, 2020 7:55 am    Post subject: Reply with quote

Ant P. wrote:
`ip -6 route flush scope global` might help, should cause it to fail immediately trying to connect to outside v6 addresses.


It does fail immediately (even without that command, since I only have an IPv4 address when connecting at certain locations). The command returns this:

Code:

# emerge --sync
>>> Syncing repository 'gentoo' into '/usr/portage'...
>>> Starting rsync with rsync://89.238.71.6/gentoo-portage...
>>> Checking server timestamp ...
rsync: safe_read failed to read 1 bytes [Receiver]: Connection reset by peer (104)
rsync error: error in rsync protocol data stream (code 12) at io.c(276) [Receiver=3.1.3]
>>> Retrying...


>>> Starting retry 1 of 1 with rsync://[2a00:1828:a00d:ffff::6]/gentoo-portage
>>> Checking server timestamp ...
rsync: failed to connect to 2a00:1828:a00d:ffff::6 (2a00:1828:a00d:ffff::6): Cannot assign requested address (99)
rsync error: error in socket IO (code 10) at clientserver.c(127) [Receiver=3.1.3]
>>> Retrying...
!!! Exhausted addresses for rsync.gentoo.org
q: Updating ebuild cache in /usr/portage ...
q: Finished 32612 entries in 68.230023 seconds

Action: sync for repo: gentoo, returned code = 1


Actually, the error in data stream message might have something to do with it, but I don't know the cause of that (or how to fix it) either. :) I still think that portage should never try to connect with IPv6 if the client doesn't have an IPv6 address.
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3794
Location: Hamburg

PostPosted: Sun Jun 28, 2020 8:33 am    Post subject: Reply with quote

another solution: Use "mirrorselect -4"
Back to top
View user's profile Send private message
curmudgeon
Veteran
Veteran


Joined: 08 Aug 2003
Posts: 1610

PostPosted: Sun Jun 28, 2020 10:44 pm    Post subject: Reply with quote

toralf wrote:
another solution: Use "mirrorselect -4"


Yes, I know I can do that, but I asked for a temporary solution (without changing mirrors, which I most likely will forget to change back when I reconnect to a network that supports IPv6). I would like to have the ability to specify "use IPv4 just this one time" (yes, I use a mirror that supports both).
Back to top
View user's profile Send private message
Josef.95
Advocate
Advocate


Joined: 03 Sep 2007
Posts: 3855
Location: Germany

PostPosted: Mon Jun 29, 2020 2:38 pm    Post subject: How do I (temporarily) specify an IPv4 rsync server? Reply with quote

Not sure, but I think
Code:
FETCHCOMMAND_RSYNC="${FETCHCOMMAND_RSYNC} -4" emerge --sync
should probably work.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15604

PostPosted: Tue Jun 30, 2020 1:30 am    Post subject: Reply with quote

The idea is a sound one, but I think as written, it will not work. OP likely does not have a shell environment variable named FETCHCOMMAND_RSYNC, so the use of the variable will expand to nothing, and the resulting variable will not be a valid command. Putting the same in make.conf might work, or OP could look up the stock value of FETCHCOMMAND_RSYNC and assign that first.

On further consideration, it might be easier to use PORTAGE_RSYNC_EXTRA_OPTS, which defaults to nothing, but is added to the relevant command.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum