FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Kubuntu User

 
 
LinkBack Thread Tools
 
Old 08-07-2010, 05:42 AM
 
Default Disable ipv6 kernel modules if user disables IPv6 (#537887)

From: David Cantrell <dcantrell@redhat.com>

If the user passes 'noipv6' or otherwise disables IPv6 on the target
system for all network devices, write out /etc/modprobe.d/noipv6 with
these lines:

# Disable IPv6 kernel modules (added by anaconda)
alias net-pf-10 off
alias ipv6 off
options ipv6 disable=1

Based on a patch provided in the bug, but modified so that the lines are
written to 'noipv6' in /etc/modprobe.d rather than /etc/modprobe.conf
and so that the file is only written out if IPv6 is disabled on all
interfaces.
---
network.py | 21 +++++++++++++++++++++
packages.py | 1 +
2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/network.py b/network.py
index 0feb8fd..b88ace9 100644
--- a/network.py
+++ b/network.py
@@ -605,3 +605,24 @@ class Network:
f.write("nameserver %s
" % (ns,))

f.close()
+
+ # /etc/modprobe.d/noipv6
+ if useIPv6 == "no":
+ d = instPath + "/etc/modprobe.d"
+ c = d + "/noipv6"
+ header = None
+
+ iutil.mkdirChain(d)
+
+ if os.path.isfile(c):
+ header = "
"
+
+ f = open(c, "w+")
+ if header:
+ f.write(header)
+
+ f.write("# Disable IPv6 kernel modules (added by anaconda)
")
+ f.write("alias net-pf-10 off
")
+ f.write("alias ipv6 off
")
+ f.write("options ipv6 disable=1
")
+ f.close()
diff --git a/packages.py b/packages.py
index a1a6e56..c030eba 100644
--- a/packages.py
+++ b/packages.py
@@ -209,6 +209,7 @@ def setFileCons(anaconda):
"/etc/blkid.tab", "/etc/blkid.tab.old",
"/etc/mtab", "/etc/fstab", "/etc/resolv.conf",
"/etc/modprobe.conf", "/etc/modprobe.conf~",
+ "/etc/modprobe.d/noipv6",
"/var/log/wtmp", "/var/run/utmp",
"/dev/log", "/var/lib/rpm", "/", "/etc/raidtab",
"/etc/mdadm.conf", "/etc/hosts", "/etc/sysconfig/network",
--
1.7.2.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-07-2010, 05:45 AM
 
Default Disable ipv6 kernel modules if user disables IPv6 (#537887)

From: David Cantrell <dcantrell@redhat.com>

If the user passes 'noipv6' or otherwise disables IPv6 on the target
system for all network devices, write out /etc/modprobe.d/noipv6 with
these lines:

# Disable IPv6 kernel modules (added by anaconda)
alias net-pf-10 off
alias ipv6 off
options ipv6 disable=1

Based on a patch provided in the bug, but modified so that the lines are
written to 'noipv6' in /etc/modprobe.d rather than /etc/modprobe.conf
and so that the file is only written out if IPv6 is disabled on all
interfaces.
---
network.py | 21 +++++++++++++++++++++
packages.py | 1 +
2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/network.py b/network.py
index 0feb8fd..b88ace9 100644
--- a/network.py
+++ b/network.py
@@ -605,3 +605,24 @@ class Network:
f.write("nameserver %s
" % (ns,))

f.close()
+
+ # /etc/modprobe.d/noipv6
+ if useIPv6 == "no":
+ d = instPath + "/etc/modprobe.d"
+ c = d + "/noipv6"
+ header = None
+
+ iutil.mkdirChain(d)
+
+ if os.path.isfile(c):
+ header = "
"
+
+ f = open(c, "w+")
+ if header:
+ f.write(header)
+
+ f.write("# Disable IPv6 kernel modules (added by anaconda)
")
+ f.write("alias net-pf-10 off
")
+ f.write("alias ipv6 off
")
+ f.write("options ipv6 disable=1
")
+ f.close()
diff --git a/packages.py b/packages.py
index a1a6e56..c030eba 100644
--- a/packages.py
+++ b/packages.py
@@ -209,6 +209,7 @@ def setFileCons(anaconda):
"/etc/blkid.tab", "/etc/blkid.tab.old",
"/etc/mtab", "/etc/fstab", "/etc/resolv.conf",
"/etc/modprobe.conf", "/etc/modprobe.conf~",
+ "/etc/modprobe.d/noipv6",
"/var/log/wtmp", "/var/run/utmp",
"/dev/log", "/var/lib/rpm", "/", "/etc/raidtab",
"/etc/mdadm.conf", "/etc/hosts", "/etc/sysconfig/network",
--
1.7.2.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-07-2010, 05:45 AM
 
Default Disable ipv6 kernel modules if user disables IPv6 (#537887)

From: David Cantrell <dcantrell@redhat.com>

If the user passes 'noipv6' or otherwise disables IPv6 on the target
system for all network devices, write out /etc/modprobe.d/noipv6 with
these lines:

# Disable IPv6 kernel modules (added by anaconda)
alias net-pf-10 off
alias ipv6 off
options ipv6 disable=1

Based on a patch provided in the bug, but modified so that the lines are
written to 'noipv6' in /etc/modprobe.d rather than /etc/modprobe.conf
and so that the file is only written out if IPv6 is disabled on all
interfaces.
---
network.py | 21 +++++++++++++++++++++
packages.py | 1 +
2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/network.py b/network.py
index 0feb8fd..b88ace9 100644
--- a/network.py
+++ b/network.py
@@ -605,3 +605,24 @@ class Network:
f.write("nameserver %s
" % (ns,))

f.close()
+
+ # /etc/modprobe.d/noipv6
+ if useIPv6 == "no":
+ d = instPath + "/etc/modprobe.d"
+ c = d + "/noipv6"
+ header = None
+
+ iutil.mkdirChain(d)
+
+ if os.path.isfile(c):
+ header = "
"
+
+ f = open(c, "w+")
+ if header:
+ f.write(header)
+
+ f.write("# Disable IPv6 kernel modules (added by anaconda)
")
+ f.write("alias net-pf-10 off
")
+ f.write("alias ipv6 off
")
+ f.write("options ipv6 disable=1
")
+ f.close()
diff --git a/packages.py b/packages.py
index a1a6e56..c030eba 100644
--- a/packages.py
+++ b/packages.py
@@ -209,6 +209,7 @@ def setFileCons(anaconda):
"/etc/blkid.tab", "/etc/blkid.tab.old",
"/etc/mtab", "/etc/fstab", "/etc/resolv.conf",
"/etc/modprobe.conf", "/etc/modprobe.conf~",
+ "/etc/modprobe.d/noipv6",
"/var/log/wtmp", "/var/run/utmp",
"/dev/log", "/var/lib/rpm", "/", "/etc/raidtab",
"/etc/mdadm.conf", "/etc/hosts", "/etc/sysconfig/network",
--
1.7.2.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-09-2010, 05:57 PM
"Brian C. Lane"
 
Default Disable ipv6 kernel modules if user disables IPv6 (#537887)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/06/2010 10:45 PM, dcantrell@redhat.com wrote:
> From: David Cantrell <dcantrell@redhat.com>
>
> If the user passes 'noipv6' or otherwise disables IPv6 on the target
> system for all network devices, write out /etc/modprobe.d/noipv6 with
> these lines:
>
> # Disable IPv6 kernel modules (added by anaconda)
> alias net-pf-10 off
> alias ipv6 off
> options ipv6 disable=1
>
> Based on a patch provided in the bug, but modified so that the lines are
> written to 'noipv6' in /etc/modprobe.d rather than /etc/modprobe.conf
> and so that the file is only written out if IPv6 is disabled on all
> interfaces.
> ---
> network.py | 21 +++++++++++++++++++++
> packages.py | 1 +
> 2 files changed, 22 insertions(+), 0 deletions(-)
>
> diff --git a/network.py b/network.py
> index 0feb8fd..b88ace9 100644
> --- a/network.py
> +++ b/network.py
> @@ -605,3 +605,24 @@ class Network:
> f.write("nameserver %s
" % (ns,))
>
> f.close()
> +
> + # /etc/modprobe.d/noipv6
> + if useIPv6 == "no":
> + d = instPath + "/etc/modprobe.d"
> + c = d + "/noipv6"
> + header = None
> +
> + iutil.mkdirChain(d)
> +
> + if os.path.isfile(c):
> + header = "
"
> +
> + f = open(c, "w+")
> + if header:
> + f.write(header)

header and check for isfile isn't needed, since this is the first time
it has been written, and you're using "w+" which will overwrite it anyway.

- --
Brian C. Lane <bcl@redhat.com>
Red Hat / Port Orchard, WA
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Remember Lexington Green!

iQEVAwUBTGBBcRF+jBaO/jp/AQJ3wQf9HgV0SUmkOlXYY+3up7Wr2g327aRGFngg
Uegri5oE4FE40nncEKcVgXuMLiG1YIBDH/z2PgxGyn6N2fbqcvBHXAXR+BwR7MFg
k2PHY94uiJJa8Sg/cN0WH/w9PNQNQ3ldaVx4Ler1hG2QHHW02OkZP3yUlBVFqbeg
gdowim+i5aIj8gZipqblSaHukrIkf050OK/+Uy6OYfUaqiFIKkx96tS63uhynPi7
je5eLI7F1dyx0c2c1a7IMg/FfoMhlakgLbC/zUlp+KrZPJdZBaG5dnD/a7tUyhgr
bkFdwMYGI02fJb1pL+KB8HoMnP4P0w7hKZkxFW2iwpWmOd8jiv is9A==
=nBLQ
-----END PGP SIGNATURE-----

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-09-2010, 06:03 PM
"Brian C. Lane"
 
Default Disable ipv6 kernel modules if user disables IPv6 (#537887)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/09/2010 10:57 AM, Brian C. Lane wrote:
> On 08/06/2010 10:45 PM, dcantrell@redhat.com wrote:
>> From: David Cantrell <dcantrell@redhat.com>

>> + f = open(c, "w+")
>> + if header:
>> + f.write(header)
>
> header and check for isfile isn't needed, since this is the first time
> it has been written, and you're using "w+" which will overwrite it anyway.
>

and I just realized there is no "w+" mode, r+ is read/write. It seems to
work, but should probably be changed to plain old "w"

- --
Brian C. Lane <bcl@redhat.com>
Red Hat / Port Orchard, WA
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Remember Lexington Green!

iQEVAwUBTGBC2BF+jBaO/jp/AQJ7PQf+J7jiWX6+xUFNFBNkQAmfrPSpvvll68P0
ZA89vRQ3Z9xu5nnPL90kM3lQ2sp/Fi+bY5qn08dceLRO553oUkKEU7LGVDEXdZm7
O8LxLpzkG+IQH/CyW5iQrc2HSsith/p8k3fK5xQdZaIIzmaTvNDAVNw+HQgUV738
6IamxVsvlZ63TgpX6pYcyrV57OhqEoEBZuv0N/DXnBOGNkQ2QeRRBTkuFRqFWkZf
/J4vLfbOL65VZbveoQj7B8R6uq6LhZoTwcPozVxoo2bYOkyQnCt VvEaj1yVQNpkN
qnV6pRTSvN1L0LeejaAsoaTlnMb8sTxjoXortZPRpps4b0aXfp Q2ag==
=ewqR
-----END PGP SIGNATURE-----

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-09-2010, 08:24 PM
David Cantrell
 
Default Disable ipv6 kernel modules if user disables IPv6 (#537887)

On Mon, 9 Aug 2010, Brian C. Lane wrote:


On 08/06/2010 10:45 PM, dcantrell@redhat.com wrote:

From: David Cantrell <dcantrell@redhat.com>

If the user passes 'noipv6' or otherwise disables IPv6 on the target
system for all network devices, write out /etc/modprobe.d/noipv6 with
these lines:

# Disable IPv6 kernel modules (added by anaconda)
alias net-pf-10 off
alias ipv6 off
options ipv6 disable=1

Based on a patch provided in the bug, but modified so that the lines are
written to 'noipv6' in /etc/modprobe.d rather than /etc/modprobe.conf
and so that the file is only written out if IPv6 is disabled on all
interfaces.
---
network.py | 21 +++++++++++++++++++++
packages.py | 1 +
2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/network.py b/network.py
index 0feb8fd..b88ace9 100644
--- a/network.py
+++ b/network.py
@@ -605,3 +605,24 @@ class Network:
f.write("nameserver %s
" % (ns,))

f.close()
+
+ # /etc/modprobe.d/noipv6
+ if useIPv6 == "no":
+ d = instPath + "/etc/modprobe.d"
+ c = d + "/noipv6"
+ header = None
+
+ iutil.mkdirChain(d)
+
+ if os.path.isfile(c):
+ header = "
"
+
+ f = open(c, "w+")
+ if header:
+ f.write(header)


header and check for isfile isn't needed, since this is the first time
it has been written, and you're using "w+" which will overwrite it anyway.


Unless this is an upgrade, the file might exist. Long shot, but I don't want
to drive over the file if it already exists.

And I wanted to do append, which looks like "a" according to:
http://docs.python.org/library/functions.html

Ooops.

--
David Cantrell <dcantrell@redhat.com>
Red Hat / Honolulu, HI

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-09-2010, 08:25 PM
David Cantrell
 
Default Disable ipv6 kernel modules if user disables IPv6 (#537887)

On Mon, 9 Aug 2010, Brian C. Lane wrote:


On 08/09/2010 10:57 AM, Brian C. Lane wrote:

On 08/06/2010 10:45 PM, dcantrell@redhat.com wrote:

From: David Cantrell <dcantrell@redhat.com>



+ f = open(c, "w+")
+ if header:
+ f.write(header)


header and check for isfile isn't needed, since this is the first time
it has been written, and you're using "w+" which will overwrite it anyway.



and I just realized there is no "w+" mode, r+ is read/write. It seems to
work, but should probably be changed to plain old "w"


"w"? Based on what I'm seeing here:

http://docs.python.org/library/functions.html

it should be "a". But then there are "r+", "w+", and "a+" which open for
updating. Looks like they got the USPS to guest-author this part of the
Python documentation.

--
David Cantrell <dcantrell@redhat.com>
Red Hat / Honolulu, HI

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-09-2010, 08:37 PM
David Cantrell
 
Default Disable ipv6 kernel modules if user disables IPv6 (#537887)

On Mon, 9 Aug 2010, David Cantrell wrote:


On Mon, 9 Aug 2010, Brian C. Lane wrote:


On 08/09/2010 10:57 AM, Brian C. Lane wrote:

On 08/06/2010 10:45 PM, dcantrell@redhat.com wrote:

From: David Cantrell <dcantrell@redhat.com>



+ f = open(c, "w+")
+ if header:
+ f.write(header)


header and check for isfile isn't needed, since this is the first time
it has been written, and you're using "w+" which will overwrite it anyway.



and I just realized there is no "w+" mode, r+ is read/write. It seems to
work, but should probably be changed to plain old "w"


"w"? Based on what I'm seeing here:

http://docs.python.org/library/functions.html

it should be "a". But then there are "r+", "w+", and "a+" which open for
updating. Looks like they got the USPS to guest-author this part of the
Python documentation.


New patch:


Disable ipv6 kernel modules if user disables IPv6 (#537887)

If the user passes 'noipv6' or otherwise disables IPv6 on the target
system for all network devices, write out /etc/modprobe.d/noipv6 with
these lines:

# Disable IPv6 kernel modules (added by anaconda)
alias net-pf-10 off
alias ipv6 off
options ipv6 disable=1

Based on a patch provided in the bug, but modified so that the lines are
written to 'noipv6' in /etc/modprobe.d rather than /etc/modprobe.conf
and so that the file is only written out if IPv6 is disabled on all
interfaces.
---
network.py | 21 +++++++++++++++++++++
packages.py | 1 +
2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/network.py b/network.py
index 6036b59..45aa7dc 100644
--- a/network.py
+++ b/network.py
@@ -603,3 +603,24 @@ class Network:
f.write("nameserver %s
" % (ns,))

f.close()
+
+ # /etc/modprobe.d/noipv6
+ if useIPv6 == "no":
+ d = instPath + "/etc/modprobe.d"
+ c = d + "/noipv6"
+ header = None
+
+ iutil.mkdirChain(d)
+
+ if os.path.isfile(c):
+ header = "
"
+
+ f = open(c, "a")
+ if header:
+ f.write(header)
+
+ f.write("# Disable IPv6 kernel modules (added by anaconda)
")
+ f.write("alias net-pf-10 off
")
+ f.write("alias ipv6 off
")
+ f.write("options ipv6 disable=1
")
+ f.close()
diff --git a/packages.py b/packages.py
index a1a6e56..c030eba 100644
--- a/packages.py
+++ b/packages.py
@@ -209,6 +209,7 @@ def setFileCons(anaconda):
"/etc/blkid.tab", "/etc/blkid.tab.old",
"/etc/mtab", "/etc/fstab", "/etc/resolv.conf",
"/etc/modprobe.conf", "/etc/modprobe.conf~",
+ "/etc/modprobe.d/noipv6",
"/var/log/wtmp", "/var/run/utmp",
"/dev/log", "/var/lib/rpm", "/", "/etc/raidtab",
"/etc/mdadm.conf", "/etc/hosts", "/etc/sysconfig/network",

--
David Cantrell <dcantrell@redhat.com>
Red Hat / Honolulu, HI

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 04:25 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org