MCS SoftEnv FAQ |
|
SoftEnv is the system used at MCS to help build a user's UNIX-based |
|
|
SoftEnv is a software abstraction system. It allows users to specify applications they want to use in a configuration file, and then their environment is setup correctly on every UNIX system in our computing environment. . Users don't have to track application changes (like new environment variables or changed paths) or worry about new applications unless they want to.
The .soft file is used on every UNIX computer in MCS to set 3 basic things in your shell's environment:
(Before March 2000, this functionality was handled by a file called .software.) On a conventional UNIX system, you are responsible for setting these up yourself. However, at MCS, the recommended values for these variables changes rather frequently. So, rather than your having to try to keep up with all of the recommendations and special changes and then update your files yourself, we put the values in a database, and the .software system automatically looks them up for you.
For example, if your PATH needs to be updated for you to be able to access some newly-installed piece of software, then the .soft system will change your PATH automatically the next time you login. The way to customize your environment is explained in this FAQ.
In general, we recommend just putting this line in to start with:
@default
This will add all of the system paths, tons of applications, and local customizations to your environment.
As your needs grow over time, you can add specific applications that might not be part of the default environment (the vast majority are in the default though), or your own environment variables, or special conditional statements. All of these are described later in this page in the Syntax section.
The command 'softenv' displays every key that exists on the new system. Probably more than you want to see, in fact. Read the man page for softenv for more information.
Two other useful features to know are:
YES! Contrary to the previous .software system, 'softenv' does care about the case of words. Therefore, +idl is not the same as +IDL, also notice these
return different keys.
With 'soft add <keyword>', you can at that moment, add that keyword to your environment. Similarly, with 'soft delete <keyword>', you can delete any instances of that keyword from your environment. It is also suggested that you run 'resoft' whenever you want to be sure your environment is back to normal.
For example, if you want to try out idl, do the following:
> soft add +idl > idl & (do whatever you want) > soft delete +idl
Or, you can create two .soft files. If you create a .soft.idl file containing:
+idl @default
then you execute the command 'resoft .soft.idl'. You will then get the environment based on that file. A plain old 'resoft' will set you back to your real environment.
We recognize this is helpful for many groups; however, you can't change it yourself. Send an email to systems and we will usually agree with your plan and set up the key.
At any UNIX prompt, type
There are other administrative man pages which systems can point you to.
Yes, this software will be open-source and released as part of Msys, the MCS Systems Administration Toolkit.
The coding was done by Remy Evard (evard@mcs.anl.gov)
and Alan Bailey (bailey@mcs.anl.gov).
Run the command 'softenv'. If there is a '*' on the left side of a keyword, that tells you that this keyword or macro is included in the definition of @default.
Create a file called .nosoft in your home directory. This will disable all parsing of .software, .software-beta, and .soft files.
May the force be with you. :)
The SoftEnv system creates sh and csh scripts in your home directory that are loaded by the shell to build your environment. Cron jobs don't do this automatically, but you can arrange for them to do so by loading them directly.
If your cron job is an SH script, do this near the beginning: . $HOME/.soft.cache.sh
If it's a csh script, do this: source $HOME/.soft.cache.csh
Note that if your cron job is just a simple command in your crontab then this won't work... the command needs to be invoked from a script that first does one of the above calls, and then calls the command.
The .software file is a basic text file. Lines starting with a # are considered to be comments and are ignored. Blank lines are fine too. Note:
Each line in the .soft will look like one of these:
@{macro} +{key} PATH+=/foo MANPATH+=/foo/foo CVSROOT=/home/foo/foo if ARCH=solaris-2 then PATH+=/foo if ARCH=sun4 then @sun4-legacy-apps if HOSTNAME=gaea then +gcc-2.3.1 @remove {key} {macro}
An example ~/.soft file would be:
.soft file | What this entry means |
---|---|
+absoft | If you run 'softenv -k absoft', you will see that absoft is not included in the default settings for SoftEnv. This line adds to your environment all the settings necessary to use the program absoft. |
+acroread-3.1 | Add to my environment all the settings necessary to use the program acroread-3.1. If you run 'softenv -k acroread -a solaris-2', you will see that this application no longer exists on solaris-2. |
+idl | Add to my environment all the settings necessary to use the program idl. If you run 'softenv -k idl', you will see you can either specify you want idl-5.2 or you can specify idl without a version number. You should generally chose to use the key without a version number, so that you are always equipped with the default stable version. Only if you want to use an application that is not the default should you use a key like +idl-5.2. |
+jdk-1.1.6 | Add to my environment all the settings necessary to use the program jdk version 1.6. If you run 'softenv -k jdk', you will see that you can chose between versions 1.2, 1.1.5, or 1.1.6. In this case, you must specify the version number because there is no default version. |
@remove +totalview +totalview-beta |
(This is for advanced users only.) If you put
@remove <keyword> on the top of your .soft file, it will remove any instances of
that keyword from any future macros you use in your .soft file. NOTE:
This means "@remove"s have to come before @default to override the default
settings. For this example, if you run 'softenv -k totalview', you will see that "the default stable version of totalview" is part of the default SoftEnv settings. However, if you would rather use the beta version of totalview, and not the stable version, you can. First you must remove the stable version from your environment; then add the key for the beta version. |
@default | This line adds all the default information to your environment. For a lot of users, this is the only line necessary in the .soft file. If you run 'softenv -k program' and see a * in the far left column, this key is part of the default. For example, the keyword '+mh' is included in @default. Thus, you don't need to specifically add that key (+mh) to your .soft file. |
PATH+=/home/tdgl/bin PATH+=/home/tdgl/docs/psfig |
Add the two paths specified to my PATH environment variable. Note the operator is "+=". If you were to use "=", you would remove all previous or default information from the PATH variable. |
DPSSHOME=/home/username/DPSS DPSSHOST=dpss.lbl.gov |
Set the environment variable DPSSHOME and DPSSHOST as specified. Note that the operator used is "=" and not "+=". This means that if there was any default settings for these variables, you would overwrite them with your settings. You have effectively set the variables to the values specified, instead of adding information to the default. |
In this case, the information you wish to add to the IDL_PATH contains a + sign. To ensure the + is added to the path and not confused with the "+=" operator, surrounded the value in double-quotes. (Otherwise, the assignment wouldl produce an error.) Any time there is an uncertainity in parsing a value, surrond it in quotes. | |
If I am on a Linux machine, then add /home/username/bin to my path. | |
If I am on a Solaris-2 machine, then add /home/username/solaris-2/bin to my path. |
Conditionals are very versatile now, and are a totally different syntax as compared to the old syntax. Use them like:
if ARCH=linux then +idl
You can use any variable in the conditional; however, only
are provided. You can also include anything after the 'then' in the statement, such as
PATH sets, keyword additions, or macro additions.
You can additionally create any other variables you might want. Some examples:
FOO="`whatami`" if FOO=sun4 then +adm MYVAR="`/homes/username/bin/usedefault`" if MYVAR="yes" then @default if HOSTNAME=fire then PATH+=/homes/username/bin/fire
You can use anything from the output of 'whatami -l'. However, at this moment (Feb 2000), only five of those will do anything:
(Notice also that these are different than the architecture strings used with .software or .software-beta.)
Type resoft, which will almost always give you a working environment. Then create a
.soft file with @default in it, and log out and log back in. This
will create a clean environment from your .soft file.
First, check your .soft file to make sure it is sane.
If all else fails, send email to systems, and we'll see what the problem is.
That either means you updated your .soft file recently, or an administrator made a change to the database.
To find out what changes an administrator made, view this webpage containing information from the rcs updates to the database.
Assuming your environment is set up how you want it, you can remove your .software or
.software-beta files from your home directory,
either by deleting them or renaming them.
View the file ~/.soft.cache.csh. The errors that occured listed near the top of that file. Then you can edit your .soft file to fix the errors.
[ FAQs | Account Request | Equipment Checkout | Announcements | Tech Updates | Systems ] | |||
|