HP-UX Secure Resource Partitions (SRP) A.02.01 Administrator's Guide

32
5 Using the SRP Environment
Once you have created an SRP, and started it with the srp start command, the SRP is now
available for user sessions and execution of programs. This chapter discusses the following topics:
5.1 Establising a User Session in the SRP
5.2 Managing SRP Startup and Shutdown Actions
5.3 Deploying Applications in an SRP Environment
5.1 Establising a User Session in the SRP
HP recommends the following two methods to establish a user session from an SRP:
srp_su: Use this command from the INIT compartment to establish a user session within the
specified SRP compartment. Note that by default, this command is restricted to the root
user. See 3 Executing the su Command in the Target SRP for instructions on how to use the
srp_su command.
Secure Shell (SSH): If you have applied the SSH template to the SRP, you can now
connect across the network to the SRP via Secure Shell. Note that since all SRP’s share a
common host name, you should specify the SRP’s specific IP address to ensure that you
connect to the desired SRP. See 11 Using the sshd Template for instructions on how to apply
the Secure Shell template.
NOTE: Login will be restricted to a set of Unix users and groups specified with the login service in the
base template. If you did not apply the login service to this SRP, then login is not restricted.
5.2 Managing SRP Startup and Shutdown Actions
You can automate the activities that you want to be performed when the SRP is started or stopped as
follows:
Init service: Each SRP has a startup and shutdown directory structure that replicates the
system startup and shutdown structure (rc1.d through rc4.d in
/var/hpsrp/srp_name/sbin/). These scripts will be executed within the SRP when the
SRP is started or stopped. Note that run levels 1 and 2 are used to manage the SRP startup
and shutdown. HP recommends that you use only run levels 3 and 4 (rc3.d, and rc4.d)
for deploying your start scripts. HP recommends that you follow the practices recommended
on the init(1M) man page for creating and deploying your start scripts.
Hard kill: By default, SRP provisions a shutdown script to kill all active processes in the SRP
as one of the final shutdown activities within the SRP when the SRP is stopped
(/var/hpsrp/srp_name/sbin/init.d/srp_killall). To disable this feature,
remove the soft link file for the script :
# rm /var/hpsrp/srp_name/sbin/rc.1d/k640srp_killall
NOTE: If you disable the hard kill feature, the SRP can enter the Stopped state with
active processes still executing in the SRP environment.
SRP setup: The SRP setup and shutdown script
(/var/hpsrp/srp_name/.setup/setup) is executed in the INIT compartment before
and after startup and shutdown of the SRP (before the init service on start and after on
stop). You can modify the script to perform system management activities you want to be