Skip to Content.
Sympa Menu

perfsonar-dev - [pS-dev] [GEANT/SA2/SA2T3-OPPD] r867 - in trunk: perfsonar-oppd/build/debian/scripts perfsonar-oppd-mp-bwctl/build/debian/scripts

Subject: perfsonar development work

List archive

[pS-dev] [GEANT/SA2/SA2T3-OPPD] r867 - in trunk: perfsonar-oppd/build/debian/scripts perfsonar-oppd-mp-bwctl/build/debian/scripts


Chronological Thread 
  • From:
  • To:
  • Subject: [pS-dev] [GEANT/SA2/SA2T3-OPPD] r867 - in trunk: perfsonar-oppd/build/debian/scripts perfsonar-oppd-mp-bwctl/build/debian/scripts
  • Date: Wed, 12 Mar 2014 23:45:57 +0000 (GMT)

Author: dfn.calim
Date: 2014-03-12 23:45:57 +0000 (Wed, 12 Mar 2014)
New Revision: 867

Added:
trunk/perfsonar-oppd-mp-bwctl/build/debian/scripts/postinst
trunk/perfsonar-oppd-mp-bwctl/build/debian/scripts/prerm
trunk/perfsonar-oppd/build/debian/scripts/init.d
trunk/perfsonar-oppd/build/debian/scripts/postinst
Removed:
trunk/perfsonar-oppd-mp-bwctl/build/debian/scripts/init.d
Modified:
trunk/perfsonar-oppd/build/debian/scripts/postrm
Log:
all debian 7 packaged for bwctl mp will be installed without any error

Copied: trunk/perfsonar-oppd/build/debian/scripts/init.d (from rev 861,
trunk/perfsonar-oppd-mp-bwctl/build/debian/scripts/init.d)
===================================================================
--- trunk/perfsonar-oppd/build/debian/scripts/init.d
(rev 0)
+++ trunk/perfsonar-oppd/build/debian/scripts/init.d 2014-03-12 23:45:57
UTC (rev 867)
@@ -0,0 +1,185 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: perfsonar-oppd
+# Required-Start: $remote_fs $network $local_fs
+# Required-Stop: $remote_fs $network $local_fs
+# Should-Start: $named
+# Should-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: oppd (Open Perl PerfSONAR Daemon)
+# Description: oppd (Open Perl PerfSONAR Daemon)
+### END INIT INFO
+
+# Author: WiN-Labor
<>
+
+PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
+export PATH
+
+
+NAME=oppd
+# For start-stop-daemon's --name
+SNAME=oppd.pl
+DAEMON=/usr/bin/oppd.pl
+DESC="Open Perl PerfSONAR Daemon"
+
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Default options, these can be overriden by the information
+# at /etc/default/$NAME
+DAEMON_ARGS=""
+DIETIME=30
+#STARTTIME=2
+LOGFILE=""
+CONFFILE=/etc/oppd.conf
+DAEMONUSER=perfsonar
+DAEMONGROUP=perfsonar
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# Load the VERBOSE setting and other rcS variables
+. /lib/init/vars.sh
+
+. /lib/lsb/init-functions
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+# Check that the user exists (if we set a user)
+# Does the user exist?
+if [ -n "$DAEMONUSER" ] ; then
+ if getent passwd | grep -q "^$DAEMONUSER:"; then
+ # Obtain the uid and gid
+ DAEMONUID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $3}'`
+ DAEMONGID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $4}'`
+ else
+ log_failure_msg "The user $DAEMONUSER, required to run $NAME does not
exist."
+ exit 1
+ fi
+fi
+
+#
+# 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
+ touch "$PIDFILE"
+ chown $DAEMONUSER:$DAEMONGROUP "$PIDFILE"
+ if [ -n "$LOGFILE" ]
+ then
+ touch $LOGFILE
+ chown $DAEMONUSER:$DAEMONUSER $LOGFILE
+ DAEMON_ARGS="$DAEMON_ARGS --logfile=$LOGFILE"
+ fi
+
+ start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test
> /dev/null \
+ || return 1
+ if [ -z "$DAEMONUSER" ] ; then
+ start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
+ --config="$CONFFILE" --pidfile="$PIDFILE" $DAEMON_ARGS \
+ || return 2
+ else
+ # if we are using a daemonuser then change the user id
+ start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
+ --chuid $DAEMONUSER -- \
+ --config="$CONFFILE" --pidfile="$PIDFILE" $DAEMON_ARGS \
+ || return 2
+ fi
+ [ -n "$STARTTIME" ] && sleep $STARTTIME # Wait some time
+ pidofproc -p $PIDFILE > /dev/null || return 2
+}
+
+#
+# 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/$DIETIME/KILL/5 --pidfile
$PIDFILE --name $SNAME
+ RETVAL="$?"
+ [ "$RETVAL" = 2 ] && return 2
+ # oppd takes care about its children. Nevertheless take care about them
here!
+ # Important: The following command will kill more or less all running oppd.
+ #TODO Is this working at all? Or is start-stop-daemon only seeing
+ # /usr/bin/perl ?
+ start-stop-daemon --stop --quiet --oknodo --retry=0/$DIETIME/KILL/5 --exec
$DAEMON
+ [ "$?" = 2 ] && return 2
+ # oppd should delete its pid file, but perhaps it doesn't have the right
+ # to do it!!
+ rm -f $PIDFILE
+ return "$RETVAL"
+}
+
+#
+# Function that sends a SIGHUP to the daemon/service
+#
+do_reload() {
+ start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name
$SNAME
+ return 0
+}
+
+case "$1" in
+ start)
+ [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
+ do_start
+ case "$?" in
+ 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+ 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+ esac
+ ;;
+ stop)
+ [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+ do_stop
+ case "$?" in
+ 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+ 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+ esac
+ ;;
+ #reload|force-reload)
+ #
+ # do_reload() is available above, but not implemented by oppd yet. So 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)
+ [ "$VERBOSE" != no ] && log_daemon_msg "Restarting $DESC" "$NAME"
+ do_stop
+ case "$?" in
+ 0|1)
+ do_start
+ case "$?" in
+ 0) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+ 1) [ "$VERBOSE" != no ] && log_end_msg 1 ;; # Old process is still
running
+ *) [ "$VERBOSE" != no ] && log_end_msg 1 ;; # Failed to start
+ esac
+ ;;
+ *)
+ # Failed to stop
+ log_end_msg 1
+ ;;
+ esac
+ ;;
+ status)
+ status_of_proc -p $PIDFILE "" $NAME
+ ;;
+ *)
+ #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}"
>&2
+ echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2
+ exit 3
+ ;;
+esac
+
+:

Added: trunk/perfsonar-oppd/build/debian/scripts/postinst
===================================================================
--- trunk/perfsonar-oppd/build/debian/scripts/postinst
(rev 0)
+++ trunk/perfsonar-oppd/build/debian/scripts/postinst 2014-03-12 23:45:57
UTC (rev 867)
@@ -0,0 +1,8 @@
+#!/bin/sh
+set -e
+# Automatically added by dh_installinit
+if [ -x "/etc/init.d/perfsonar-oppd" ]; then
+ mv /etc/init.d/perfsonar-oppd /etc/init.d/oppd
+ update-rc.d oppd defaults >/dev/null
+fi
+# End automatically added section


Property changes on: trunk/perfsonar-oppd/build/debian/scripts/postinst
___________________________________________________________________
Added: svn:executable
+ *

Modified: trunk/perfsonar-oppd/build/debian/scripts/postrm
===================================================================
--- trunk/perfsonar-oppd/build/debian/scripts/postrm 2014-03-12 22:16:00
UTC (rev 866)
+++ trunk/perfsonar-oppd/build/debian/scripts/postrm 2014-03-12 23:45:57
UTC (rev 867)
@@ -21,13 +21,19 @@
case "$1" in
remove|disappear)
rm /var/log/oppd.log
- /usr/sbin/userdel perfsonar
+ rm /etc/init.d/oppd
#/usr/sbin/groupdel perfsonar
;;

- purge|abort-install)
+ purge)
+ /usr/sbin/userdel perfsonar
+ update-rc.d oppd remove >/dev/null
;;

+
+ abort-install)
+ ;;
+
upgrade)
;;


Deleted: trunk/perfsonar-oppd-mp-bwctl/build/debian/scripts/init.d
===================================================================
--- trunk/perfsonar-oppd-mp-bwctl/build/debian/scripts/init.d 2014-03-12
22:16:00 UTC (rev 866)
+++ trunk/perfsonar-oppd-mp-bwctl/build/debian/scripts/init.d 2014-03-12
23:45:57 UTC (rev 867)
@@ -1,185 +0,0 @@
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides: perfsonar-oppd
-# Required-Start: $remote_fs $network $local_fs
-# Required-Stop: $remote_fs $network $local_fs
-# Should-Start: $named
-# Should-Stop:
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: oppd (Open Perl PerfSONAR Daemon)
-# Description: oppd (Open Perl PerfSONAR Daemon)
-### END INIT INFO
-
-# Author: WiN-Labor
<>
-
-PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
-export PATH
-
-
-NAME=oppd
-# For start-stop-daemon's --name
-SNAME=oppd.pl
-DAEMON=/usr/bin/oppd.pl
-DESC="Open Perl PerfSONAR Daemon"
-
-PIDFILE=/var/run/$NAME.pid
-SCRIPTNAME=/etc/init.d/$NAME
-
-# Default options, these can be overriden by the information
-# at /etc/default/$NAME
-DAEMON_ARGS=""
-DIETIME=30
-#STARTTIME=2
-LOGFILE=""
-CONFFILE=/etc/oppd.conf
-DAEMONUSER=perfsonar
-DAEMONGROUP=perfsonar
-
-# Read configuration variable file if it is present
-[ -r /etc/default/$NAME ] && . /etc/default/$NAME
-
-# Load the VERBOSE setting and other rcS variables
-. /lib/init/vars.sh
-
-. /lib/lsb/init-functions
-
-# Exit if the package is not installed
-[ -x "$DAEMON" ] || exit 0
-
-# Check that the user exists (if we set a user)
-# Does the user exist?
-if [ -n "$DAEMONUSER" ] ; then
- if getent passwd | grep -q "^$DAEMONUSER:"; then
- # Obtain the uid and gid
- DAEMONUID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $3}'`
- DAEMONGID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $4}'`
- else
- log_failure_msg "The user $DAEMONUSER, required to run $NAME does not
exist."
- exit 1
- fi
-fi
-
-#
-# 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
- touch "$PIDFILE"
- chown $DAEMONUSER:$DAEMONGROUP "$PIDFILE"
- if [ -n "$LOGFILE" ]
- then
- touch $LOGFILE
- chown $DAEMONUSER:$DAEMONUSER $LOGFILE
- DAEMON_ARGS="$DAEMON_ARGS --logfile=$LOGFILE"
- fi
-
- start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test
> /dev/null \
- || return 1
- if [ -z "$DAEMONUSER" ] ; then
- start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
- --config="$CONFFILE" --pidfile="$PIDFILE" $DAEMON_ARGS \
- || return 2
- else
- # if we are using a daemonuser then change the user id
- start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
- --chuid $DAEMONUSER -- \
- --config="$CONFFILE" --pidfile="$PIDFILE" $DAEMON_ARGS \
- || return 2
- fi
- [ -n "$STARTTIME" ] && sleep $STARTTIME # Wait some time
- pidofproc -p $PIDFILE > /dev/null || return 2
-}
-
-#
-# 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/$DIETIME/KILL/5 --pidfile
$PIDFILE --name $SNAME
- RETVAL="$?"
- [ "$RETVAL" = 2 ] && return 2
- # oppd takes care about its children. Nevertheless take care about them
here!
- # Important: The following command will kill more or less all running oppd.
- #TODO Is this working at all? Or is start-stop-daemon only seeing
- # /usr/bin/perl ?
- start-stop-daemon --stop --quiet --oknodo --retry=0/$DIETIME/KILL/5 --exec
$DAEMON
- [ "$?" = 2 ] && return 2
- # oppd should delete its pid file, but perhaps it doesn't have the right
- # to do it!!
- rm -f $PIDFILE
- return "$RETVAL"
-}
-
-#
-# Function that sends a SIGHUP to the daemon/service
-#
-do_reload() {
- start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name
$SNAME
- return 0
-}
-
-case "$1" in
- start)
- [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
- do_start
- case "$?" in
- 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
- 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
- esac
- ;;
- stop)
- [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
- do_stop
- case "$?" in
- 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
- 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
- esac
- ;;
- #reload|force-reload)
- #
- # do_reload() is available above, but not implemented by oppd yet. So 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)
- [ "$VERBOSE" != no ] && log_daemon_msg "Restarting $DESC" "$NAME"
- do_stop
- case "$?" in
- 0|1)
- do_start
- case "$?" in
- 0) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
- 1) [ "$VERBOSE" != no ] && log_end_msg 1 ;; # Old process is still
running
- *) [ "$VERBOSE" != no ] && log_end_msg 1 ;; # Failed to start
- esac
- ;;
- *)
- # Failed to stop
- log_end_msg 1
- ;;
- esac
- ;;
- status)
- status_of_proc -p $PIDFILE "" $NAME
- ;;
- *)
- #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}"
>&2
- echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2
- exit 3
- ;;
-esac
-
-:

Added: trunk/perfsonar-oppd-mp-bwctl/build/debian/scripts/postinst
===================================================================
--- trunk/perfsonar-oppd-mp-bwctl/build/debian/scripts/postinst
(rev 0)
+++ trunk/perfsonar-oppd-mp-bwctl/build/debian/scripts/postinst 2014-03-12
23:45:57 UTC (rev 867)
@@ -0,0 +1,7 @@
+#!/bin/sh
+set -e
+# Automatically added by dh_installinit
+if [ -x "/etc/init.d/oppd" ]; then
+ invoke-rc.d oppd start || exit $?
+fi
+# End automatically added section


Property changes on:
trunk/perfsonar-oppd-mp-bwctl/build/debian/scripts/postinst
___________________________________________________________________
Added: svn:executable
+ *

Added: trunk/perfsonar-oppd-mp-bwctl/build/debian/scripts/prerm
===================================================================
--- trunk/perfsonar-oppd-mp-bwctl/build/debian/scripts/prerm
(rev 0)
+++ trunk/perfsonar-oppd-mp-bwctl/build/debian/scripts/prerm 2014-03-12
23:45:57 UTC (rev 867)
@@ -0,0 +1,7 @@
+#!/bin/sh
+set -e
+# Automatically added by dh_installinit
+if [ -x "/etc/init.d/oppd" ]; then
+ invoke-rc.d oppd stop || exit $?
+fi
+# End automatically added section


Property changes on: trunk/perfsonar-oppd-mp-bwctl/build/debian/scripts/prerm
___________________________________________________________________
Added: svn:executable
+ *



  • [pS-dev] [GEANT/SA2/SA2T3-OPPD] r867 - in trunk: perfsonar-oppd/build/debian/scripts perfsonar-oppd-mp-bwctl/build/debian/scripts, svn-noreply, 03/12/2014

Archive powered by MHonArc 2.6.16.

Top of Page