At CFHT, we refer to the user account for an instrument and all of the software installed within it as the ``session''. Sessions which conform to the original design, which includes automatic clean-up, re-build, and release mechanisms are known as ``Pegasus sessions.'' Practically every session has enough manual edits and tweaks that the only way to restore the setup is from a simple archival backup. Newer sessions like ``megacam'', which build on Pegasus software have completely abandoned the auto-build design, are known as ``NEO'' (New Environment for Observing) sessions. These also lack any ``Pegasus Session Manager'' ( psm) tool bar at the top of the screen, but just launch a detector control window and a top-level ``RPM'' GUI at login time.
If the PSM is missing, ``background menus'' controlled by the Window Manager (should?) give at least these three options as a partial substitute for the missing PSM:
Just as the username `` pegasus'' was a non-instrument-specific demo/testing session, the username `` neo'' (with home directory /h/neo) serves as a template for what we might want future sessions to look like. At the moment, it is unlikely that existing instrument sessions would work, though, if one just forced all the generic components of /h/neo into a specific session. Unfortunately the instrument-specific needs are not as well separated as they should be. It is hoped that neo might be useful in the following ways:
The following subsections describe the generic NEO account, and also how to convert a Pegasus account to use as much of the NEO things (FVWM, Director, Detcom) as possible.
This is a description of all of the files and programs that make up a CFHT observing ``session'' such as megacam, cfhtir, and instruments using DetCom as the source for FITS files. It is written from the point of view of setting up a new account from scratch.
The first step to create a data acquisition account (or any other user account, in fact) is to add an entry to the master NIS password database, currently on the machine ``niu'' in Waimea. This step is usually performed by the system administrator. Skip to step 2 if an account has already been created.
A typical observing account entry in /var/yp/src/passwd would look like this:
neo:xxxxxxxxxxxxx:1234:1000:New Environment for Observing:/h/neo:/apps/gnu/bin/bash
Notes:
The home directory should be located on a reliable RAID disk at the summit, and the entry in the autofs maps is maintained in the file /var/yp/src/autofs/SUNautomount/auto.h also on nui.
neo noeau:/local/h/neo
would be the entry matching the passwd example above.
Finally, add the new user account to netgroups ``doubt'' and ``observer'' and push the changes out to all machines using the normal procedures.
If migrating an old account, all of the following files are obsolete, and at least some of the must be removed to avoid problems:
x11start.cfht - done by system wide startup scripts
.x11start* - done by .fvwm-xstartup
.xprofile* - done by .fvwm-xstartup
.xsession - done by system wide fvwm.xsession
.Xdefaults - system wide Xdefaults should contain everything necessary.
session - now handled by system startup scripts, director, etc.
TODO: Nothing handles make -C /cfht/src/observer config yet.
TODO: Nothing handles checking that the session is not already in use.
TODO: Nothing starts vstatus.
.sessionrc - done by system wide fvwm scripts and .fvwm-initfunction
TODO: Nothing checks for .disable
.cshrc - system wide bash startup scripts take care of it
.login - system wide bash startup scripts take care of it
.logout - *If* you have one, see if there's anything in there
that should be moved to sessionquit.
.mwmrc - Ignored by fvwm
.twmrc - Ignored by fvwm
.gnome - Remove, xdm on Linux doesn't need it
.vue - Remove, if prompted for window manager on HP, select FVWM.
.vueprofile - ``
.dt - Remove, if prompted for window manager on Sun, select FVWM.
.dtprofile - ``
.rhosts - Remove for security
.ssh - (directory) Remove for security
.colorsetup - Not used when feedback window is Director.
.,*.header - Not used by DetCom (will be re-created if still using DetI).
core* - No comment.
.,aloha.par - Aloha is gone :-(
.,genh.par - Not needed.
Still more files, which are all vestiges of pre-DetCom detector control systems, should be removed to avoid the possibility of scripts obtaining incorrect pixel size or other chip information:
.,cccd.par .,ccd.par .,chip.par .,detector.par .,*.cfg .,howccd.par .,whichccd.par .,template .,raster.par .,fraster.par
TODO: Make a kill-script which takes care of all this (making backups and verbose commentary along the way.)
Once an empty home directory exists, some dot-files must be set up to configure the account as an observing session. In addition to the files shown here, other dot-files may appear as a result of logging in and using various programs, but those listed here are believed to be the only ones necessary for a functioning session.
/apps/wm/common/fvwm.xsessionwhich is the name of the script that sets things up and eventually executes fvwm.
#!/bin/sh # # .fvwm-options - Set some variables for /apps/wm/common/fvwm.xsession # that select options for a Pegasus observing session. # SSO_HOST=noeau SSO_WMNAME=fvwm2 SSO_PEGASUS=1 SSO_COLORS=pegasus # # send the variables to the fvwm startup script (calls this script w/ eval) # echo "SSO_HOST=$SSO_HOST ; export SSO_HOST" echo "SSO_WMNAME=$SSO_WMNAME ; export SSO_WMNAME" echo "SSO_PEGASUS=$SSO_PEGASUS ; export SSO_PEGASUS" echo "SSO_COLORS=$SSO_COLORS ; export SSO_COLORS"
The window manager for observing sessions is FVWM version 2, and the SSO_PEGASUS=1 setting causes CFHT Pegasus-specific root-menu options to appear. These root-menus are defined in the standard distribution in /apps/wm/, but are disabled for normal users.
Another use for the .fvwm-options script is to display a pre-login user interface. This could be used to get something like a user preference for default shell in terminal windows. Add this to the end of a session's .fvwm-options file use the Tcl/Tk script "sso" to gather preferences from the user:
if [ "$HOSTNAME" = "$SSO_HOST" ]; then # # If we are already on the real sessionhost, display # the GUI that lets the user choose a few extra options # related to the session before the window manager starts: # exec /apps/wm/common/sso fi
IMPORTANT: Be sure to run "chmod +x" on the script to make it executable.
TODO: Have fvwm.xsession export SSO_* so .fvwm-options does not have to.
TODO: Is /apps/wm/common/sso useful to have in by default?
TODO: Set SSO_HOST to a DNS CNAME like $USER-session.cfht.hawaii.edu?
TODO: Make SSO_COLORS=pegasus the default if SSO_PEGASUS=1?
CFH12K and MegaCam did not use this file, but nothing is broken by having the extra environment variables defined. So, again, this is a non-session-specific setup script.
TODO: Incorporate this script into /apps/wm/common/ and have it get executed if SSO_PEGASUS is set. Eliminate it from all home directories.
TODO: raster mess: make note that must copy raster-shift script to .director/bin until solution is found (see /h/moseev/.director/bin/raster) Also copy fraster for now? Latest hack: remove raster+fraster from PSM, and disable all rasters which originated from that interface (see /h/osis/.director/bin/raster). User types raster at the command line (or eventually, from the Expose form) and it sticks. Focus scripts that want to send a raster should be modified to send it in the DetCom style (without the extra "slot" argument that DetI takes) so that the new raster script will not ignore it. A prototype of the new raster.rpm form is in /h/osis/rpm/.
TODO: nexp - how to handle this? For now, need nexp and neo-par from gecko/.director/bin/
.fvwm-initfunction - Like .fvwm-options, this should also be an executable (usually another shell script) and it is used to launch the session manager tool bar (PSM), director feedback window, and any initial sessionstart processes. The same script can be used by all sessions, since ``sessionstart'' itself figures out what needs to be started for this specific session, and ``.director/startup'' determines which agent programs need to be started. See also the descriptions of those two files, below.
This script runs once on each screen.
#!/bin/sh # # .fvwm-initfunction - Start session user interfaces. # # Director is started on StatusDisplay in a color rxvt terminal window. # if [ "$DISPLAY" = "$StatusDisplay" ]; then rxvt -pixmap none +sb -geometry 80x37-62-1 -e director & fi # # All screens should wait for Director on StatusDisplay to be ready, # so that logging facilities are completely ready. # echo "Waiting for director to be ready for log input" if ( clicmd @running 60 ); then echo "Director is ready" else echo "Director still not ready after 60 seconds!" # Abort the session somehow? fi # # The main GUI (PSM and/or an exposure form) are started on MainDisplay. # if [ "$DISPLAY" = "$MainDisplay" ]; then sessionstart & psm -X fi
TODO: MegaCam wants "director -s"!
TODO: Replace sessionstart, psm -X, hform startup with: sessionstart -gui?
TODO: Replace director invocation with start-cli script. sessionstart -cli?
TODO: Rip out NUMBER_OF_SCREEN and *Display stuff from megacam once .fvwm-xstartup is being used by megacam session.
TODO: Fix handler_status problem with geckoh, and remove hack from .fvwm-initfunction
TODO: Add timestamps to junk in .fvwm-errors-*
TODO: Confirm that there is no reason to (re)start roll during session logins. (OK)
TODO: Figure out best place to ensure $HOME and $HOME/bin are in the path.
TODO: Other stuff to be sourced from bashrc?
TODO: Implement check for whether or not to do shutdown.
TODO: director-4.27+ is required for shutdown feature/``-s'' option to work.
More general information on how .fvwm* files are handled in the CFHT environment are given in /apps/wm/common/fvwmstart.ps.
The only thing the window manager startup scripts do, for getting the command line part of the session going, is to start `` director'' without any options. If one wants to have just the command line part of a session, it is usually possible to `` su - username'' and then just run `` director'' as the session.
It is also possible to run the entire graphical session inside a window (vncviewer) using the script `` session-test'', run from your personal account.
For now, the contents of the .director/startup file specify
Typical syntax looks like this:
@-infosize 9 agent start -R -D -H deticli dethost1:/cfht/bin/detcom-3.47 ~/dsp/ltb.lod ~/dsp/lub.lod
The '@' and '-' characters do the same thing they do in a Makefile. (Don't echo the command itself, and don't stop executing if the command happens to fail.)
The "infosize 9" maximizes the number of debug/user info lines shown below the prompt area. 9 is probably only needed for engineering, so reduce it if you'd rather not confuse the user with DSP code version status, etc. Generally, since we're doing service observing, some of the low level info is good or at least harmless.
The -R and -D options tell director to (R)estart detcom automatically if it exits (or crashes) and that it is the (D)efault agent to receive any user commands that are not prefixed by a handle.
.,deti.par - Needs to be a link to .,detcom.par until all refs to deti.par (possibly just ccd?) are fixed.
TODO: Remove ``-H deticli'' when all scripts are updated.
TODO: Remove .,deti.par and use .,detcom.par.
TODO: Standardize a way to select detector host on the fly.
TODO: Add option to director that causes it to ignore .director/sessionhost, and remove comments below about it, and sessionhost.tmp.
The first step in this upgrade is to convert the handler to use libfh. Detailed directions for converting from libff to libfh are found on another page.
The code that makes it possible to dump keywords to the status server need to be incorporated into an fh->ss type library. For now, just cut-and-paste the lines from tcsh or geckoh. Those handlers are also good to look at as examples. NOTE: converted handlers are still 100 templates, DetI, and G3v3 detector software.
TODO: Add conversion recipes: FF_OBSTYPE -> ENV_OBSTYPE, FF_SEQ_NUM -> ENV_SEQNUM, FF_ETEMPLATE -> ENV_FFTEMPLATE
TODO: Incorporate fh->ss routines into a library.
TODO: Other programs needed in $HOME/bin: clicmd clicap clidup director3-3.33
TODO: Session runid and piname needs to be ignored!
#!/usr/bin/sh
if (( $# > 0 )) ; then
iterations=$1
else
iterations=1
fi
exec ccd -go -iterations ${iterations#0}
As always, it must be ``chmod +x''.
TODO: Move ``go'' into /cfht/bin/ and consolidate all session items that are just symlinks.
TODO: Remove INSTRUME from DetCom. Add to appropriate instrument handlers.
TODO: Sort out raster mess.
TODO: Why does ccd call HOME/bin/raster?
TODO: Install new version of ccd, now in gecko/.director/bin/
The ``Expose'' button on the session manager runs ``ccd -X'' which now brings up hform, pointing at /h/USER/rpm/index.rpm. That file should be a link to "detcom.rpm", which in turn can be copied from gecko (until a better place is found for these files.)
TODO: Make installation of RPM forms cleaner.
In order to function, the detcom.rpm form must have access to rasters and current detcom status. Set up the following files like gecko:
.,neo.par rpm/neo.par -> ../.,neo.par rpm/detcom.par -> ../.,detcom.par rpm/rasters.par rpm/rasters.rpm ??
TODO: Fix rasters (already mentioned elsewhere too)
TODO: Move this stuff to the status server.
At CFHT, our Solaris and HP-UX platforms include CFHT-maintained system-wide directories /apps/wm/ and /apps/gnu/. All of the source code and "configure" options that can be used to build the software in these directories on another Unix-like platform are referenced in the file /apps/gnu/src/CFHT.README. The main areas of customization are in the Window manager configuration (FVWM 1.24r, and FVWM 2) and some of these customizations are CFHT- or even ``Pegasus''-specific.
NOTES:
Q+A: