#!/sbin/runscript # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ depend() { use net dns logger need postgresql } start() { [ "${SERVER_DB}" ] && SERVER_OPTS="${SERVER_OPTS} --database=${SERVER_DB}" [ "${SERVER_USER}" ] && SERVER_OPTS="${SERVER_OPTS} --db_user=${SERVER_USER}" [ "${SERVER_PW}" ] && SERVER_OPTS="${SERVER_OPTS} --db_password=${SERVER_PW}" [ "${SERVER_HOST}" ] && SERVER_OPTS="${SERVER_OPTS} --db_host=${SERVER_HOST}" [ "${SERVER_PORT}" ] && SERVER_OPTS="${SERVER_OPTS} --db_port=${SERVER_PORT}" ebegin "Starting Tiny ERP Server" /sbin/start-stop-daemon --quiet --start --background --chuid terp:nobody --pidfile=/var/run/tinyerp/server.pid --make-pidfile --exec /usr/bin/tinyerp-server -- ${SERVER_OPTS} eend $? "Failed to start the server" } stop() { ebegin "Stopping Tiny ERP Server" /sbin/start-stop-daemon --quiet --stop --pidfile=/var/run/tinyerp/server.pid eend $? "Failed to stop the server" }