个人工具

“UbuntuHelp:UbuntuLTSP/LocalAppsResolvConf”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(创建新页面为 '{{From|https://help.ubuntu.com/community/UbuntuLTSP/LocalAppsResolvConf}} {{Languages|UbuntuHelp:UbuntuLTSP/LocalAppsResolvConf}} {|border="1" cellspacing="0" |This page is spec...')
 
 
第10行: 第10行:
 
https://bugs.launchpad.net/ubuntu/+source/ltsp/+bug/347957
 
https://bugs.launchpad.net/ubuntu/+source/ltsp/+bug/347957
 
Here is a workaround for that bug that applies for both setup types - one or two network interfaces on the server.
 
Here is a workaround for that bug that applies for both setup types - one or two network interfaces on the server.
1. Create a script that will set up the proper permissions
+
These terminal commands are specific to GNOME, but can be amended to work on KDE as well. At the time of this writing (August 29, 2009) only GNOME and KDE have been successfully tested for this procedure.
 +
1. The first step is to create the script that will set up the proper permissions. An easy way to do this is to open an instance of Nautilus (the GNOME filemanager) as the "root" user. Open a terminal window and copy and paste the following code:
  
 
<pre><nowiki>
 
<pre><nowiki>
$ cat /opt/ltsp/i386/etc/init.d/chmod-resolv.sh
+
sudo nautilus
 +
</nowiki></pre>
 +
A nautilus window should appear with a message warning you that you are accessing the system as root. Navigate to the following folder: /opt/ltsp/i386/etc/init.d
 +
Open any file in the folder that ends in ".sh"
 +
Click File -> "Save as" and name this file "chmod-resolv.sh"
 +
Now delete all the text in the file and replace it with the two lines of code below.
 
#! /bin/sh
 
#! /bin/sh
 
chmod 644 /etc/resolv.conf
 
chmod 644 /etc/resolv.conf
 +
Save the file and close the nautilus window.
 +
1a. Make sure the script is owned by root and executable by copying and pasting the following code into the terminal window
 +
<pre><nowiki>
 +
sudo chown root:root /opt/ltsp/i386/etc/init.d/chmod-resolv.sh
 
</nowiki></pre>
 
</nowiki></pre>
2. Add three lines to the lts.conf file
+
<pre><nowiki>
 +
sudo chmod 755 /opt/ltsp/i386/etc/init.d/chmod-resolv.sh
 +
</nowiki></pre>
 +
2. Now you need to add three lines to the lts.conf file located in the i386 folder at /var/lib/tftpboot/ltsp/i386/lts.conf
  
 
<pre><nowiki>
 
<pre><nowiki>
$ cat /var/lib/tftpboot/ltsp/i386/lts.conf
+
sudo gedit /var/lib/tftpboot/ltsp/i386/lts.conf
 +
</nowiki></pre>
 +
If you don't have an lts.conf file yet you can create one by opening an instance of nautilus as root, navigating to /var/lib/tftpboot/ltsp/i386. Then by right clicking in the folder and selecting "new file" you can create a blank file and name it "lts.conf"
 +
Copy and paste the code below into your lts.conf file:
 +
<pre><nowiki>
 
SEARCH_DOMAIN = ubuntu-ltsp5 || Change this for your own network
 
SEARCH_DOMAIN = ubuntu-ltsp5 || Change this for your own network
 
DNS_SERVER = 192.168.1.1  || Change this for your own network
 
DNS_SERVER = 192.168.1.1  || Change this for your own network
 
RCFILE_01=/etc/init.d/chmod-resolv.sh
 
RCFILE_01=/etc/init.d/chmod-resolv.sh
 
</nowiki></pre>
 
</nowiki></pre>
3. Rebuild the client image
+
If you don't know your Search Domain or your DNS Server you can find both listed in /etc/resolv.conf
 +
3. Now you need to rebuild the client image
  
 
<pre><nowiki>
 
<pre><nowiki>
$ sudo ltsp-update-image
+
sudo ltsp-update-image
 
</nowiki></pre>
 
</nowiki></pre>
4. Boot a thin client, connect to its shell (ex: via SSH or from the unlocked root account), and verify that the mode and content are correct
+
4. To verify that the fix has been applied, boot a thin client, connect to its shell (ex: via SSH or from the unlocked root account), and verify that the mode and content are correct
  
 
<pre><nowiki>
 
<pre><nowiki>
# ls -al /etc/resolv.conf
+
ls -al /etc/resolv.conf
 +
</nowiki></pre>
 +
should return:
 
-rw-r--r-- 1 root root 43 2002-01-13 17:13 /etc/resolv.conf
 
-rw-r--r-- 1 root root 43 2002-01-13 17:13 /etc/resolv.conf
# cat /etc/resolv.conf
+
<pre><nowiki>
 +
cat /etc/resolv.conf
 +
</nowiki></pre>
 +
should return:
 
search ubuntu-ltsp5
 
search ubuntu-ltsp5
 
nameserver 192.168.1.1
 
nameserver 192.168.1.1
</nowiki></pre>
 
 
----
 
----
 
[[category:CategoryLtsp]]
 
[[category:CategoryLtsp]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2009年11月17日 (二) 20:53的最新版本

This page is specific to Ubuntu versions 9.04

If you find this information applicable to additional versions/releases, please edit this page and modify this header to reflect that. Please also include any necessary modifications for this information to apply to the additional versions.


Repairing permissions for /etc/resolv.conf file in chroot

There is a bug that affects name resolution from within the client chroot. This affects applications that are run locally on the thin client. The resolver configuration file /etc/resolv.conf is not created properly due to broken permissions. Bug: https://bugs.launchpad.net/ubuntu/+source/ltsp/+bug/347957 Here is a workaround for that bug that applies for both setup types - one or two network interfaces on the server. These terminal commands are specific to GNOME, but can be amended to work on KDE as well. At the time of this writing (August 29, 2009) only GNOME and KDE have been successfully tested for this procedure. 1. The first step is to create the script that will set up the proper permissions. An easy way to do this is to open an instance of Nautilus (the GNOME filemanager) as the "root" user. Open a terminal window and copy and paste the following code:

sudo nautilus

A nautilus window should appear with a message warning you that you are accessing the system as root. Navigate to the following folder: /opt/ltsp/i386/etc/init.d Open any file in the folder that ends in ".sh" Click File -> "Save as" and name this file "chmod-resolv.sh" Now delete all the text in the file and replace it with the two lines of code below.

  1. ! /bin/sh

chmod 644 /etc/resolv.conf Save the file and close the nautilus window. 1a. Make sure the script is owned by root and executable by copying and pasting the following code into the terminal window

sudo chown root:root /opt/ltsp/i386/etc/init.d/chmod-resolv.sh
sudo chmod 755 /opt/ltsp/i386/etc/init.d/chmod-resolv.sh

2. Now you need to add three lines to the lts.conf file located in the i386 folder at /var/lib/tftpboot/ltsp/i386/lts.conf

sudo gedit /var/lib/tftpboot/ltsp/i386/lts.conf

If you don't have an lts.conf file yet you can create one by opening an instance of nautilus as root, navigating to /var/lib/tftpboot/ltsp/i386. Then by right clicking in the folder and selecting "new file" you can create a blank file and name it "lts.conf" Copy and paste the code below into your lts.conf file:

SEARCH_DOMAIN = ubuntu-ltsp5 || Change this for your own network
DNS_SERVER = 192.168.1.1  || Change this for your own network
RCFILE_01=/etc/init.d/chmod-resolv.sh

If you don't know your Search Domain or your DNS Server you can find both listed in /etc/resolv.conf 3. Now you need to rebuild the client image

sudo ltsp-update-image

4. To verify that the fix has been applied, boot a thin client, connect to its shell (ex: via SSH or from the unlocked root account), and verify that the mode and content are correct

ls -al /etc/resolv.conf

should return: -rw-r--r-- 1 root root 43 2002-01-13 17:13 /etc/resolv.conf

cat /etc/resolv.conf

should return: search ubuntu-ltsp5 nameserver 192.168.1.1