Thank you for the heads up. So, here is the solution to the problem I
was having on an Ubuntu

system:

Create /etc/init.d/sage with the following contents (created by
referencing

http://spiralbound.net/2007/07/23/example-linux-init-script
and
http://www.debian-administration.org/articles/28 ):


#! /bin/sh
# I retyped this, because I forgot how to copy/paste from PuTTY, so
there may be typos.

case "$1" in
  start)
        echo -n "Starting SAGE Notebook Server"
        /bin/su - chris -c "/etc/sage/sage-start &"
#the & is very important ... I had to figure out how to
#remotely edit and reboot my machine through sage because nothing
#was starting after sage...
        echo "."
        ;;
  stop)
        echo -n "This script currently doesn't support stopping the server."
        ;;
  *)
        echo "Usage: /etc/init.d/sage {start|stop}
        exit 1
        ;;
esac

exit 0


The contents of /etc/sage/sage-start are as follows (from Mike's
reply):


sage -c "notebook(open_viewer=False,address='$(cat /etc/hostname)')"


Add the script to be run on startup (found at
http://ubuntu.wordpress.com/2005/09/07/adding-a-startup-script-to-be-run-at-bootup/
):


[EMAIL PROTECTED]:update-rc.d sage defaults

On Apr 6, 5:03 am, "Mike Hansen" <[EMAIL PROTECTED]> wrote:
> Hi Chris,
>
> The problem is due to the way sage -notebook is handling options
> passed to it.  This was pointed out to me by stefanv on IRC last
> night.  I've made the following ticket for 
> ithttp://trac.sagemath.org/sage_trac/ticket/2827.
>
> You can pass arbitrary strings to run with "sage -c".  For example,
>
> [EMAIL PROTECTED]:~$ sage -c "s = SFASchur(QQ); print s([2,1])^2"
> s[2, 2, 1, 1] + s[2, 2, 2] + s[3, 1, 1, 1] + 2*s[3, 2, 1] + s[3, 3] +
> s[4, 1, 1] + s[4, 2]
>
> --Mike
>
> On Sun, Apr 6, 2008 at 2:55 AM, Chris Chiasson <[EMAIL PROTECTED]> wrote:
>
> >  I would like to use
>
> >  sage -notebook
>
> >  or a similar command to start my sage notebook server on boot from a
> >  startup script. However, just using sage -notebook won't work. I need
> >  to pass the address option on the command line.
>
> >  sage -notebook address="$(cat /etc/hostname)"
>
> >  ain't workin. I keep running into OSError, permission denied, etc.
>
> >  Neither is
>
> >  sage -notebook address=chiasson.name
>
> >  Any ideas?
>
> >  In general, how can arbitrary commands be passed to sage from the
> >  command line? I'm not talking about communicating with an already
> >  running sage process, just passing commands to execute at startup.
>
> >  Thank you for your time.
--~--~---------~--~----~------------~-------~--~----~
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-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to