UNIX/Linux 系统管理技术手册阅读(十)

网友投稿 776 2022-09-21

UNIX/Linux 系统管理技术手册阅读(十)

UNIX/Linux 系统管理技术手册阅读(十)

2016.11.4 9:30-10:15

Adding new software

If you do need to install additional software, you first need to determine the canonical name of the relevant software package. For example, you’d need to translate “I want to install locate” to “I need to install the findutils package,” or translate “I need named” to “I have to install BIND.” A variety of system-specific indexes on the web can help with this, but Google is usually just as effective. For example, a search for “locate command” takes you directly to several relevant discussions. If you’re on a UNIX system, throw in the name of the operating system as well.

1.12.2 增加新软件

如果需要安装额外的软件,首先要确定相关软件包的标准名称。例如,需要把“我想装locate”转移为“我需要安装findutils软件包”,或者把“我要named”转移为“我必须安装BIND”。在网上各种针对特定系统的索引能够帮助做转换,但是Google通常更有效。例如,搜索“locate命令”,就能直接找到若干与之相关的讨论。如果是在UNIX系统上,那么还需要输入操作系统的名字。

Once you know the name of the relevant software, you can download and install it. The complete installation is usually a single command on Linux systems and on Solaris systems that have pkgutil installed. For HP-UX and AIX you’ll have to download either a prebuilt binary package or the project’s original source code. If the latter, try to locate the project’s official web page through Google and download the source code from one of the project’s mirrors.

一旦知道了相关软件的确切名称,就可以-并安装它。在Linux和安装了pkutil的Solaris系统上,整个安装过程通常用一条命令就够了,对于HP-UX和AIX而言,则要么-预编译好的二进制软件包,要么-项目的源代码。如果是后者,需要通过Google定位该项目的正式网站,然后从项目的镜像站点之一-源代码。

The following examples show the installation of the wget command on each ofour example systems. It’s a nifty GNU utility that turns HTTP and FTP downloads into atomic commands—very useful for scripting. wget is installed by default on each of our example Linux systems, but the commands shown below can be used for both initial installation and later updates.

Ubuntu uses APT, the Debian Advanced Package Tool:

ubuntu# apt-get install wget

The SUSE version is

suse# yast --install wget

The Red Hat version is

redhat# yum install wget

On a Solaris system with pkutil already installed (see blastwave.org for instructions on setting this up)

solaris# /opt/csw/bin/pkgutil --install wget

For HP-UX, we found an appropriate binary package on hpux.connect.org.uk and

downloaded it to the /tmp directory. The commands to unpack and install it were

hpux# gunzip /tmp/wget-1.11.4-hppa-11.31.depot.gz

hpux# swinstall -s /tmp/wget-1.11.4-hppa-11.31.depot wget

下面的例子展示了在我们的每一种示例系统上安装wget命令。它是一个很棒的GNU工具,能够把HTTP和FTP-变成单条命令---对于脚本编程来说非常有用。我们所举的每种Linux系统默认都安装了wget,但是下面给出的命令用于初始化安装和后续升级。

The package depot on the swinstall command line must be specified as a full path starting with /; otherwise, swinstall tries to find the file on the network. The wget at the end tells swinstall which package to install from within the depot file.

在swinstallw不像话地里出现的depot软件包必须用/开头的完整路径;否则,swinstall就会到网络上找文件。最后的wget告诉swinstall从depot文件里安装哪个软件包。

Unfortunately, the installation is not really as easy as it first appears. The installed

version of wget won’t actually run because several of the libraries on which it depends have not been installed:

hpux$ wget Can't open shared library: /usr/local/lib/libcrypto.sl

/usr/lib/dld.sl: No such file or directory

[HP ARIES32]: Core file for 32 bit PA-RISC application

[HP ARIES32]: /usr/local/bin/wget saved to /tmp/core.wget.

遗憾的是,这个安装各种没有乍看上去那么简单。装好的wget版本实际上无法运行,因为没有装它所依赖的几个库。

swinstall does have some dependency management built in, but its abilities unfortunately do not extend to Internet repositories. You’ll have to read the fine print and install all the appropriate prerequisite packages (in this case, six more) to make things right.

swinstall内置有依赖关系的管理机制,但是遗憾的是,它的这种功能不能延伸到Internet上的软件库里。用户不得不根据提示安装预装的软件包(本例中有6个之多)以达到最终目录。

Building software from source code

There is in fact at least one binary wget package available for AIX in RPM format. A Google search for “aix wget rpm” should turn up some good leads. After downloading, the installation command would be a simple

aix# rpm --install wget-1.11.4-1.aix5.1.ppc.rpm

1.12.3 从源代码编译软件

实际上,wget到少存在一种可用于AIX的二进制软件包,它是RPM格式的。用Google搜索“aix wget rpm”应该就能找到一些不错的线索。--之后,安装命令很简单

aix# rpm --install wget-1.11.4-1.aix5.1.ppc.rpm

But just for illustration, let’s build the AIX version of wget from the original source code.

但是为了演示,我们从源代码开始编译AIX版本的wget。

Our first chore is to find the code, but that’s easy: the first Google result for “wget”

takes us right to the project page at GNU, and the source tarball is just a link away.

After downloading the current version into the /tmp directory, we unpack, configure, build, and install it:

aix# cd /tmp; gunzip wget-1.11.4.tar.gz

aix# tar xfp wget-1.11.4.tar

aix# cd wget-1.11.4

aix# ./configure --disable-ssl --disable-nls # See comments below

configure: configuring for GNU Wget 1.11.4

checking build system type... rs6000-ibm-aix

config.status: creating src/config.h

config.status: executing default commands

generating po/POTFILES from ./po/POTFILES.in

creating po/Makefile

aix# make

aix# make install

我们的第一项任务是找到代码,这很容易:用google搜索“wget”得到的第一个结果就正好把我们指向GNU的wget项目,再点一下就能找到源代码的tar包。反当前版本的代码-到/tmp目录里,再解开、配置和安装:

This configure/make/make install sequence is common to the majority of UNIX and Linux software and works on all systems as long as you have the development environment and any package-specific prerequisites installed. However, it’s always a good idea to check the package’s INSTALL or README file for specifics.

对于大多数UNIX和Linux软件来说,都可以依次执行configure/make/make install三条命令,只要已经安装了开发环境以及预先要求的软件包,就会得到结果。不过,最好查看软件包的INSTALL或者README文件,了解该软件的特别之处。

In this case, the --disable-ssl and --disable-nls options to configure omit some wget features that depend on other libraries that haven’t been installed. In real life, you’d probably want to install the prerequisites. Use configure --help to see all the configuration options. Another useful configure option is --prefix=directory, which lets you put the software somewhere other than /usr/local.

在这个例子里,configure命令的两个选项--disable-ssl和--disable-nls省略了wget的一些特性,这些特性要依赖其他一些还没有安装的库。在实际中,用户可能想还是安装要求预装的那些库。使用confiugre--help查看所有的配置选项。另一个有用的配置选项是--perfix=directory,这个选项可以把软件安装到/usr/local之外的其他目录里。

2016.11.5 9:30-10:10

1.13 SYSTEM ADMINISTRATION UNDER DURESS

System administrators wear many hats. In the real world, they are often people with other jobs who have been asked to look after a few computers on the side. If this is your situation, tread carefully and be aware of how this scenario tends to play out over the long term.

1.13 重压下的系统管理员

系统管理员通常有多种身份。在现实生活中,系统管理员经常从事其他工作,但同时又被请来管理身边的一些计算机。如果您是处于这种情形之下,那么也许想要考虑一下长期兼职最终可能出现的情况。

The more experienced you become at system management, the more the user community comes to depend on you. Networks invariably grow, and administrative work tends to accumulate over time as your administration system becomes more sophisticated and you add additional layers. You will soon find that you are the only person in your organization who knows how to perform a variety of important tasks.

您的系统管理经验越丰富,那么用户群体对您的依赖也就越大。网络规模总是在增长,随着管理系统变得越发复杂,管理工作花费的时间也就会越多。很快,您就会发现在您所在的机构中,您成了唯一懂得怎样去执行各种重要任务的人。

Once coworkers come to think of you as the local system administrator, it is difficult to extricate yourself from this role. That is not necessarily a bad thing, but we know several people who have changed jobs to escape it. Since many administrative tasks are intangible, you may also find that you’re expected to be both a fulltime administrator and a full-time engineer, writer, or analyst.

一旦同事们开始把您看作是本地的系统管理员,那时要把自己从这种角色中解救出来就很困难了。那虽说不一定是件坏事,但我们知道有几个人为了逃避状态已经换了工作。由于许多管理任务是无形的,您还可能发现自己所在的单位希望您既成为一名全职的系统管理员,同时也成为全职的工作师、作家或分析员。

There is a common tendency for unwilling administrators to fend off requests by adopting a surly attitude and providing poor service.10 This approach usually backfires; it makes you look bad and creates additional problems.

不乐意这样做的系统管理员,常常倾向于通过态度不好和服务差劲来摆脱这类要求。这种方法往往事与愿违,不但有损自己的形象,并且可能产生更多问题。

Instead, consider keeping detailed records of the time you spend on system administration. Your goal should be to keep the work at a manageable level and to assemble evidence that you can use when you ask to be relieved of administrative duties. In most organizations, you will need to lobby the management from six months to a year to get yourself replaced, so plan ahead.

相反,可以考虑把花费在系统管理上的时间详细记录下来。您的目录应该是保持其工作处于可以管理的水平,而且应该搜集让您在申请减轻管理任务时用得上的证据。在大多数单位里,您需要游说管理层半年到一年的时间以后,才可能让自己的管理员位置由别人来取代,因此应该提前计划好。

On the other hand, you may find that you enjoy system administration and that you prefer it to real work. Employment prospects remain good. Unfortunately, your political problems will probably intensify. See Chapter 32, Management, Policy, and Politics, for a preview of the delights in store.

另一方面,您可能发现自己喜欢系统管理员的工作,而且喜欢程序超过了本职工作。好处是职业前景保持良好,不好之处是,您的政治问题可能会激化。参考第32章,事先做好准备。

1.14 RECOMMENDED READING

ROBBINS, ARNOLD. UNIX in a Nutshell (4th Edition). Sebastopol, CA: O’Reilly Media, 2008.

SIEVER, ELLEN, AARON WEBER, AND STEPHEN FIGGINS. Linux in a Nutshell (5th Edition). Sebastopol, CA: O’Reilly Media, 2006.

GANCARZ, MIKE. Linux and the Unix Philosophy. Boston: Digital Press, 2003. SALUS, PETER H. The Daemon, the GNU & the Penguin: How Free and Open Software is Changing the World. Reed Media Services, 2008.

This fascinating history of the open source movement by UNIX’s best-known historian is also available at groklaw.com under the Creative Commons license. The URL for the book itself is quite long; look for a current link at groklaw.com or try this compressed equivalent:tinyurl.com/d6u7j.

RAYMOND, ERIC S. The Cathedral & The Bazaar: Musings on Linux and Open Source by an Accidental Revolutionary. Sebastopol, CA: O’Reilly Media, 2001.

在groklaw.com上,可以找到由知名的UNIX历史学家写的开源运动的多彩多资的发展史,这本书采用Creative Commons许可证。它自己的URL链接相当长;到grklaw.com上找当前的链接,或者试试这个等价的链接:tinyurl.com/d6u7j.

RAYMOND, ERIC S. The Cathedral & The Bazaar: Musings on Linux and Open Source by an Accidental Revolutionary. Sebastopol, CA: O’Reilly Media, 2001.

System administration

LIMONCELLI, THOMAS A., CHRISTINA J. HOGAN, AND STRATA R. CHALUP. The Practice of System and Network Administration (Second Edition). Reading, MA: Addison-Wesley, 2008.

This is a good book with particularly strong coverage of the policy and procedural aspects of system administration. The authors maintain a system administration blog at everythingsysadmin.com.

FRISCH, AELEEN. Essential System Administration (3rd Edition). Sebastopol, CA: O’Reilly Media, 2002.

This is a classic all-around guide to UNIX system administration that is sadly somewhat out of date. We hope a new version is in the works!

系统管理

LIMONCELLI, THOMAS A., CHRISTINA J. HOGAN, AND STRATA R. CHALUP. The Practice of System and Network Administration (Second Edition). Reading, MA: Addison-Wesley, 2008.

这是一本好耶,它的强项在于讲述系统管理的政策和堆积方向的内容。作者们在everythingsysadmin.com上维护着一个系统管理方向的博客。

FRISCH, AELEEN. Essential System Administration (3rd Edition). Sebastopol, CA: O’Reilly Media, 2002.

这是一本UNIX系统管理的经典指南,但遗憾的是内容有点过时。我们希望有出新版本的规划!

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:一、Python爬虫-认识爬虫(Python爬虫笔记)
下一篇:同步异步多线程这三者关系,你能给面试官一个满意的回答吗?(多线程是同步还是异步)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~