action=installAsRoot # privileged stuff hereYou can tell users that they should log in as root and issue the command
$ ups installAsRoot <product> <version>
action=installAsRoot # just a magic keywordwhich is called from separate stanzas (all with different actions):
action=doMyThing exeActionRequired( installAsRoot ) # MyThing goes here action=doYourThing exeActionRequired( installAsRoot ) # YourThing goes hereThen tell users to issue the command
$ ups doMyThing <product> <version>or
$ ups doYourThing <product> <version>
In other words, a non-privileged user who would otherwise be able to install products should ALWAYS be able to:
| $ upd install <product> <version> | # or ftp the files and # unwind them manually as an unprivileged user |
| $ ups declare <product> <version> <-g chain> | # this implies 'ups configure' and/or
# 'ups <chain>' for whatever chain # has been requested, e.g., # 'ups current' or 'ups test' |
| $ su root
$ . /usr/local/etc/setups.sh # or 'source /usr/local/etc/setups.csh' $ ups installAsRoot <product> <version> | # this step may be done at a later time;
# (replace /usr/local/etc with the appropriate path # to $SETUPS_DIR on each system); # (or a similar type of 'ups install' command) |
Note that the product will probably not function properly until the user has performed the final step as 'root'. In many cases, this step may need to be taken on each node in a cluster; this should be noted in the documentation (INSTALL_NOTE, etc.) as well as in the message issued during product configuration.
The following sample table file may be used as an example. After the sample table file, each stanza is discussed.
File=Table
Product=SampleProduct
Group:
Flavor=ANY
Qualifiers=""
Common:
Action=setup
prodDir()
setupEnv()
pathPrepend(PATH, ${UPS_PROD_DIR}/bin)
Action=configure
execute( echo "You must login in as root and issue the command", N0_UPS_ENV )
execute( echo " ups installAsRoot ${UPS_PROD_NAME} ${UPS_PROD_VERSION}", NO_UPS_ENV )
execute( echo "on each node of the cluster to finish the installation.", NO_UPS_ENV )
Action=current
exeActionRequired( configure )
Action=installAsRoot
execute( echo "Now performing privileged tasks...", NO_UPS_ENV )
execute( ${UPS_UPS_DIR}/installScript, UPS_ENV )
End:
Discussion:
File=Table
Product=SomeOptions
Group:
Flavor=ANY
Qualifiers=""
Common:
Action=issueMessage
execute( echo "", NO_UPS_ENV )
execute( echo "You must log in as 'root' and issue", NO_UPS_ENV )
execute( echo "one of the following commands in", NO_UPS_ENV )
execute( echo "order to finish the installation.", NO_UPS_ENV )
execute( echo "Please select the appropriate option", NO_UPS_ENV )
execute( echo "for your site:", NO_UPS_ENV )
execute( echo "", NO_UPS_ENV )
execute( echo " 1) Option 1: description of option 1", NO_UPS_ENV )
execute( echo " goes here. If you want to install", NO_UPS_ENV )
execute( echo " this option, log in as root and", NO_UPS_ENV )
execute( echo " issue the command", NO_UPS_ENV )
execute( echo " $ ups opt1 ${UPS_PROD_NAME} ${UPS_PROD_VERSION}", NO_UPS_ENV )
execute( echo " 2) Option 2: description of option 2", NO_UPS_ENV )
execute( echo " goes here. If you want to install", NO_UPS_ENV )
execute( echo " this option, log in as root and", NO_UPS_ENV )
execute( echo " issue the command", NO_UPS_ENV )
execute( echo " $ ups opt2 ${UPS_PROD_NAME} ${UPS_PROD_VERSION}", NO_UPS_ENV )
execute( echo "", NO_UPS_ENV )
Action=configure
exeActionRequired( issueMessage )
Action=current
exeActionRequired( issueMessage )
Action=installAsRoot
Action=opt1
exeActionRequired( installAsRoot )
execute( echo "Now performing 'ups opt1' actions.", NO_UPS_ENV )
execute( "${UPS_UPS_DIR}/installScript opt1", UPS_ENV )
Action=opt2
exeActionRequired( installAsRoot )
execute( echo "Now performing 'ups opt2' actions.", NO_UPS_ENV )
execute( "${UPS_UPS_DIR}/installScript opt2", UPS_ENV )
End:
Discussion:
For OSS and UAS, this is no longer a theoretical problem that can be put off. The success of the ups/upd rewrite and the bootstrap product has meant that many more system utilities (ssh, tcp_wrappers, kerberos, 90?) are installed via upd. (The problem of knowing when to be root and what to do was one of the reasons why system utilities were not generally packaged as ups products before).
Product installers need to be able to successfully "do the right thing" -- be root when necessary, and not otherwise.
This document was created in January 2000 by llc.