> On Dec 11, 2007 3:08 PM, John Voight <[EMAIL PROTECTED]> wrote:
> > Hi,
>
> > Is it possible to automatically login the VMware appliance as "sage"?
You may have other reasons for wanting to have someone logged in
automatically and I don't use the VMs mysef, so perhaps I am
suggesting something that is already done.
Since these VMs have the sole purpose of running sage (in notebook
mode), they should probably have a "service" that gets automatically
started, much like "sshd", "httpd" etc. On redhat derived systems this
works via the "runlevel" scripts in /etc/init.d and /etc/rc* . This is
how our sysadmin has made the sage service robust in the face of
reboots.
something along these lines would do the trick:
----- /etc/init.d/sage ---------------
#! /bin/sh
#
####
#
# chkconfig: 345 98 55
#
# description: init script to start and stop sage
# sage will be run as nobody
#
####
# Source funciton library.
. /etc/init.d/functions
# If sage binary not there exit
if [ -f /usr/local/bin/sage ] ; then
SAGE="/usr/local/bin/sage"
else
exit 0
fi
SAGE_PID="/home/nobody/sage_notebook/twistd.pd"
# Source config
if [ -f /etc/sage.conf ] ; then
. /etc/sage.conf
else
SAGE_OPTIONS=" -c 'notebook()' &> sage.log"
fi
case "$1" in
start)
echo -n "Starting Sage"
# echo -n "$SAGE $SAGE_OPTIONS"
# /bin/su - nobody -c '$SAGE -c "notebook()" &>
sage.log'
/bin/su - nobody -c "$SAGE $SAGE_OPTIONS"
echo "."
;;
stop)
echo -n "Stopping Sage"
#kill sage
kill `cat $SAGE_PID`
echo "."
;;
*)
echo "Usage: /sbin/service sage {start|stop}"
exit 1
esac
exit 0
#EOF
------------------------------------------------
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---