开发者社区> 余二五> 正文
阿里云
为了无法计算的价值
打开APP
阿里云APP内打开

hpux boot guide

简介:
+关注继续查看
HP-UX boot guide

HP-UX

Normal Boot

The bootstrap process involves the execution of three software components:
  • pdc

  • isl

  • hpux

pdc

Automatic boot processes on various HP-UX systems follow similar general sequences. When power is applied to the HP-UX system processor, or the system Reset button is pressed, the firmware processor-dependent code (pdcis executed to verify hardware and general system integrity. After checking the hardware, pdc gives the user the option to override the autoboot sequence by pressing the Esc key. A message resembling the following usually appears on the console.
     (c) Copyright. Hewlett-Packard Company. 1994.
     All rights reserved.

     PDC ROM rev. 130.0
     32 MB of memory configured and tested.

     Selecting a system to boot.
     To stop selection process, press and hold the ESCAPE key... 
If no keyboard activity is detected, pdc commences the autoboot sequence by loading isl and transferring control to it.

isl

The initial system loader (islimplements the operating-system-independent portion of the bootstrap process. It is loaded and executed after self-test and initialization have completed successfully. Typically, when control is transferred to isl, an autoboot sequence takes place. An autoboot sequence allows a complete bootstrap operation to occur with no intervention from an operator. While an autoboot sequence occurs, isl finds and executes the autoexecute file which requests that hpux be run with appropriate arguments. Messages similar to the following are displayed by isl on the console:
     Booting from: scsi.6  HP 2213A
     Hard booted.
     ISL Revision A.00.09  March 27, 1990
     ISL booting  hpux boot disk(;0)/stand/vmunix

hpux

hpux, the secondary system loader, then announces the operation it is performing, in this case the boot operation, the device file from which the load image comes, and the TEXT size, DATA size, BSS size, and start address of the load image, as shown below, before control is passed to the image.
    Booting disk(scsi.6;0)/stand/vmunix
    966616+397312+409688 start 0x6c50 
Finally, the loaded image displays numerous configuration and status messages, and passes control to the init process.

Single-user Boot

A single-user boot in HP-UX is sometimes referred to as an interactive boot or attended mode boot. Pressing the Escape key at the boot banner on an older Series 700 workstation halts the automatic boot sequence, puts you into attended mode, and displays the Boot Console User Interface main menu, a sample of which is below.
   Selecting a system to boot.
   To stop selection process, press and hold the ESCAPE key.

   Selection process stopped.

   Searching for Potential Boot Devices.
   To terminate search, press and hold the ESCAPE key.

   Device Selection    Device Path             Device Type
   -------------------------------------------------------------
   P0                  scsi.6.0                QUANTUM PD210S
   P1                  scsi.1.0                HP      2213A
   P2                  lan.ffffff-ffffff.f.f   hpfoobar

   b) Boot from specified device
   s) Search for bootable devices
   a) Enter Boot Administration mode
   x) Exit and continue boot sequence

      Select from menu: 
In this case the system automatically searches the SCSI, LAN, and EISA interfaces for all potential boot devices-devices for which boot I/O code (IODC) exists. The key to booting to single-user mode is first to boot to ISL using the b) option. The ISL is the program that actually controls the loading of the operating system. To do this using the above as an example, you would type the following at the Select from menu: prompt:
Select from menu: b p0 isl

This tells the system to boot to the ISL using the SCSI drive at address 6 (since the device path of P0 is scsi.6.0). After displaying a few messages, the system then produces the ISL> prompt.

Pressing the Escape key at the boot banner on newer Series 700 machines produces the Boot Administration Utility, as shown below.

   Command                            Description
   -------                            -----------
   Auto [boot|search] [on|off]        Display or set auto flag
   Boot [pri|alt|scsi.addr][isl]      Boot from primary, alt or SCSI
   Boot lan[.lan_addr][install][isl]  Boot from LAN
   Chassis [on|off]                   Enable chassis code
   Diagnostic [on|off]                Enable/disable diag boot mode
   Fastboot [on|off]                  Display or set fast boot flag
   Help                               Display the command menu
   Information                        Display system information
   LanAddress                         Display LAN station addresses
   Monitor [type]                     Select monitor type
   Path [pri|alt] [lan.id|SCSI.addr]  Change boot path
   Pim [hpmc|toc|lpmc]                Display PIM info
   Search [ipl] [scsi|lan [install]]  Display potential boot devices
   Secure [on|off]                    Display or set security mode
   -----------------------------------------------------------------
   BOOT_ADMIN>


To display bootable devices with this menu you have to execute the Search command at the BOOT_ADMIN> prompt:
BOOT_ADMIN> search
Searching for potential boot device.
This may take several minutes.

To discontinue, press ESCAPE.

   Device Path      Device Type
   --------------   ---------------
   scsi.6.0         HP C2247
   scsi.3.0         HP HP35450A
   scsi.2.0         Toshiba CD-ROM

BOOT_ADMIN>

To boot to ISL from the disk at device path scsi.6.0 type the following:
BOOT_ADMIN>boot scsi.6.0 isl

Once you get the ISL prompt you can run the hpux utility to boot the kernel to single-user mode:
ISL>hpux -is

This essentially tells hpux to load the kernel (/stand/vmunix) into single-user mode (-is) off the SCSI disk drive containing the kernel. The -is option says to pass the string s to theinit process (i), and the command init s puts the system in single-user mode. In fact, you will see something similar to the following after typing the above command:
Boot
: disk(scsi.6;0)/stand/vmunix
966616+397312+409688 start 0x6c50

   Kernel Startup Messages Omitted

INIT: Overriding default level with level 's'

INIT: SINGLE USER MODE
WARNING:  YOU ARE SUPERUSER!!
# 

Startup

Beginning with HP-UX 10 /etc/inittab calls /sbin/rc, which in turn calls execution scripts to start subsystems. This approach follows the OSF/1 industry standard and has been adopted by Sun, SGI, and other vendors. There are four components to this method of startup and shutdown: /sbin/rc, execution scripts, configuration variable scripts, and link files.

/sbin/rc

This script invokes execution scripts based on run levels. It is also known as the startup and shutdown sequencer script.

Execution scripts

These scripts start up and shut down various subsystems and are found in the /sbin/init.d directory. /sbin/rc invokes each execution script with one of four arguments, indicating the "mode":
start Bring the subsystem up
start_msg Report what the start action will do
stop Bring the subsystem down
stop_msg Report what the stop action will do

These scripts are designed never to be modified. Instead, they are customized by sourcing in configuration files found in the /etc/rc.config.d directory. These configuration files contain variables that you can set. For example, in the configuration file /etc/rc.config.d/netconf you can specify routing tables by setting variables like these:

ROUTE_DESTINATION[0]="default"
ROUTE_GATEWAY[0]="gateway_address"
ROUTE_COUNT[0]="1"

The execution script /sbin/init.d/net sources these and other network-related variables when it runs upon system startup. More on configuration files is described below.

Upon startup a checklist similar to the one below will appear based upon the exit value of each of the execution scripts.

HP-UX Startup in progress
-----------------------------------
Mount file systems..............................[ OK ]
Setting hostname................................[ OK ]
Set privilege group.............................[ OK ]
Display date...................................[FAIL]*
Enable auxiliary swap space....................[ N/A ]
Start syncer daemon.............................[ OK ]
Configure LAN interfaces........................[ OK ]
Start Software Distributor agent daemo..........[ OK ] 
The execution scripts have the following exit values:
0 Script exited without error. This causes the status OK to appear in the checklist.
1 Script encountered errors. This causes the status FAIL to appear in the checklist.
2 Script was skipped due to overriding control variables from /etc/rc.config.d files or for other reasons, and did not actually do anything. This causes the status N/Ato appear in the checklist.
3 Script executed normally and requires an immediate system reboot for the changes to take effect. (NOTE: Reserved for key system components).

Configuration variable scripts

Configuration variable scripts are designed to customize the execution scripts. This goal here is to separate startup files from configuration files so that upgrading your system does not overwrite its configuration. These scripts are written for the POSIX shell (/usr/bin/sh or /sbin/sh), and not the Bourne shell, ksh, or csh. In some cases, these files must also be read, and possibly modified by other scripts or the SAM program. For this reason, each variable definition must appear on a separate line, in the syntax:
variable=value
No trailing comments may appear on a variable definition line. Comment statements must be on separate lines, with the "#" comment character in column 1. An example of the required syntax for configuration files is given below:
# Cron configuration. See cron(1m)
#
# CRON: Set to 1 to start cron daemon
#
CRON=1

Both the execution scripts and the configuration files are named after the subsystem they control. For example, the /sbin/init.d/cron execution script controls the cron daemon, and it is customized by the /etc/rc.config.d/cron configuration variable script.

Link Files

These files control the order in which execution scripts run. The /sbin/rc#.d (where # is a run-level) directories are startup and shutdown sequencer directories. They contain only symbolic links to the execution scripts in /sbin/init.d that are executed by /sbin/rc on transition to a specific run level. For example, the /sbin/rc3.d directory contains symbolic links to scripts that are executed when entering run level 3.

These directories contain two types of link files: start links and kill links. Start links have names beginning with the capital letter S and are invoked with the start argument at system boot time or on transition to a higher run level. Kill links have names beginning with the capital letter K and are invoked with the stop argument at system shutdown time, or when moving to a lower run level.

Further, all link files in a sequencer directory are numbered to ensure a particular execution sequence. Each script has, as part of its name, a three-digit sequence number. This, in combination with the start and kill notation, provides all the information necessary to properly start up and shut down a system.

The table below shows some samples from the run-level directories. (The sequence numbers shown are only for example and may not accurately represent your system.)

/sbin/rc0.d /sbin/rc1.d /sbin/rc2.d /sbinrc3.d
K480syncer S100hfsmount S340net S000nfs.server
K800killall S320hostname S500inetd
K900hfsmount S440savecore S540sendmail

S500swapstart S610rbootd

S520syncer S720lp


S730cron

K270cron


K280lp K900nfs.server

K390rbootd


K460sendmail


K500inetd


K660net

Because each script in /sbin/init.d performs both the startup and shutdown functions, each will have two links pointing towards the script from /sbin/rc*.d; one for the start action and one for the stop action.

Run Levels and /sbin/rc

In previous HP-UX releases, /etc/rc (now /sbin/rc) was run only once. Now it may run several times during the execution of a system, sequencing the execution scripts when moving between run levels. However, only the subsystems configured for execution, through configuration variables in /etc/rc.config.d, are started or stopped when transitioning the run levels.

/sbin/rc sequences the startup and shutdown scripts in the appropriate sequencer directories in lexicographical order. Upon transition from a lower to a higher run level, the startscripts for the new run level and all intermediate levels between the old and new level are executed. Upon transition from a higher to a lower run level, the kill scripts for the new run level and all intermediate levels between the old and new level are executed.

When a system is booted to a particular run level, it will execute startup scripts for all run levels up to and including the specified level (except run level 0). For example, if booting to run level 4, /sbin/rc looks at the old run level (S) and the new run level (4) and executes all start scripts in states 1, 2, 3, and 4. Within each level, the start scripts are sorted lexicographically and executed in that order. Each level is sorted and executed separately to ensure that the lower level subsystems are started before the higher level subsystems.

Consequently, when shutting down a system, the reverse takes place. The kill scripts are executed in lexicographical order starting at the highest run level and working down, as to stop the subsystems in the reverse order they were started. As mentioned earlier, the numbering is reversed from the startup order.

Example

If you want cron to start when entering run level 2, you would modify the configuration variable script /etc/rc.config.d/cron to read as follows:
# cron config
#
# CRON=1 to start

CRON=1

This would be necessary because the execution script, /sbin/init.d/cron contains the following:
# cron startup
#
. /etc/rc/config

if [ $CRON = 1 ]
   then /usr/sbin/cron
fi
cron will start at run level 2 because in /sbin/rc2.d a link exists from S730cron to /sbin/init.d/cron/sbin/rc will invoke /sbin/init.d/cron with a start argument because the link name starts with an S.

System Shutdown

To shut down HP-UX for power-off, you can do any of the following:
# init 0# shutdown -h -y now
To shut down and reboot HP-UX:
# reboot# shutdown -r -y now
To shut down HP-UX to single-user mode:
# init S# shutdown -y now# shutdown 0
The -h option to the shutdown command halts the system completely but will prompt you for a message to issue users. The -y option completes the shutdown without asking you any of the questions it would normally ask. 










本文转自 客居天涯 51CTO博客,原文链接:http://blog.51cto.com/tiany/1384296,如需转载请自行联系原作者

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
【Linux】nohup后台运行程序并打印日志
在/home/coggle目录下在你英文昵称(中间不要有空格哦)的文件夹中创建一个sleep.py文件,该文件需要完成以下功能:程序一直运行每10秒输出当前时间
114 0
访阿里云数据库产品专家胡航丽:数据库自动驾驶平台DAS 重磅助力数据库领域智能未来
作为数据库领域的佼佼者,阿里云的重要研究领域,数据库自动驾驶,也同样成果显著。阿里云数据库产品专家胡航丽,在2020数据技术嘉年华上,做了前端分享和技术诠释:利用数据库自动驾驶技术,让中小企业共享阿里巴巴优势的技术资源,得到数据库的强技术支撑,保障系统高效、稳定,为用户创造更大价值。
384 0
Linux下Git远程仓库的使用详解
Git远程仓库Github 提示:Github网站作为远程代码仓库时的操作和本地代码仓库一样的,只是仓库位置不同而已! 准备Git源代码仓库 https://github.com/ 准备经理的文件 Desktop/manager/ 准备张三的文件 Desktop/zhangsan/ 创建远程仓库 以下操作为演示在Github网站上创建远程仓库 1.
2469 0
linux 后台运行命令 nohup命令
转载:http://if.ustc.edu.cn/~ygwu/blog/archives/000538.html 2005年04月18日 简单而有用的nohup命令在UNIX/LINUX中,普通进程用&符号放到后台运行,如果启动该程序的控制台logout,则该进程随即终止。
1233 0
win10 Hyper-V 虚拟机 装 boot2docker
1.启动 Hyper-V 管理器 风来了.狐狸 如果开始菜单找不到此按钮或链接,请http://blog.csdn.net/fenglailea/article/details/45488187 此文中打开 如何安装(教程):http://jingyan.baidu.com/article/380abd0a7671071d90192cad.html 2.设置虚拟交换机管理器 2.
2179 0
linux grep命令的使用总结
1、功能描述 grep 命令在一个或多个文件中查找与指定模式匹配的字符串。如果模式里包含有空格,必须用引号括起来。grep的模式只能是一个被引号括起来的字符串或者是一个单词,后面紧跟着的参数都被当作文件名。
722 0
linux grep命令的使用总结
1、功能描述 grep 命令在一个或多个文件中查找与指定模式匹配的字符串。如果模式里包含有空格,必须用引号括起来。grep的模式只能是一个被引号括起来的字符串或者是一个单词,后面紧跟着的参数都被当作文件名。
561 0
u-boot引导友善之臂Linux内核
u-boot引导友善之臂Linux内核 作者:kangear                        Email:kangear@163.com                       Blog:kangear.blog.chinaunix.net 当我刚接触u-boot时,不想自产自用,先用人家移植好的。
958 0
+关注
20377
文章
0
问答
文章排行榜
最热
最新
相关电子书
更多
低代码开发师(初级)实战教程
立即下载
阿里巴巴DevOps 最佳实践手册
立即下载
冬季实战营第三期:MySQL数据库进阶实战
立即下载