From: neil@gid.co.uk (Neil Todd)
Newsgroups: comp.sys.sun.apps
Subject: Re: Calendar Manager
Date: 14 Apr 92 10:48:22 GMT
Organization: GID Ltd, Upper Basildon, READING, Berks, UK

In the referenced article RKooijman@dnpap.et.tudelft.nl (Richard Kooijman DNPAP) writes:
+ 
+ 
+ We are using the Calendar Manager of OW3.
+ To make it easier to browse each other calendars we made a shared dir
+ /var/spool/calendar and mounted on each system.
+ The object was that it wouldn't matter that you typed richard@dutepp6 or
+ richard@dutepp0, but ... apparently the CM is only interrogating other
+ CM daemons and doesn't watch the disk.
+ 
+ With this shared dir setup it was possible to write to a calendar at dutepp6
+ but it would not be visible to anyone who was watching the same calendar
+ at dutepp0 (using 'name'@dutepp0) although the /var/spool/calendar
+ dir was the same on both machines.
+ 
+ Has anyone overcome this problem or should we just stay with local
+ directories and explicit naming of calendars?
+ 
+ Richard.

The trick I use is to nominate one of the machines as the calendar host,
this machine will have the /var/spool/calendar directory, lets call this
calhost, put this in as an alias in the /etc/hosts file.

Then instead of sharing the /var/spool/calendar by NFS, you use the cm
option to talk to a remote calendar manager daemon - so you jump over the
network using rpc from cm rather than rpc from NFS.

What does this give you ? For yourself, you just have one calendar, for
everybody else the calendar is always "user@calhost". It helps to have
a decent mail system so that "mail user" works rather than "mail
user@users_host"

Here is the setup script that I get my users to run, its not brilliant
but it does that trick.

Hope this helps a bit

Neil

#!/bin/sh
# shar:	Shell Archiver  (v1.22)
#
#	Run the following text with /bin/sh to create:
#	  cm_setup
#
sed 's/^X//' << 'SHAR_EOF' > cm_setup &&
X#!/bin/sh
X#
X# @(#)cm_setup	1.3 - 92/03/09
X#
X# "I assert my right to be known as the author of this work" Neil Todd 
X# 9th March 1992
X#
X
XOPENWINHOME=/vol/openwin3
XPATH=/usr/ucb:/usr/bin:${OPENWINHOME}/bin 
XLD_LIBRARY_PATH=${OPENWINHOME}/lib:/usr/lib:/lib
X
XPROG=`basename $0`
XTEMP=/tmp/,${PROG}.$$
XCALHOST="calhost"
X
Xmore <<EOT
X
X${PROG} is a script that is designed to set up the Openwin v3 calendar
Xmanager (cm) for you.
X
XSun's original assumption that each user has a permanent machine allocated
Xto them is not applicable to our environment. Just as we send mail to
X'user' rather than 'user@machine', we want to browse a user's calendar
Xand not wish to bother where the calendar is actually stored.
X
XWe have decided that the calendars for the palm cluster will be available
Xon '${CALHOST}'. A symbolic host name may be available at a later date.
X
XEach calendar has a list of access permissions associated with it, so
Xyou can control who can browse, modify or delete entries. The access
Xpermissions can only be modified by running the calendar manager directly on
X${CALHOST}, the machine associated with calendar (if you see what I mean).
X
XI will set some on the necessary files up for you, and then connect to 
X${CALHOST} to do the necessary final configuration.
X
X
XThere are a number of copies of the Openwin deskset documentation available
Xfrom the System Administration. These documents contain details how to use
Xthe calendar manager and the other deskset utilities such as the filemgr.
X
XYou should note that the 'My eyes only' feature of the calendar manager is
Xnot available to you.
X
XEOT
X
X# First of all get the user to confirm that they are running X
Xecho -n "Are you running an X based windowing system (with openlook or twm) ? [n|y|q] "
X
Xread ANS THEREST
Xif [ "${ANS}" != "y" ]
Xthen
X	echo
X	echo "Sorry, as you are not running an X based windowing system"
X	echo "I can not help you, either run X or talk to the System Administrator"
X	exit 1
Xfi
X
X# Now check that they are local
Xecho
Xecho "Is the window that you are running in a local window to the machine"
Xecho -n "on your desk ? [n|y|q] "
X
Xread ANS THEREST
Xif [ "${ANS}" != "y" ]
Xthen
X	echo
X	echo "Sorry, as you are not running from a local window I can not"
X	echo "help you, either run this command from a local window or talk"
X	echo "to the System Administrator"
X	exit 1
Xfi
X
X# Now look and see if there is an existing  ${HOME}/.cm.rc
Xif [ -f ${HOME}/.cm.rc ]
Xthen
X	echo "You already have a .cm.rc file in your home directory"
X	echo "please remove this and then run this command (${PROG}) again"
X	exit 1
Xfi
X
X# Set up the .cm.rc file for them
Xecho
Xecho "I will now set up the .cm.rc file in your home directory"
Xecho "This file contains a number of basic defaults to make sure that the"
Xecho "calendar manager works correctly for our environment"
Xecho
X
X# id gives the effective uid details - "who am i" is based on real uid
X
X# The sedery below extracts what is in between the first pair of round
X# brackets and deletes the rest
XUSER=`id|sed -e 's/^uid=[0-9]*(\([^)]*\)).*/\1/'`
X
X
X# " rather than ' to make sure that ${USER} gets expanded
X
Xsed -e "s/USERNAME/${USER}/" -e "s/CALHOST/${CALHOST}/"> ${HOME}/.cm.rc <<EOT
XCalendar.BeepOn:	False
XCalendar.FlashOn:	False
XCalendar.OpenOn:	False
XCalendar.MailOn:	False
XCalendar.UnixOn:	False
XCalendar.BeepAdvance:	5
XCalendar.BeepUnit:	mins
XCalendar.FlashAdvance:	5
XCalendar.FlashUnit:	mins
XCalendar.MailAdvance:	2
XCalendar.MailUnit:	hrs
XCalendar.OpenAdvance:	5
XCalendar.OpenUnit:	mins
XCalendar.MailTo:	USERNAME
XCalendar.DayBegin:	9
XCalendar.DayEnd:	17
XCalendar.DefaultView:	1
XCalendar.DefaultDisplay:	1
XCalendar.DefaultCal:	USERNAME@CALHOST.
XCalendar.DateOrdering:	1
XCalendar.DateSeparator:	1
XEOT
X
X# OK we've now got a .cm.rc - need to ensure that we remove it on error
Xtrap 'rm -f ${HOME}/.cm.rc ${TEMP}.*' 0 1 2 3 15
X
Xecho "I will now make a call across to ${CALHOST} to check that I am able"
Xecho "to cleanly access it"
Xecho
X
Xrsh ${CALHOST} date >/dev/null 2>&1
X
Xif [ $? -ne 0 ]
Xthen
X	echo "I couldn't get in to ${CALHOST}, you should edit your .rhosts"
X	echo "file on ${CALHOST} to allow access from this host (`hostname`)"
X	rm -f ${HOME}/.cm.rc
X	exit 1
Xfi
X
Xecho "Access to ${CALHOST} was OK"
Xecho
X
X# it got across OK,  now check that the other end is in our xhost list
Xxhost|grep -s ${CALHOST}
X
Xif [ $? -ne 0 ]
Xthen
X	ADDED_CALHOST=1
X	xhost +${CALHOST}
Xelse
X	ADDED_CALHOST=0
Xfi
X
Xcat >${TEMP}.1 <<EOT
X
X
XI'm about to make a call across to ${CALHOST} to get the calendar
Xmanager to put a display up on your screen, when this happens you will
Xsee an icon with the label of the current month appear.
X
XWait until this icon appears, then proceed through each step of these
Xinstructions.
X
XOpen this icon up in the usual way. This will open up a window.
X
XClick with right hand mouse button on 'Edit' press down located on the
Xtop bar. A small menu will appear, click with the left mouse button on
Xthe 'Properties' button.  This will produce another window labelled "CM
XProperties".
X
XWith the right hand mouse button, click on the 'Category' press down at
Xthe top of the screen. A small menu will appear, select the 'Access
XList and Permissions' option by clicking on it with the left hand mouse
Xbutton.
X
XThis action will change the "CM Properties" window to display a list of
Xaccess options. You should find that by default 'World' has browse
Xpermission for your calendar. You should not change that.
X
XYou need to add permission for you to change your calendar entries from
Xany host on the network, so click on the 'insert' and 'delete' press
Xdowns at the bottom of the screen using the left mouse button.
X
XNow click on the line next to the 'Calendar' press down (not on the
Xpress down itself) a small triangle will appear on the line, type your
Xname i.e. ${USER} followed by RETURN, this will cause an entry to
Xappear in the top part of the window.
X
XIf you wish allow other members of your team to insert appointments
Xinto your diary, you should enter them in a simlar way to yourself -
Xmake sure that you click on the 'delete' press down first so that they
Xonly get 'browse' and 'insert' permissions.
X
XWhen you have added everybody you wish to add, click on the 'Apply' button.
X
XHaving done that, you may wish to explore the other menus offered by
Xthe properties editor. Please do not succumb to that urge!
X
XYou have now configured the calendar manager, and can now access it
Xfrom your local work station without the need to run the command on the
Xremote machine. You just need to type 'cm' from a window an the
Xcalendar manager will be started.
X
XPlease remember that the calendar manager is part of Openwindows 3,
Xso you must have your environment configured to use Openwindows.
X
XIf you have not already done so, make sure that you have the following
Xenvironment variables set and exported
X
XOPENWINHOME=${OPENWINHOME}
XLD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:\${OPENWINHOME}/lib
XPATH=\${PATH}:\${OPENWINHOME}/bin
X
XIf you are not sure how to do this, please talk to a member of the System
XAdministration.
X
XEOT
X
Xecho
Xecho "I have some quite detailed instructions for you to follow." 
Xecho "I strongly advise you to let me print a copy for you."
Xecho -n "Would you like me to send a copy to the default printer ? (${PRINTER:-'squirrel'}) [y|n] "
Xecho
X
Xread ANS THEREST
Xif [ "${ANS}" = "y" ]
Xthen
X	echo "OK, its on its way to the printer"
X	lpr -P ${PRINTER:-'squirrel'} ${TEMP}.1
X	echo
Xfi
X
X# Tell them that a window is going to appear
Xecho "A new window will appear in a few moments, this will give you details"
Xecho "regarding configuring the calendar manager"
Xecho
X
X# Put up the window to contain instructions
Xecho "more ${TEMP}.1; sleep 300000" > ${TEMP}.2
Xchmod +x ${TEMP}.2
X
Xxterm -g 80x24 -title "CM configuration instructions" -e ${TEMP}.2 &
X
Xif [ "${OPENWINHOME}" = "" ]
Xthen
X	echo "I notice that you don't have the environment variable \$OPENWINHOME set"
X	echo "may mean that you are not using openwin based X"
X	echo "if this is the case, then you will have to call the calendar"
X	echo "manager using the command"
X	echo "OPENWINHOME=${OPENWINHOME} LD_LIBRARY_PATH=\${OPENWINHOME}/lib:/lib:/usr/lib \${OPENWINHOME}/bin/cm"
Xfi
X
Xif [ ${ADDED_CALHOST} -eq 1 ]
Xthen
X	trap 'xhost -${CALHOST}; rm -f ${TEMP}.* ; echo done; trap '' 0; exit 0' 0 1 2 3 15
Xelse
X	trap 'rm -f ${TEMP}.* ;echo done; trap '' 0; exit 0' 0 1 2 3 15
Xfi
X
X
Xecho "Type ^C in this window when you've finished configuring"
Xecho "the calendar manager, this will also remove the help window"
Xecho
Xrsh ${CALHOST}  sh -c \"DISPLAY=`hostname`:0 PATH=${PATH} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ${OPENWINHOME}/bin/cm\"
X
X# NOTREACHED
SHAR_EOF
chmod 0555 cm_setup || echo "restore of cm_setup fails"
exit 0


Neil Todd                       | ..In general, it is best to assume that the
PSI%234237100122::neil          | network is filled with malevolent entities
neil@pio.gid.co.uk              | that will send in packets designed to have
GID Ltd                         | the worst possible effect...	RFC 1122