notes - solaris - basic administration

PACKAGE MANAGEMENT

pkgadd -d [device | pathname] pkg_name
pkgchk [-p path1 [path2...]]
pkgrm pkgname1 pkgname2 …


NIS MANAGEMENT


ypmake       ---– rebuild NIS database
nispopulate  ---– populate the NIS+ tables in a NIS+ domain


BOOT ARCHIVE


When you install the Solaris OS, two boot archives are created, one primary
archive and one failsafe archive.


RESTORE OS - Maintenance Mode


/lib/svc/method/fs-root
/lib/svc/method/fs-usr
/lib/svc/bin/restore_repository


RDAC FILE - man it

/etc/user_attr
/etc/security/auth_attr
/etc/security/prof_attr
/etc/security/exec_attr


NAME SERVICE SCOPE

/etc/nsswitch.conf


USER AUTH FILES

/etc/passwd
-------------------------
username : password : uid : gid : comment : home - directory : login-shell
jarvis:x:100:100::/export/home/jarvis:/bin/bash
-------------------------

/etc/shadow
-------------------------
username : password : lastchg : min : max : warn : inactive : expire
jarvis:JGA/FIryYxFUE:14631::::::
-------------------------

/etc/group
-------------------------
group-name : group-password : gid : user-list
oracle::103:oracle
-------------------------


RUN LEVEL

■ Run level 3 – All system resources are available and users can log in.
                By default, booting a system brings it to run level 3,
                which is used for normal day-to-day operations. This run
                level is also known as multiuser level with NFS
                resources shared.

■ Run level 6 – Stops the operating system and reboots to the state that
                is defined by the initdefault entry in the /etc/inittab
                file.

■ Run level 0 – The operating system is shut down, and it is safe to turn
                off power. You need to bring a system to run level 0
                whenever you move a system, or add or remove hardware.



KERNEL PARAMETER

/etc/system

COMPRESS/UNCOMPRESS ROOT ARCHIVE
/boot/solaris/bin/root_archive

SERVICES
svcs              --- list services
svcadm         --- admin services
svccfg
svcs -p         --- relationships between services and processes
svcs -x         --- explanation of why a process isn't running
/var/svc/log/     --- boot log of each services
■ Services are automattically restarted if possible, a service process refuse to die
■ FMRI  ---  Fault  Management Resource Identifier

           ■svc://localhost/system/system-log:default
           ■svc:/system/system-log:default
           ■system/system-log:default

 

■ Service Category

   ■ application
   ■ device
   ■ milestone
   ■ network
   ■ platform
   ■ site
   ■ system

 

■ Service States

  ■ degraded – The service instance is enabled, but is running at a limited capacity.
  ■ disabled – The service instance is not enabled and is not running.
  ■ legacy_run – The legacy service is not managed by SMF, but the service can be observed.
                          This state is only used by legacy services.
  ■ maintenance – The service instance has encountered an error that must be resolved by the
                             administrator.
  ■ offline – The service instance is enabled, but the service is not yet running or available to run.
  ■ online – The service instance is enabled and has successfully started.
  ■ uninitialized – This state is the initial state for all services before their configuration has been read.

 

/var/svc/profile/   --- SMF Profiles

 

svcprog         --- Retrieves property values from the service configuration repository with a output format

                          appropriate for use in shell scripts

svcs -l FMRI   --- list the status of services

svcs -a          --- show all the processes' status

svcs -D FMRI  --- show services dependent on this service

svcs -d FMRI  --- show services this service dependent on

 

svcadmin enable

svcadmin disable

 

 

RUN LEVEL

 

0/5  Power Down State

s     Single User State

1     Admin State

2     Multiuser State  -- All Service except NFS

3/4  Mutiuser State with NFS

6     Reboot

 

who -r   --  see run level

 

 

/etc/inittab

 

id : rstate : action : process

 

id           --- Is a unique identifier for the entry.
rstate    --- Lists the run levels to which this entry applies.
action    --- Identifies how the process that is specified in the process field is to be run.

                  Possible values include: sysinit , boot , bootwait , wait , and respawn .
process --- Defines the command or script to execute.

 

example:

p3:s1234:powerfail:/usr/sbin/shutdown -y -i5 -g0 >/dev/msglog 2<>/dev/msglog

h1:3:respawn:/etc/init.d/init.cssd run >/dev/null 2>&1 </dev/null

 

 

Adding a Run Control Script

 

# cp xyz /etc/init.d
# chmod 0744 /etc/init.d/xyz
# chown root:sys /etc/init.d/xyz
# cd /etc/init.d
# ln xyz /etc/rc2.d/S99xyz
# ln xyz /etc/rc0.d/K99xyz
# ls /etc/init.d/*xyz /etc/rc2.d/*xyz /etc/rc0.d/*xyz

 

 

 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值