Skip to content

Instantly share code, notes, and snippets.

@terrancesnyder
Created August 4, 2011 19:13
Show Gist options
  • Select an option

  • Save terrancesnyder/1125976 to your computer and use it in GitHub Desktop.

Select an option

Save terrancesnyder/1125976 to your computer and use it in GitHub Desktop.
pentaho
#! /bin/sh
# ==================================================================
# __ __
# ____ ___ ____ / /_____ _/ /_ ____
# / __ \/ _ \/ __ \/ __/ __ `/ __ \/ __ \
# / /_/ / __/ / / / /_/ /_/ / / / / /_/ /
# / .___/\___/_/ /_/\__/\__,_/_/ /_/\____/
# /_/
# Pentaho CARTE startup scripts
# -------------------------
# | Install |
# -------------------------
# - Suse -
# >> chmod +x pentaho
# >> /sbin/insserv -d pentaho
# - Ubuntu -
# >> chmod +x pentaho
# >> sudo ln -s /etc/init.d/pentaho /etc/rc1.d/K99pentaho
# >> sudo ln -s /etc/init.d/pentaho /etc/rc2.d/S99pentaho
#
# -------------------------
# | Remove |
# -------------------------
# - Ubuntu -
# >> rm /etc/rc1.d/K99pentaho
# >> rm /etc/rc2.d/S99pentaho
# - Suse -
# >> /sbin/insserv -r pentaho
# ==================================================================
### BEGIN INIT INFO
# Provides: pentaho
# Required-Start: $network $syslog $remote_fs
# Required-Stop: $network $syslog
# Default-Start:
# Default-Stop:
# Short-Description: Pentaho Carte Server
# Description: Pentaho Carte Server
#
### END INIT INFO
case $1 in
start)
su - pentaho -c "cd /opt/pentaho && ./run.sh"
;;
stop)
ps aux | grep carte | grep -v grep | awk '{print $2}' | xargs kill -9 > /dev/null 2>&1
;;
restart)
ps aux | grep carte | grep -v grep | awk '{print $2}' | xargs kill -9 > /dev/null 2>&1
su - pentaho -c "cd /opt/pentaho && ./run.sh"
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment