Startup script for Typo

Posted by Paul Verreth Mon, 26 Mar 2007 06:30:00 GMT

This is an init script you can use so that typo will be started after an system reboot. Using chkconfig, it wil be activated in the runlevel system (/etc/rc[0-6].d)

Also see: Installing typo with the installer

#!/bin/bash
#
#       /etc/rc.d/init.d/typo_sos
#
# Start typo blogging engine
#
# chkconfig: - 65 35
# description: Typo blogging engine
# processname: typo
# Source function library.
. /etc/init.d/functions

TYPO=/usr/bin/typo
TYPODIR=/var/www/your-website-directory/blog

test -x $TYPO || exit 0

RETVAL=0
prog="Typo blogging engine" 

start() {
        echo -n $"Starting $prog: " 
        cd $TYPODIR
        $TYPO start $TYPODIR
        RETVAL=$?
        echo
}

stop() {
        echo -n $"Stopping $prog: " 
        cd $TYPODIR
        $TYPO stop $TYPODIR
        RETVAL=$?
        echo
}

#
#       See how we were called.
#
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        stop
        start
        RETVAL=$?
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart}" 
        exit 1
esac

exit $RETVAL
Read more...

Posted in  | Tags , ,

Startup script for Radiant with Mongrel

Posted by Paul Verreth Mon, 26 Mar 2007 05:54:00 GMT

Mongrel is IMHO the preferred (web)server for Ruby on Rails applications hence for Radiant.

Here you can find a startup script for Fedora linux, but of course also usable for Ubuntu, ...

#!/bin/bash
#
#    /etc/rc.d/init.d/radiant_cms
#
# Start mongrel & radiant
#
# chkconfig: - 65 35
# description: Mongrel & radiant
# processname: mongrel
# Source function library.
. /etc/init.d/functions

MONGREL=/usr/bin/mongrel_rails
RAILSDIR=/var/www/radiant
CONFFILE=mongrel_config

test -x $MONGREL || exit 0

RETVAL=0
prog="Mongrel for radiant" 

start() {
        echo -n $"Starting $prog: " 
    cd $RAILSDIR
    $MONGREL start -C $CONFFILE
    RETVAL=$?
    echo
}

stop() {
    echo -n $"Stopping $prog: " 
    cd $RAILSDIR
    $MONGREL stop
    RETVAL=$?
    echo
}

#
#    See how we were called.
#
case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  restart)
    stop
    start
    RETVAL=$?
    ;;
  *)
    echo $"Usage: $0 {start|stop|restart}" 
    exit 1
esac

exit $RETVAL
Read more...

Posted in ,  | Tags ,