Ubuntu 9.10 : lancer Redmine automatiquement

Dans l’article Installer Redmine sur Ubuntu 9.10 nous sommes resté à un Redmine lancé via son propre serveur Web sur le port 3000. Voyons maintenant comment automatiser le lancement de Redmine.

Lancer Redmine automatiquement

\# On installe Mongrel
sudo apt-get install mongrel

# On créer le script d'init
sudo vim /etc/init.d/redmine

#!/bin/sh

set -e

REDMINE\_PATH=/var/www/redmine/redmine-0.8.6/
REDMINE\_PID=/tmp/mongrel.pid
REDMINE\_PORT=3000

if \[ -x /usr/bin/mongrel\_rails \] ; then
        HAVE\_MONGREL=1
else
        echo "Mongrel not installed."
        exit 0
fi

. /lib/lsb/init-functions

case "$1" in
  start)
        log\_action\_begin\_msg "Starting Redmine server"
        mongrel\_rails start -c $REDMINE\_PATH -d -e production -p $REDMINE\_PORT -P $REDMINE\_PID
        log\_action\_end\_msg $?
        ;;
  stop)
        log\_action\_begin\_msg "Stopping Redmine server"
        mongrel\_rails stop -c $REDMINE\_PATH -P $REDMINE\_PID
        log\_action\_end\_msg $?
        ;;
  force-reload|restart)
        $0 stop
        $0 start
        ;;
  \*)
        echo "Usage: /etc/init.d/redmine {start|stop|restart|force-reload}"
        exit 1
        ;;
esac

exit 0

sudo chmod +x /etc/init.d/redmine
sudo update-rc.d redmine defaults

```Redmine demarre maintenant de manière automatique. On lance le serveur manuellement avec la commande :```
sudo /etc/init.d/redmine start

```Pour aller plus loin : [Redmine sur Ubuntu, accès via Apache](http://chezwanders.info/index.php/2010/04/29/redmine-sur-ubuntu-acces-via-apache/)
updatedupdated2024-06-012024-06-01