提交 261baf17 编写于 作者: V vagrant 提交者: StephanEwen

Created Debian Package for Ozone install

(Pull request by Christian Richter)
上级 bc09753a
......@@ -112,6 +112,148 @@
</descriptors>
</configuration>
</plugin>
<plugin>
<artifactId>jdeb</artifactId>
<groupId>org.vafer</groupId>
<version>1.0.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jdeb</goal>
</goals>
<configuration>
<deb>${project.build.directory}/${project.artifactId}_${project.version}.deb</deb>
<controlDir>${basedir}/src/deb/control</controlDir>
<dataSet>
<data>
<src>${basedir}/src/deb/bin/nephele-jobmanager</src>
<type>file</type>
<mapper>
<type>perm</type>
<prefix>/etc/init.d</prefix>
<user>root</user>
<group>root</group>
<filemode>0755</filemode>
</mapper>
</data>
<data>
<src>${basedir}/src/deb/bin/nephele-taskmanager</src>
<type>file</type>
<mapper>
<type>perm</type>
<prefix>/etc/init.d</prefix>
<user>root</user>
<group>root</group>
<filemode>0755</filemode>
</mapper>
</data>
<data>
<src>${basedir}/src/deb/bin/pact-webfrontend</src>
<type>file</type>
<mapper>
<type>perm</type>
<prefix>/etc/init.d</prefix>
<user>root</user>
<group>root</group>
<filemode>0755</filemode>
</mapper>
</data>
<data>
<src>${project.build.directory}/${project.artifactId}-${project.version}-bin/stratosphere-${project.version}/bin</src>
<type>directory</type>
<mapper>
<type>perm</type>
<prefix>/usr/share/${project.artifactId}/bin</prefix>
<user>root</user>
<group>root</group>
<filemode>0755</filemode>
</mapper>
</data>
<data>
<src>${project.build.directory}/${project.artifactId}-${project.version}-bin/stratosphere-${project.version}/docs</src>
<type>directory</type>
<mapper>
<type>perm</type>
<prefix>/usr/share/${project.artifactId}/docs</prefix>
<user>root</user>
<group>root</group>
</mapper>
</data>
<data>
<src>${project.build.directory}/${project.artifactId}-${project.version}-bin/stratosphere-${project.version}/examples</src>
<type>directory</type>
<mapper>
<type>perm</type>
<prefix>/usr/share/${project.artifactId}/examples</prefix>
<user>root</user>
<group>root</group>
</mapper>
</data>
<data>
<src>${project.build.directory}/${project.artifactId}-${project.version}-bin/stratosphere-${project.version}/lib</src>
<type>directory</type>
<mapper>
<type>perm</type>
<prefix>/usr/share/${project.artifactId}/lib</prefix>
<user>root</user>
<group>root</group>
</mapper>
</data>
<data>
<src>${project.build.directory}/${project.artifactId}-${project.version}-bin/stratosphere-${project.version}/lib_clients</src>
<type>directory</type>
<mapper>
<type>perm</type>
<prefix>/usr/share/${project.artifactId}/lib_clients</prefix>
<user>root</user>
<group>root</group>
</mapper>
</data>
<data>
<src>${project.build.directory}/${project.artifactId}-${project.version}-bin/stratosphere-${project.version}/resources</src>
<type>directory</type>
<mapper>
<type>perm</type>
<prefix>/usr/share/${project.artifactId}/resources</prefix>
<user>root</user>
<group>root</group>
</mapper>
</data>
<data>
<src>${project.build.directory}/${project.artifactId}-${project.version}-bin/stratosphere-${project.version}/conf</src>
<type>directory</type>
<mapper>
<type>perm</type>
<prefix>/etc/${project.artifactId}/conf</prefix>
<user>root</user>
<group>root</group>
</mapper>
</data>
<data>
<type>template</type>
<paths>
<path>/var/log/${project.artifactId}</path>
</paths>
</data>
<data>
<type>link</type>
<linkName>/usr/share/${project.artifactId}/conf</linkName>
<linkTarget>/etc/${project.artifactId}/conf</linkTarget>
<symlink>true</symlink>
</data>
<data>
<type>link</type>
<linkName>/usr/share/${project.artifactId}/log</linkName>
<linkTarget>/var/log/${project.artifactId}</linkTarget>
<symlink>true</symlink>
</data>
</dataSet>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
#! /bin/sh
#
# skeleton example file to build /etc/init.d/ scripts.
# This file should be used to construct scripts for /etc/init.d.
#
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
# Modified for Debian
# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
# Further changes by Javier Fernandez-Sanguino <jfs@debian.org>
#
# Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl
#
# Starts a Nephele tasktracker
#
# chkconfig: 2345 85 15
# description: Nephele jobmanager
#
### BEGIN INIT INFO
# Provides: nephele-jobmanager
# Required-Start: $network $local_fs
# Required-Stop:
# Should-Start: $named
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Nephele jobmanager daemon
### END INIT INFO
# Include hadoop defaults if available
if [ -f /etc/default/nephele ] ; then
. /etc/default/nephele
fi
if [ "$NEPHELE_PID_DIR" = "" ]; then
NEPHELE_PID_DIR=/tmp
fi
if [ "$NEPHELE_IDENT_STRING" = "" ]; then
NEPHELE_IDENT_STRING="$USER"
fi
NEPHELE_HOME=/usr/share/stratosphere-dist
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON_SCRIPT=$NEPHELE_HOME/bin/nephele-jobmanager.sh
NAME=nephele-jobmanager
DESC="Nephele jobmanager daemon"
PID_FILE=$NEPHELE_PID_DIR/nephele-$NEPHELE_IDENT_STRING-jobmanager.pid
test -x $DAEMON_SCRIPT || exit 1
DODTIME=5 # Time to wait for the server to die, in seconds
# If this value is set too low you might not
# let some servers to die gracefully and
# 'restart' will not work
# Checks if the given pid represents a live process.
# Returns 0 if the pid is a live process, 1 otherwise
nephele_is_process_alive() {
local pid="$1"
ps -fp $pid | grep $pid | grep jobmanager > /dev/null 2>&1
}
# Check if the process associated to a pidfile is running.
# Return 0 if the pidfile exists and the process is running, 1 otherwise
nephele_check_pidfile() {
local pidfile="$1" # IN
local pid
pid=`cat "$pidfile" 2>/dev/null`
if [ "$pid" = '' ]; then
# The file probably does not exist or is empty.
return 1
fi
set -- $pid
pid="$1"
nephele_is_process_alive $pid
}
nephele_process_kill() {
local pid="$1" # IN
local signal="$2" # IN
local second
kill -$signal $pid 2>/dev/null
# Wait a bit to see if the dirty job has really been done
for second in 0 1 2 3 4 5 6 7 8 9 10; do
if nephele_is_process_alive "$pid"; then
# Success
return 0
fi
sleep 1
done
# Timeout
return 1
}
# Kill the process associated to a pidfile
nephele_stop_pidfile() {
local pidfile="$1" # IN
local pid
pid=`cat "$pidfile" 2>/dev/null`
if [ "$pid" = '' ]; then
# The file probably does not exist or is empty. Success
return 0
fi
set -- $pid
pid="$1"
# First try the easy way
if nephele_process_kill "$pid" 15; then
return 0
fi
# Otherwise try the hard way
if nephele_process_kill "$pid" 9; then
return 0
fi
return 1
}
start() {
$NEPHELE_HOME/bin/nephele-jobmanager.sh start cluster
}
stop() {
$NEPHELE_HOME/bin/nephele-jobmanager.sh stop
}
check_for_root() {
if [ $(id -ur) -ne 0 ]; then
echo 'Error: root user required'
echo
exit 1
fi
}
nephele_service() {
case "$1" in
start)
check_for_root
echo -n "Starting $DESC: "
start
if nephele_check_pidfile $PID_FILE ; then
echo "$NAME."
else
echo "ERROR. Could not start $DESC"
exit 1
fi
;;
stop)
check_for_root
echo -n "Stopping $DESC: "
stop
[ -n "$DODTIME" ] && sleep $DODTIME
if nephele_check_pidfile $PID_FILE ; then
echo "ERROR. Could not stop $DESC"
exit 1
else
echo "$NAME."
fi
;;
force-stop)
check_for_root
echo -n "Forcefully stopping $DESC: "
nephele_stop_pidfile $PID_FILE
[ -n "$DODTIME" ] && sleep $DODTIME
if ! nephele_check_pidfile $PID_FILE ; then
echo "$NAME."
else
echo "ERROR. Could not force stop $DESC"
exit 1
fi
;;
force-reload)
check_for_root
echo -n "Forcefully reloading $DESC: "
nephele_check_pidfile $PID_FILE && $0 restart
;;
restart)
check_for_root
echo -n "Restarting $DESC: "
stop
[ -n "$DODTIME" ] && sleep $DODTIME
$0 start
;;
status)
echo -n "$NAME is "
if nephele_check_pidfile $PID_FILE ; then
echo "running"
else
echo "not running."
exit 1
fi
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload|status|force-stop}" >&2
exit 1
;;
esac
}
nephele_service "$1"
exit 0
#! /bin/sh
#
# skeleton example file to build /etc/init.d/ scripts.
# This file should be used to construct scripts for /etc/init.d.
#
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
# Modified for Debian
# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
# Further changes by Javier Fernandez-Sanguino <jfs@debian.org>
#
# Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl
#
# Starts a Nephele tasktracker
#
# chkconfig: 2345 85 15
# description: Nephele taskmanager
#
### BEGIN INIT INFO
# Provides: nephele-taskmanager
# Required-Start: $network $local_fs
# Required-Stop:
# Should-Start: $named
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Nephele taskmanager daemon
### END INIT INFO
# Include hadoop defaults if available
if [ -f /etc/default/nephele ] ; then
. /etc/default/nephele
fi
if [ "$NEPHELE_PID_DIR" = "" ]; then
NEPHELE_PID_DIR=/tmp
fi
if [ "$NEPHELE_IDENT_STRING" = "" ]; then
NEPHELE_IDENT_STRING="$USER"
fi
NEPHELE_HOME=/usr/share/stratosphere-dist
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON_SCRIPT=$NEPHELE_HOME/bin/nephele-taskmanager.sh
NAME=nephele-taskmanager
DESC="Nephele taskmanager daemon"
PID_FILE=$NEPHELE_PID_DIR/nephele-$NEPHELE_IDENT_STRING-taskmanager.pid
test -x $DAEMON_SCRIPT || exit 1
DODTIME=5 # Time to wait for the server to die, in seconds
# If this value is set too low you might not
# let some servers to die gracefully and
# 'restart' will not work
# Checks if the given pid represents a live process.
# Returns 0 if the pid is a live process, 1 otherwise
nephele_is_process_alive() {
local pid="$1"
ps -fp $pid | grep $pid | grep taskmanager > /dev/null 2>&1
}
# Check if the process associated to a pidfile is running.
# Return 0 if the pidfile exists and the process is running, 1 otherwise
nephele_check_pidfile() {
local pidfile="$1" # IN
local pid
pid=`cat "$pidfile" 2>/dev/null`
if [ "$pid" = '' ]; then
# The file probably does not exist or is empty.
return 1
fi
set -- $pid
pid="$1"
nephele_is_process_alive $pid
}
nephele_process_kill() {
local pid="$1" # IN
local signal="$2" # IN
local second
kill -$signal $pid 2>/dev/null
# Wait a bit to see if the dirty job has really been done
for second in 0 1 2 3 4 5 6 7 8 9 10; do
if nephele_is_process_alive "$pid"; then
# Success
return 0
fi
sleep 1
done
# Timeout
return 1
}
# Kill the process associated to a pidfile
nephele_stop_pidfile() {
local pidfile="$1" # IN
local pid
pid=`cat "$pidfile" 2>/dev/null`
if [ "$pid" = '' ]; then
# The file probably does not exist or is empty. Success
return 0
fi
set -- $pid
pid="$1"
# First try the easy way
if nephele_process_kill "$pid" 15; then
return 0
fi
# Otherwise try the hard way
if nephele_process_kill "$pid" 9; then
return 0
fi
return 1
}
start() {
$NEPHELE_HOME/bin/nephele-taskmanager.sh start
}
stop() {
$NEPHELE_HOME/bin/nephele-taskmanager.sh stop
}
check_for_root() {
if [ $(id -ur) -ne 0 ]; then
echo 'Error: root user required'
echo
exit 1
fi
}
nephele_service() {
case "$1" in
start)
check_for_root
echo -n "Starting $DESC: "
start
if nephele_check_pidfile $PID_FILE ; then
echo "$NAME."
else
echo "ERROR. Could not start $DESC"
exit 1
fi
;;
stop)
check_for_root
echo -n "Stopping $DESC: "
stop
[ -n "$DODTIME" ] && sleep $DODTIME
if nephele_check_pidfile $PID_FILE ; then
echo "ERROR. Could not stop $DESC"
exit 1
else
echo "$NAME."
fi
;;
force-stop)
check_for_root
echo -n "Forcefully stopping $DESC: "
nephele_stop_pidfile $PID_FILE
[ -n "$DODTIME" ] && sleep $DODTIME
if ! nephele_check_pidfile $PID_FILE ; then
echo "$NAME."
else
echo "ERROR. Could not force stop $DESC"
exit 1
fi
;;
force-reload)
check_for_root
echo -n "Forcefully reloading $DESC: "
nephele_check_pidfile $PID_FILE && $0 restart
;;
restart)
check_for_root
echo -n "Restarting $DESC: "
stop
[ -n "$DODTIME" ] && sleep $DODTIME
$0 start
;;
status)
echo -n "$NAME is "
if nephele_check_pidfile $PID_FILE ; then
echo "running"
else
echo "not running."
exit 1
fi
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload|status|force-stop}" >&2
exit 1
;;
esac
}
nephele_service "$1"
exit 0
#! /bin/sh
#
# skeleton example file to build /etc/init.d/ scripts.
# This file should be used to construct scripts for /etc/init.d.
#
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
# Modified for Debian
# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
# Further changes by Javier Fernandez-Sanguino <jfs@debian.org>
#
# Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl
#
# Starts a Nephele tasktracker
#
# chkconfig: 2345 85 15
# description: Pact webfrontend
#
### BEGIN INIT INFO
# Provides: pact-webfrontend
# Required-Start: $network $local_fs
# Required-Stop:
# Should-Start: $named
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Pact webfrontend daemon
### END INIT INFO
# Include hadoop defaults if available
if [ -f /etc/default/nephele ] ; then
. /etc/default/nephele
fi
if [ "$NEPHELE_PID_DIR" = "" ]; then
NEPHELE_PID_DIR=/tmp
fi
if [ "$NEPHELE_IDENT_STRING" = "" ]; then
NEPHELE_IDENT_STRING="$USER"
fi
NEPHELE_HOME=/usr/share/stratosphere-dist
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON_SCRIPT=$NEPHELE_HOME/bin/pact-webfrontend.sh
NAME=pact-webfrontend
DESC="Pact webfrontend daemon"
PID_FILE=$NEPHELE_PID_DIR/nephele-$NEPHELE_IDENT_STRING-pact-web.pid
test -x $DAEMON_SCRIPT || exit 1
DODTIME=5 # Time to wait for the server to die, in seconds
# If this value is set too low you might not
# let some servers to die gracefully and
# 'restart' will not work
# Checks if the given pid represents a live process.
# Returns 0 if the pid is a live process, 1 otherwise
nephele_is_process_alive() {
local pid="$1"
ps -fp $pid | grep $pid | grep pact-web > /dev/null 2>&1
}
# Check if the process associated to a pidfile is running.
# Return 0 if the pidfile exists and the process is running, 1 otherwise
nephele_check_pidfile() {
local pidfile="$1" # IN
local pid
pid=`cat "$pidfile" 2>/dev/null`
if [ "$pid" = '' ]; then
# The file probably does not exist or is empty.
return 1
fi
set -- $pid
pid="$1"
nephele_is_process_alive $pid
}
nephele_process_kill() {
local pid="$1" # IN
local signal="$2" # IN
local second
kill -$signal $pid 2>/dev/null
# Wait a bit to see if the dirty job has really been done
for second in 0 1 2 3 4 5 6 7 8 9 10; do
if nephele_is_process_alive "$pid"; then
# Success
return 0
fi
sleep 1
done
# Timeout
return 1
}
# Kill the process associated to a pidfile
nephele_stop_pidfile() {
local pidfile="$1" # IN
local pid
pid=`cat "$pidfile" 2>/dev/null`
if [ "$pid" = '' ]; then
# The file probably does not exist or is empty. Success
return 0
fi
set -- $pid
pid="$1"
# First try the easy way
if nephele_process_kill "$pid" 15; then
return 0
fi
# Otherwise try the hard way
if nephele_process_kill "$pid" 9; then
return 0
fi
return 1
}
start() {
$NEPHELE_HOME/bin/pact-webfrontend.sh start
}
stop() {
$NEPHELE_HOME/bin/pact-webfrontend.sh stop
}
check_for_root() {
if [ $(id -ur) -ne 0 ]; then
echo 'Error: root user required'
echo
exit 1
fi
}
nephele_service() {
case "$1" in
start)
check_for_root
echo -n "Starting $DESC: "
start
if nephele_check_pidfile $PID_FILE ; then
echo "$NAME."
else
echo "ERROR. Could not start $DESC"
exit 1
fi
;;
stop)
check_for_root
echo -n "Stopping $DESC: "
stop
[ -n "$DODTIME" ] && sleep $DODTIME
if nephele_check_pidfile $PID_FILE ; then
echo "ERROR. Could not stop $DESC"
exit 1
else
echo "$NAME."
fi
;;
force-stop)
check_for_root
echo -n "Forcefully stopping $DESC: "
nephele_stop_pidfile $PID_FILE
[ -n "$DODTIME" ] && sleep $DODTIME
if ! nephele_check_pidfile $PID_FILE ; then
echo "$NAME."
else
echo "ERROR. Could not force stop $DESC"
exit 1
fi
;;
force-reload)
check_for_root
echo -n "Forcefully reloading $DESC: "
nephele_check_pidfile $PID_FILE && $0 restart
;;
restart)
check_for_root
echo -n "Restarting $DESC: "
stop
[ -n "$DODTIME" ] && sleep $DODTIME
$0 start
;;
status)
echo -n "$NAME is "
if nephele_check_pidfile $PID_FILE ; then
echo "running"
else
echo "not running."
exit 1
fi
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload|status|force-stop}" >&2
exit 1
;;
esac
}
nephele_service "$1"
exit 0
Package: [[name]]
Version: 0.2
Section: misc
Depends: java6-runtime
Priority: low
Architecture: all
Description: [[description]]
Maintainer: christian_richter@gmx.de
\ No newline at end of file
#!/bin/sh
# postinst script for importer
set -e
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
configure)
if ! getent group ozone >/dev/null; then
addgroup --system ozone
fi
if ! getent passwd stratosphere >/dev/null; then
adduser --quiet \
--system \
--ingroup ozone \
--quiet \
--disabled-login \
--disabled-password \
--home /usr/share/stratosphere-dist \
--no-create-home \
-gecos "Stratosphere User" \
stratosphere
fi
if [ -z "$2" ]; then
chown -R stratosphere:ozone /var/log/stratosphere-dist
fi
sed -i s'#./resources/web-docs#/usr/share/stratosphere-dist/resources/web-docs#' /usr/share/stratosphere-dist/conf/pact-user.xml
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册