AIX 修改 /etc/inittab

修改 /etc/inittab 文记录,仅支持列命令:
  mkitab:记录添加 /etc/inittab 文。
  lsitab:列出 /etc/inittab 文记录。
  chitab:更改 /etc/inittab 文记录。
  rmitab:删除 /etc/inittab 文记录。

  1.  xcmd 这条记录 action 项值从 respawn 修改 once:
#chitab "xcmd:2:once:find / -type f > /dev/null 2>&1"

  2. 显示进程:# ps -ef | grep find                             
  root 20378 13964  0 11:07:20 pts/0 0:00 grep find           
  root 28970   1  4 11:05:46   - 0:03 find / -type f

  从 /etc/inittab 文除这条记录,您以使 rmitab 命令。例如:
# rmitab xcmd
# lsitab xcmd

  /etc/inittab 文,基本条目按照如所示方式进行排序:

  initdefault

  sysinit

  Powerfailure Detection (powerfail)

  Multiuser check (rc)

  /etc/firstboot (fbcheck)

  System Resource Controller (srcmstr)

  Start TCP/IP daemons (rctcpip)

  Start NFS daemons (rcnfs)

  cron

  pb cleanup (piobe)

  getty for the console (cons)

# mkitab "myinit:2:respawn:ls -l |wc -l > /home/oracle/test1.txt 2>&1"
# lsitab myinit
myinit:2:respawn:ls -l |wc -l > /hmoe/oracle/1.txt 2>&1


# chitab "myinit:2:respawn:ls -l |wc -l > /home/oracle/test1.txt 2>&1"
# lsitab myinit
myinit:2:respawn:ls -l |wc -l > /home/oracle/test1.txt 2>&1


# mkitab "sshinit:2:respawn:startsrc -g ssh 2>&1"
# lsitab sshinit
# rmitab sshinit
 


# startsrc -g ssh
0513-059 The sshd Subsystem has been started. Subsystem PID is 8454224.
# stopsrc -g ssh
0513-044 The sshd Subsystem was requested to stop.

你可能感兴趣的:(AIX 修改 /etc/inittab)