Author: Paul_R
Date: 2008-09-18 10:28:29 +0200 (Thu, 18 Sep 2008)
New Revision: 1894

Added:
   software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/
   
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/
   
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/arch/
   
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/arch/README
   
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/arch/tuxhttpserver
   
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/mandriva/
   
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/mandriva/README
   
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/mandriva/tuxhttpserver
   
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/ubuntu/
   
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/ubuntu/README
   
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/ubuntu/tuxhttpserver
Log:
* Added the examples for the tar.gz versions


Added: 
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/arch/README
===================================================================
--- 
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/arch/README
                            (rev 0)
+++ 
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/arch/README
    2008-09-18 08:28:29 UTC (rev 1894)
@@ -0,0 +1,8 @@
+This is a script example to launch the server at startup with ArchLinux 
+
+Installation :
+   - copy tuxhttpserver to /etc/rc.d
+   - edit /etc/rc.conf and add tuxhttpserver to the DAEMON list
+
+Please refer to your distribution help files for more informations, or visit
+   http://wiki.tuxisalive.com/index.php/How_to_install_on_Linux


Property changes on: 
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/arch/README
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: 
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/arch/tuxhttpserver
===================================================================
--- 
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/arch/tuxhttpserver
                             (rev 0)
+++ 
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/arch/tuxhttpserver
     2008-09-18 08:28:29 UTC (rev 1894)
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
+DESC="HTTP server for Tuxdroid"
+NAME=tuxhttpserver
+DAEMON=/opt/tuxdroid/tuxhttpserver/tuxhttpserver.py
+DAEMON_ARGS=""
+PIDFILE=/var/run/$NAME.pid
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+case "$1" in
+    start)
+       stat_busy "Starting tuxhttpserver"
+       python $DAEMON
+       if [ $? -gt 0 ]; then
+           stat_fail
+       else
+           add_daemon $NAME
+           stat_done
+       fi
+       ;;
+    stop)
+       stat_busy "Stopping tuxhttpserver"
+       if [ -a $PIDFILE ]
+       then
+           PID=`cat $PIDFILE`
+           kill $PID > /dev/null
+           if [ $? -gt 0 ]; then
+               stat_fail
+           else
+               rm $PIDFILE
+               rm_daemon $NAME
+               stat_done
+           fi
+       else
+           stat_done
+       fi
+       ;;
+       restart|force-reload)
+       $0 stop
+       sleep 1
+       $0 start
+       ;;
+esac
+exit 0


Property changes on: 
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/arch/tuxhttpserver
___________________________________________________________________
Name: svn:executable
   + *

Added: 
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/mandriva/README
===================================================================
--- 
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/mandriva/README
                                (rev 0)
+++ 
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/mandriva/README
        2008-09-18 08:28:29 UTC (rev 1894)
@@ -0,0 +1,10 @@
+This is a script example to launch the server at startup with mandriva.
+
+Installation :
+   - copy tuxhttpserver to /etc/init.d
+   - chkconfig --add tuxhttpserver
+
+Most of redhat based distros use the same tools to install an init
+script.
+Please refer to your distribution help files for more informations, or visit
+   http://wiki.tuxisalive.com/index.php/How_to_install_on_Linux


Property changes on: 
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/mandriva/README
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: 
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/mandriva/tuxhttpserver
===================================================================
--- 
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/mandriva/tuxhttpserver
                         (rev 0)
+++ 
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/mandriva/tuxhttpserver
 2008-09-18 08:28:29 UTC (rev 1894)
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+# chkconfig: 345 56 50
+# description: This startup script launches Tuxdroid HTTP Server
+
+### BEGIN INIT INFO
+# Provides: tuxhttpserver
+# Required-Start: 
+# Required-Stop: 
+# Default-Start: 345
+# Short-Description: Tuxdroid HTTP Server
+# Description: This startup script launches Tuxdroid HTTP Server
+### END INIT INFO
+
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
+DESC="HTTP server for Tuxdroid"
+NAME=tuxhttpserver
+PROCESS=$NAME
+DAEMON="python /opt/tuxdroid/tuxhttpserver/tuxhttpserver.py"
+DAEMON_ARGS=""
+PIDFILE=/var/run/$NAME.pid
+
+# Source function library.
+. /etc/init.d/functions
+
+case "$1" in
+  start)
+         if [ -f $PIDFILE ] ; then
+                 gprintf "$NAME is already started\n"
+      exit 3
+    fi
+         gprintf "Starting %s" "$NAME"
+         daemon $DAEMON
+         echo
+         ;;
+
+  stop)
+         if ! [ -f $PIDFILE ] ; then
+                 gprintf "$NAME is already stopped\n"
+      exit 3
+    fi
+         gprintf "Stopping %s" "$NAME"
+    killproc -p $PIDFILE $PROCESS
+    echo
+         exit 3
+         ;;
+
+       restart|force-reload)
+         $0 stop
+       sleep 1
+         $0 start
+         ;;
+esac
+exit 0

Added: 
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/ubuntu/README
===================================================================
--- 
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/ubuntu/README
                          (rev 0)
+++ 
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/ubuntu/README
  2008-09-18 08:28:29 UTC (rev 1894)
@@ -0,0 +1,10 @@
+This is a script example to launch the server at startup with ubuntu.
+
+Installation :
+   - copy tuxhttpserver to /etc/init.d
+   - update-rc.d tuxhttpserver defaults
+
+Most of debian /or Ubuntu based distros use the same tools to install an init
+script.
+Please refer to your distribution help files for more informations, or visit
+   http://wiki.tuxisalive.com/index.php/How_to_install_on_Linux


Property changes on: 
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/ubuntu/README
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: 
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/ubuntu/tuxhttpserver
===================================================================
--- 
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/ubuntu/tuxhttpserver
                           (rev 0)
+++ 
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/ubuntu/tuxhttpserver
   2008-09-18 08:28:29 UTC (rev 1894)
@@ -0,0 +1,152 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:          tuxhttpserver
+# Required-Start:    $local_fs $remote_fs
+# Required-Stop:     $local_fs $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      S 0 1 6
+# Short-Description: Start stop Tuxdroid HTTP REST server.
+# Description:       Start stop Tuxdroid HTTP REST server.
+### END INIT INFO
+
+# Author: Remi Jocaille <[EMAIL PROTECTED]>
+
+# Do NOT "set -e"
+
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
+DESC="HTTP server for Tuxdroid"
+NAME=tuxhttpserver
+DAEMON=/usr/bin/$NAME
+DAEMON_ARGS=""
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# Load the VERBOSE setting and other rcS variables
+[ -f /etc/default/rcS ] && . /etc/default/rcS
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
+. /lib/lsb/init-functions
+
+#
+# Function that starts the daemon/service
+#
+do_start()
+{
+       # Return
+       #   0 if daemon has been started
+       #   1 if daemon was already running
+       #   2 if daemon could not be started
+       start-stop-daemon --start --quiet --background --pidfile $PIDFILE 
--exec $DAEMON --test > /dev/null \
+               || return 1
+       start-stop-daemon --start --quiet --background --make-pidfile --pidfile 
$PIDFILE --exec $DAEMON -- \
+               $DAEMON_ARGS \
+               || return 2
+       # Add code here, if necessary, that waits for the process to be ready
+       # to handle requests from services started subsequently which depend
+       # on this one.  As a last resort, sleep for some time.
+}
+
+#
+# Function that stops the daemon/service
+#
+do_stop()
+{
+       # Return
+       #   0 if daemon has been stopped
+       #   1 if daemon was already stopped
+       #   2 if daemon could not be stopped
+       #   other if a failure occurred
+       start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile 
$PIDFILE > /dev/null #--name $NAME
+       RETVAL="$?"
+       [ "$RETVAL" = 2 ] && return 2
+       # Wait for children to finish too if this is a daemon that forks
+       # and if the daemon is only ever run from this initscript.
+       # If the above conditions are not satisfied then add some other code
+       # that waits for the process to drop all resources that could be
+       # needed by services started subsequently.  A last resort is to
+       # sleep for some time.
+       start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec 
$DAEMON
+       [ "$?" = 2 ] && return 2
+       # Many daemons don't delete their pidfiles when they exit.
+       rm -f $PIDFILE
+       return "$RETVAL"
+}
+
+#
+# Function that sends a SIGHUP to the daemon/service
+#
+do_reload() {
+       #
+       # If the daemon can reload its configuration without
+       # restarting (for example, when it is sent a SIGHUP),
+       # then implement that here.
+       #
+       start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name 
$NAME
+       return 0
+}
+
+case "$1" in
+  start)
+       test -f $PIDFILE && exit 0
+       log_daemon_msg "Starting $DESC" "$NAME"
+       do_start
+       case "$?" in
+               0|1) log_end_msg 0 ;;
+               2) log_end_msg 1 ;;
+       esac
+       ;;
+  stop)
+       test -f $PIDFILE || exit 0
+       log_daemon_msg "Stopping $DESC" "$NAME"
+       do_stop
+       case "$?" in
+               0|1) log_end_msg 0 ;;
+               2) log_end_msg 1 ;;
+       esac
+       ;;
+  #reload|force-reload)
+       #
+       # If do_reload() is not implemented then leave this commented out
+       # and leave 'force-reload' as an alias for 'restart'.
+       #
+       #log_daemon_msg "Reloading $DESC" "$NAME"
+       #do_reload
+       #log_end_msg $?
+       #;;
+  restart|force-reload)
+       #
+       # If the "reload" option is implemented then remove the
+       # 'force-reload' alias
+       #
+       log_daemon_msg "Restarting $DESC" "$NAME"
+       do_stop
+       case "$?" in
+         0|1)
+               do_start
+               case "$?" in
+                       0) log_end_msg 0 ;;
+                       1) log_end_msg 1 ;; # Old process is still running
+                       *) log_end_msg 1 ;; # Failed to start
+               esac
+               ;;
+         *)
+               # Failed to stop
+               log_end_msg 1
+               ;;
+       esac
+       ;;
+  *)
+       #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
+       echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
+       exit 3
+       ;;
+esac
+
+:


Property changes on: 
software_suite_v2/tuxware/installers/unix/trunk/build_deps/tar/examples/init_scripts/ubuntu/tuxhttpserver
___________________________________________________________________
Name: svn:executable
   + *


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to