public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Openconnect overwriting /etc/resolv.conf
@ 2016-12-13 11:05 Alexander Kapshuk
  2016-12-13 23:19 ` Mike Gilbert
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Kapshuk @ 2016-12-13 11:05 UTC (permalink / raw
  To: Gentoo mailing list

Been using openconnect for a few years now.
I currently have net-misc/openconnect-7.06-r1 installed.
This morning, when logged in at a remote site, I noticed that when
clicking, or typing, nothing would happen. Which somehow seemed to
result in a similar behavior back on the local system, i.e. attempting
to type commands in terminal had stopped working.

Having rebooted my system and poked around system log and config
files, I noticed that my /etc/resolv.conf got overwritten by
openconnect. Further investigation indicated that it is done by design
via this script: /etc/openconnect/openconnect.sh.
I do not know if this is a recent change in openconnect's behaviour, I
had no trouble of this sort doing remote work on the same system
yesterday.

An ad-hoc solution I have found online and applied to my environment is this:
http://serverfault.com/questions/331299/how-can-i-stop-openconnect-from-changing-etc-resolv-conf
chattr +i /etc/resolv.conf

This seems to have helped. I can click and type both on remote systems
and the local one with no trouble at all.

Anyone else experienced this?
What are your thoughts and suggestions on the matter?

Thanks.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-user] Openconnect overwriting /etc/resolv.conf
  2016-12-13 11:05 [gentoo-user] Openconnect overwriting /etc/resolv.conf Alexander Kapshuk
@ 2016-12-13 23:19 ` Mike Gilbert
  2016-12-14 15:24   ` Alexander Kapshuk
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Gilbert @ 2016-12-13 23:19 UTC (permalink / raw
  To: gentoo-user

On Tue, Dec 13, 2016 at 6:05 AM, Alexander Kapshuk
<alexander.kapshuk@gmail.com> wrote:
> Been using openconnect for a few years now.
> I currently have net-misc/openconnect-7.06-r1 installed.
> This morning, when logged in at a remote site, I noticed that when
> clicking, or typing, nothing would happen. Which somehow seemed to
> result in a similar behavior back on the local system, i.e. attempting
> to type commands in terminal had stopped working.
>
> Having rebooted my system and poked around system log and config
> files, I noticed that my /etc/resolv.conf got overwritten by
> openconnect. Further investigation indicated that it is done by design
> via this script: /etc/openconnect/openconnect.sh.
> I do not know if this is a recent change in openconnect's behaviour, I
> had no trouble of this sort doing remote work on the same system
> yesterday.
>
> An ad-hoc solution I have found online and applied to my environment is this:
> http://serverfault.com/questions/331299/how-can-i-stop-openconnect-from-changing-etc-resolv-conf
> chattr +i /etc/resolv.conf
>
> This seems to have helped. I can click and type both on remote systems
> and the local one with no trouble at all.
>
> Anyone else experienced this?
> What are your thoughts and suggestions on the matter?

You could install net-dns/openresolv, and set resolvconf=NO in
/etc/resolvconf.conf. openconnect.sh will automatically utilize
openresolv if it is installed, and that config setting prevents
openresolve from making any updates.

An uglier solution is to edit /etc/openconnect/openconnect.sh, and
comment out the following lines:

In do_connect():

    if [ -n "$INTERNAL_IP4_DNS" ]; then
        $MODIFYRESOLVCONF
    fi

In do_disconnect():

    if [ -n "$INTERNAL_IP4_DNS" ]; then
        $RESTORERESOLVCONF
    fi


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-user] Openconnect overwriting /etc/resolv.conf
  2016-12-13 23:19 ` Mike Gilbert
@ 2016-12-14 15:24   ` Alexander Kapshuk
  0 siblings, 0 replies; 3+ messages in thread
From: Alexander Kapshuk @ 2016-12-14 15:24 UTC (permalink / raw
  To: Gentoo mailing list

On Wed, Dec 14, 2016 at 1:19 AM, Mike Gilbert <floppym@gentoo.org> wrote:
> On Tue, Dec 13, 2016 at 6:05 AM, Alexander Kapshuk
> <alexander.kapshuk@gmail.com> wrote:
>> Been using openconnect for a few years now.
>> I currently have net-misc/openconnect-7.06-r1 installed.
>> This morning, when logged in at a remote site, I noticed that when
>> clicking, or typing, nothing would happen. Which somehow seemed to
>> result in a similar behavior back on the local system, i.e. attempting
>> to type commands in terminal had stopped working.
>>
>> Having rebooted my system and poked around system log and config
>> files, I noticed that my /etc/resolv.conf got overwritten by
>> openconnect. Further investigation indicated that it is done by design
>> via this script: /etc/openconnect/openconnect.sh.
>> I do not know if this is a recent change in openconnect's behaviour, I
>> had no trouble of this sort doing remote work on the same system
>> yesterday.
>>
>> An ad-hoc solution I have found online and applied to my environment is this:
>> http://serverfault.com/questions/331299/how-can-i-stop-openconnect-from-changing-etc-resolv-conf
>> chattr +i /etc/resolv.conf
>>
>> This seems to have helped. I can click and type both on remote systems
>> and the local one with no trouble at all.
>>
>> Anyone else experienced this?
>> What are your thoughts and suggestions on the matter?
>
> You could install net-dns/openresolv, and set resolvconf=NO in
> /etc/resolvconf.conf. openconnect.sh will automatically utilize
> openresolv if it is installed, and that config setting prevents
> openresolve from making any updates.
>
> An uglier solution is to edit /etc/openconnect/openconnect.sh, and
> comment out the following lines:
>
> In do_connect():
>
>     if [ -n "$INTERNAL_IP4_DNS" ]; then
>         $MODIFYRESOLVCONF
>     fi
>
> In do_disconnect():
>
>     if [ -n "$INTERNAL_IP4_DNS" ]; then
>         $RESTORERESOLVCONF
>     fi
>

I went ahead with the former suggestion, which worked as advertised for me.

Thanks very much.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-14 15:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-13 11:05 [gentoo-user] Openconnect overwriting /etc/resolv.conf Alexander Kapshuk
2016-12-13 23:19 ` Mike Gilbert
2016-12-14 15:24   ` Alexander Kapshuk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox