Repository: aurora-packaging Updated Branches: refs/heads/master 7dcac0da7 -> 8c9c2f6ad
Fix RPM building. Bugs closed: AURORA-851 Reviewed at https://reviews.apache.org/r/37772/ Project: http://git-wip-us.apache.org/repos/asf/aurora-packaging/repo Commit: http://git-wip-us.apache.org/repos/asf/aurora-packaging/commit/8c9c2f6a Tree: http://git-wip-us.apache.org/repos/asf/aurora-packaging/tree/8c9c2f6a Diff: http://git-wip-us.apache.org/repos/asf/aurora-packaging/diff/8c9c2f6a Branch: refs/heads/master Commit: 8c9c2f6ad653e5728f4c58f02ce0dd82edc17b4b Parents: 7dcac0d Author: Bill Farner <[email protected]> Authored: Wed Aug 26 10:46:29 2015 -0700 Committer: Bill Farner <[email protected]> Committed: Wed Aug 26 10:46:29 2015 -0700 ---------------------------------------------------------------------- builder/deb/ubuntu-trusty/build.sh | 3 + specs/rpm/Makefile | 1 + specs/rpm/README.md | 1 - specs/rpm/SOURCES/aurora.init.sh | 199 +++++++++++++++++++++ specs/rpm/SOURCES/aurora.logrotate | 24 +++ specs/rpm/SOURCES/aurora.service | 27 +++ specs/rpm/SOURCES/aurora.startup.sh | 27 +++ specs/rpm/SOURCES/aurora.sysconfig | 79 ++++++++ specs/rpm/SOURCES/clusters.json | 6 + specs/rpm/SOURCES/thermos-observer.init.sh | 197 ++++++++++++++++++++ specs/rpm/SOURCES/thermos-observer.logrotate | 24 +++ specs/rpm/SOURCES/thermos-observer.service | 27 +++ specs/rpm/SOURCES/thermos-observer.startup.sh | 19 ++ specs/rpm/SOURCES/thermos-observer.sysconfig | 22 +++ specs/rpm/aurora.init.sh | 199 --------------------- specs/rpm/aurora.logrotate | 24 --- specs/rpm/aurora.service | 27 --- specs/rpm/aurora.spec | 33 ++-- specs/rpm/aurora.startup.sh | 27 --- specs/rpm/aurora.sysconfig | 79 -------- specs/rpm/clusters.json | 6 - specs/rpm/thermos-observer.init.sh | 197 -------------------- specs/rpm/thermos-observer.logrotate | 24 --- specs/rpm/thermos-observer.service | 27 --- specs/rpm/thermos-observer.startup.sh | 19 -- specs/rpm/thermos-observer.sysconfig | 22 --- 26 files changed, 677 insertions(+), 663 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/8c9c2f6a/builder/deb/ubuntu-trusty/build.sh ---------------------------------------------------------------------- diff --git a/builder/deb/ubuntu-trusty/build.sh b/builder/deb/ubuntu-trusty/build.sh index bb2b799..87c2bc0 100755 --- a/builder/deb/ubuntu-trusty/build.sh +++ b/builder/deb/ubuntu-trusty/build.sh @@ -25,6 +25,9 @@ cp -R /specs/debian . export DEBFULLNAME='Apache Aurora' export DEBEMAIL='[email protected]' +# Replace underscores in version ID. +export AURORA_VERSION=$(echo $AURORA_VERSION | tr '_' '-') + dch \ --newversion $AURORA_VERSION \ --package apache-aurora \ http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/8c9c2f6a/specs/rpm/Makefile ---------------------------------------------------------------------- diff --git a/specs/rpm/Makefile b/specs/rpm/Makefile index 77605fe..0fa2158 100644 --- a/specs/rpm/Makefile +++ b/specs/rpm/Makefile @@ -44,6 +44,7 @@ mkdir: clean mkdir -p $(RPM_TOPDIR)/rpmbuild/SOURCES mkdir -p $(RPM_TOPDIR)/rpmbuild/SRPMS cp /src.tar.gz $(SOURCE_TARGET) + cp SOURCES/* $(RPM_TOPDIR)/rpmbuild/SOURCES srpm: mkdir rpmbuild $(RPM_OPTS) \ http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/8c9c2f6a/specs/rpm/README.md ---------------------------------------------------------------------- diff --git a/specs/rpm/README.md b/specs/rpm/README.md index 2432dc7..902d984 100644 --- a/specs/rpm/README.md +++ b/specs/rpm/README.md @@ -14,7 +14,6 @@ How to build using Make and rpmbuild 1. Install the necessary build dependencies via yum-builddep: ```bash -cd build-support/packaging/rpm sudo yum install -y make rpm-build yum-utils make srpm sudo yum-builddep ../../../dist/rpmbuild/SRPMS/* http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/8c9c2f6a/specs/rpm/SOURCES/aurora.init.sh ---------------------------------------------------------------------- diff --git a/specs/rpm/SOURCES/aurora.init.sh b/specs/rpm/SOURCES/aurora.init.sh new file mode 100644 index 0000000..ac4c438 --- /dev/null +++ b/specs/rpm/SOURCES/aurora.init.sh @@ -0,0 +1,199 @@ +#!/bin/bash +# +# aurora Starts the Aurora task scheduler for Mesos. +# +# chkconfig: 345 55 25 +# description: This script starts the Aurora service scheduler for Apache Mesos, \ +# used for scheduling and executing long-running tasks and \ +# cron jobs. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +### BEGIN INIT INFO +# Provides: aurora +# Required-Start: +# Required-Stop: +# Should-Start: +# Should-Stop: +# Default-Start: 3 4 5 +# Default-Stop: 0 1 2 6 +# Short-Description: Starts the Aurora task scheduler for Mesos. +# Description: Starts the Aurora task scheduler for Mesos. +### END INIT INFO + +# Source LSB function library. +. /lib/lsb/init-functions + +aurora_user="aurora" +exec="/usr/bin/aurora-scheduler-startup" +prog="aurora" +logdir="/var/log/aurora" +lockfile="/var/run/aurora.lock" +pid_file="/var/run/aurora.pid" +stderr_log="${logdir}/aurora.log" + +# Get a sane screen width +[ -z "${COLUMNS:-}" ] && COLUMNS=80 +[ -z "${CONSOLETYPE:-}" ] && CONSOLETYPE="$(/sbin/consoletype)" + +# Read in init configuration. +if [ -z "${BOOTUP:-}" ]; then + if [ -f /etc/sysconfig/init ]; then + . /etc/sysconfig/init + else + BOOTUP=color + RES_COL=60 + MOVE_TO_COL="echo -en \\033[${RES_COL}G" + SETCOLOR_SUCCESS="echo -en \\033[1;32m" + SETCOLOR_FAILURE="echo -en \\033[1;31m" + SETCOLOR_WARNING="echo -en \\033[1;33m" + SETCOLOR_NORMAL="echo -en \\033[0;39m" + LOGLEVEL=1 + fi + if [ "$CONSOLETYPE" = "serial" ]; then + BOOTUP=serial + MOVE_TO_COL= + SETCOLOR_SUCCESS= + SETCOLOR_FAILURE= + SETCOLOR_WARNING= + SETCOLOR_NORMAL= + fi +fi + +function usage { + err "Starts the Aurora task scheduler for Mesos." + err "Usage: ${0} (restart|start|stop|status)" +} + +function out { + printf '%s\n' "$*"; +} + +function msg { + out "$*" >&2; +} + +function err { + local x=${?}; + msg "$*"; + return $(( ${x} == 0 ? 1 : ${x} )); +} + +function echo_success { + [ "$BOOTUP" = "color" ] && $MOVE_TO_COL + echo -n "[" + [ "$BOOTUP" = "color" ] && $SETCOLOR_SUCCESS + echo -n $" OK " + [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL + echo -n "]" + echo -ne "\r" + return 0 +} + +function echo_failure { + [ "$BOOTUP" = "color" ] && $MOVE_TO_COL + echo -n "[" + [ "$BOOTUP" = "color" ] && $SETCOLOR_FAILURE + echo -n $"FAILED" + [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL + echo -n "]" + echo -ne "\r" + return 1 +} + +# Parse arguments. +ACTION=${1} + +# Ensures that action is. +if [ -z ${ACTION} ]; then + err "ERROR: No action specified." + usage + exit -1 +fi + +start() { + [ -x ${exec} ] || exit 5 + [ -f ${config} ] || exit 6 + echo -n $"Starting $prog: " + start_daemon daemonize -u ${aurora_user} -e ${stderr_log} -p ${pid_file} ${exec} + retval=$? + [ $retval -eq 0 ] && (echo_success; touch $lockfile) || echo_failure + echo + return $retval +} + +stop() { + echo -n $"Stopping $prog: " + killproc -p ${pid_file} ${exec} + retval=$? + [ $retval -eq 0 ] && (echo_success; rm -f $lockfile) || echo_failure + echo + return $retval +} + +restart() { + stop + start +} + +reload() { + restart +} + +force_reload() { + restart +} + +rh_status() { + pid=$(pidofproc -p ${pid_file} ${prog}) + if [ $? -eq 0 ]; then + echo "${prog} (pid ${pid}) is running..." + return 0 + else + if [ -e $lockfile ]; then + echo "${prog} dead but lockfile exists" + return 2 + else + echo "${prog} is stopped" + return 1 + fi + fi +} + +rh_status_q() { + rh_status >/dev/null 2>&1 +} + +# Executes the requested daemon action. +case "${ACTION}" in + start) + rh_status_q && rh_status && exit 0 + start + ;; + stop) + stop + ;; + status) + rh_status + ;; + restart) + restart + ;; + *) + err "ERROR: Invalid action specified." + usage + exit -3 +esac + +exit $? http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/8c9c2f6a/specs/rpm/SOURCES/aurora.logrotate ---------------------------------------------------------------------- diff --git a/specs/rpm/SOURCES/aurora.logrotate b/specs/rpm/SOURCES/aurora.logrotate new file mode 100644 index 0000000..1c43073 --- /dev/null +++ b/specs/rpm/SOURCES/aurora.logrotate @@ -0,0 +1,24 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +/var/log/aurora/*.log { + + daily + missingok + rotate 14 + compress + delaycompress + notifempty + copytruncate + +} http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/8c9c2f6a/specs/rpm/SOURCES/aurora.service ---------------------------------------------------------------------- diff --git a/specs/rpm/SOURCES/aurora.service b/specs/rpm/SOURCES/aurora.service new file mode 100644 index 0000000..b81cb63 --- /dev/null +++ b/specs/rpm/SOURCES/aurora.service @@ -0,0 +1,27 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +[Unit] +Description=Aurora Scheduler +After=network.target +Wants=network.target + +[Service] +ExecStart=/usr/bin/aurora-scheduler-startup +User=aurora +Group=aurora +Restart=always +RestartSec=20 +LimitNOFILE=16384 + +[Install] +WantedBy=multi-user.target http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/8c9c2f6a/specs/rpm/SOURCES/aurora.startup.sh ---------------------------------------------------------------------- diff --git a/specs/rpm/SOURCES/aurora.startup.sh b/specs/rpm/SOURCES/aurora.startup.sh new file mode 100644 index 0000000..3c444d9 --- /dev/null +++ b/specs/rpm/SOURCES/aurora.startup.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# +# Starts up an Aurora scheduler process. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +source /etc/sysconfig/aurora + +# Environment variables control the behavior of the Mesos scheduler driver (libmesos). +export GLOG_v LIBPROCESS_PORT LIBPROCESS_IP +export JAVA_OPTS="${JAVA_OPTS[*]}" + +# Preferences Java 1.8 over any other Java version. +export PATH=/usr/lib/jvm/java-1.8.0/bin:${PATH} + +exec /usr/lib/aurora/bin/aurora-scheduler "${AURORA_FLAGS[@]}" http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/8c9c2f6a/specs/rpm/SOURCES/aurora.sysconfig ---------------------------------------------------------------------- diff --git a/specs/rpm/SOURCES/aurora.sysconfig b/specs/rpm/SOURCES/aurora.sysconfig new file mode 100644 index 0000000..b2a974f --- /dev/null +++ b/specs/rpm/SOURCES/aurora.sysconfig @@ -0,0 +1,79 @@ +#!/bin/bash +# Configuration used when executing the Aurora task scheduler process. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +GLOG_v=0 + +LIBPROCESS_PORT=8083 +LIBPROCESS_IP='127.0.0.1' + +# Flags that control the behavior of the JVM. +JAVA_OPTS=( + # Uses server-level GC optimizations, as this is a server. + -server + + # Location of libmesos-XXXX.so / libmesos-XXXX.dylib + -Djava.library.path='/usr/lib;/usr/lib64' +) + +# Flags control the behavior of the Aurora scheduler. +# For a full list of available flags, run /usr/lib/aurora/bin/aurora-scheduler -help +AURORA_FLAGS=( + # The name of this cluster. + -cluster_name='main' + + # The HTTP port upon which Aurora will listen. + -http_port=8081 + + # The ZooKeeper URL of the ZNode where the Mesos master has registered. + -mesos_master_address='zk://127.0.0.1:2181/mesos/master' + + # The ZooKeeper quorum to which Aurora will register itself. + -zk_endpoints='127.0.0.1:2181' + + # The ZooKeeper ZNode within the specified quorum to which Aurora will register its + # ServerSet, which keeps track of all live Aurora schedulers. + -serverset_path='/aurora/scheduler' + + # The log level of the built-in logger. + -vlog='INFO' + + # Allows the scheduling of containers of the provided type. + -allowed_container_types='DOCKER,MESOS' + + ### Native Log Settings ### + + # The native log serves as a replicated database which stores the state of the + # scheduler, allowing for multi-master operation. + + # Size of the quorum of Aurora schedulers which possess a native log. If running in + # multi-master mode, consult the following document to determine appropriate values: + # + # https://aurora.apache.org/documentation/latest/deploying-aurora-scheduler/#replicated-log-configuration + -native_log_quorum_size='1' + # The ZooKeeper ZNode to which Aurora will register the locations of its replicated log. + -native_log_zk_group_path='/aurora/native-log' + # The local directory in which an Aurora scheduler can find Aurora's replicated log. + -native_log_file_path='/var/lib/aurora/db' + # The local directory in which Aurora schedulers will place state backups. + -backup_dir='/var/lib/aurora/backups' + + ### Thermos Settings ### + + # The local path of the Thermos executor binary. + -thermos_executor_path='/usr/bin/thermos_executor' + # Flags to pass to the Thermos executor. + -thermos_executor_flags='--announcer-enable --announcer-ensemble 127.0.0.1:2181' +) http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/8c9c2f6a/specs/rpm/SOURCES/clusters.json ---------------------------------------------------------------------- diff --git a/specs/rpm/SOURCES/clusters.json b/specs/rpm/SOURCES/clusters.json new file mode 100644 index 0000000..133013b --- /dev/null +++ b/specs/rpm/SOURCES/clusters.json @@ -0,0 +1,6 @@ +[{ + "name": "main", + "zk": "127.0.0.1", + "scheduler_zk_path": "/aurora/scheduler", + "auth_mechanism": "UNAUTHENTICATED" +}] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/8c9c2f6a/specs/rpm/SOURCES/thermos-observer.init.sh ---------------------------------------------------------------------- diff --git a/specs/rpm/SOURCES/thermos-observer.init.sh b/specs/rpm/SOURCES/thermos-observer.init.sh new file mode 100644 index 0000000..65a2452 --- /dev/null +++ b/specs/rpm/SOURCES/thermos-observer.init.sh @@ -0,0 +1,197 @@ +#!/bin/bash +# +# thermos-observer Starts the Thermos task observer. +# +# chkconfig: 345 55 25 +# description: This script starts the Thermos task observer, which provides a WebUI for \ +# viewing the state of tasks launched by the Thermos executor. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +### BEGIN INIT INFO +# Provides: thermos-observer +# Required-Start: +# Required-Stop: +# Should-Start: +# Should-Stop: +# Default-Start: 3 4 5 +# Default-Stop: 0 1 2 6 +# Short-Description: Starts the Thermos task observer. +# Description: Starts the Thermos task observer. +### END INIT INFO + +# Source LSB function library. +. /lib/lsb/init-functions + +exec="/usr/bin/thermos-observer-startup" +prog="thermos-observer" +logdir="/var/log/thermos" +lockfile="/var/run/thermos-observer.lock" +pid_file="/var/run/thermos-observer.pid" + +stderr_log="${logdir}/observer.log" + +# Get a sane screen width +[ -z "${COLUMNS:-}" ] && COLUMNS=80 +[ -z "${CONSOLETYPE:-}" ] && CONSOLETYPE="$(/sbin/consoletype)" + +# Read in init configuration. +if [ -z "${BOOTUP:-}" ]; then + if [ -f /etc/sysconfig/init ]; then + . /etc/sysconfig/init + else + BOOTUP=color + RES_COL=60 + MOVE_TO_COL="echo -en \\033[${RES_COL}G" + SETCOLOR_SUCCESS="echo -en \\033[1;32m" + SETCOLOR_FAILURE="echo -en \\033[1;31m" + SETCOLOR_WARNING="echo -en \\033[1;33m" + SETCOLOR_NORMAL="echo -en \\033[0;39m" + LOGLEVEL=1 + fi + if [ "$CONSOLETYPE" = "serial" ]; then + BOOTUP=serial + MOVE_TO_COL= + SETCOLOR_SUCCESS= + SETCOLOR_FAILURE= + SETCOLOR_WARNING= + SETCOLOR_NORMAL= + fi +fi + +function usage { + err "Starts the Thermos task observer." + err "Usage: ${0} (restart|start|stop|status)" +} + +function out { + printf '%s\n' "$*"; +} + +function msg { + out "$*" >&2; +} + +function err { + local x=${?}; + msg "$*"; + return $(( ${x} == 0 ? 1 : ${x} )); +} + +function echo_success { + [ "$BOOTUP" = "color" ] && $MOVE_TO_COL + echo -n "[" + [ "$BOOTUP" = "color" ] && $SETCOLOR_SUCCESS + echo -n $" OK " + [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL + echo -n "]" + echo -ne "\r" + return 0 +} + +function echo_failure { + [ "$BOOTUP" = "color" ] && $MOVE_TO_COL + echo -n "[" + [ "$BOOTUP" = "color" ] && $SETCOLOR_FAILURE + echo -n $"FAILED" + [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL + echo -n "]" + echo -ne "\r" + return 1 +} + +# Parse arguments. +ACTION=${1} + +# Ensures that action is. +if [ -z ${ACTION} ]; then + err "ERROR: No action specified." + usage + exit -1 +fi + +start() { + [ -x ${exec} ] || exit 5 + [ -f ${config} ] || exit 6 + echo -n $"Starting $prog: " + start_daemon daemonize -e ${stderr_log} -p ${pid_file} ${exec} + retval=$? + [ $retval -eq 0 ] && (echo_success; touch $lockfile) || echo_failure + echo + return $retval +} + +stop() { + echo -n $"Stopping $prog: " + killproc -p ${pid_file} ${exec} + retval=$? + [ $retval -eq 0 ] && (echo_success; rm -f $lockfile) || echo_failure + echo + return $retval +} + +restart() { + stop + start +} + +reload() { + restart +} + +force_reload() { + restart +} + +rh_status() { + pid=$(pidofproc -p ${pid_file} ${prog}) + if [ $? -eq 0 ]; then + echo "${prog} (pid ${pid}) is running..." + return 0 + else + if [ -e $lockfile ]; then + echo "${prog} dead but lockfile exists" + return 2 + else + echo "${prog} is stopped" + return 1 + fi + fi +} + +rh_status_q() { + rh_status >/dev/null 2>&1 +} + +# Executes the requested daemon action. +case "${ACTION}" in + start) + rh_status_q && rh_status && exit 0 + start + ;; + stop) + stop + ;; + status) + rh_status + ;; + restart) + restart + ;; + *) + err "ERROR: Invalid action specified." + usage + exit -3 +esac + +exit $? http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/8c9c2f6a/specs/rpm/SOURCES/thermos-observer.logrotate ---------------------------------------------------------------------- diff --git a/specs/rpm/SOURCES/thermos-observer.logrotate b/specs/rpm/SOURCES/thermos-observer.logrotate new file mode 100644 index 0000000..a6a7f5c --- /dev/null +++ b/specs/rpm/SOURCES/thermos-observer.logrotate @@ -0,0 +1,24 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +/var/log/thermos/*.log { + + daily + missingok + rotate 14 + compress + delaycompress + notifempty + copytruncate + +} http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/8c9c2f6a/specs/rpm/SOURCES/thermos-observer.service ---------------------------------------------------------------------- diff --git a/specs/rpm/SOURCES/thermos-observer.service b/specs/rpm/SOURCES/thermos-observer.service new file mode 100644 index 0000000..d019635 --- /dev/null +++ b/specs/rpm/SOURCES/thermos-observer.service @@ -0,0 +1,27 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +[Unit] +Description=Thermos Observer +After=network.target +Wants=network.target + +[Service] +ExecStart=/usr/bin/thermos-observer-startup +User=root +Group=root +Restart=always +RestartSec=20 +LimitNOFILE=16384 + +[Install] +WantedBy=multi-user.target http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/8c9c2f6a/specs/rpm/SOURCES/thermos-observer.startup.sh ---------------------------------------------------------------------- diff --git a/specs/rpm/SOURCES/thermos-observer.startup.sh b/specs/rpm/SOURCES/thermos-observer.startup.sh new file mode 100644 index 0000000..2d94fd9 --- /dev/null +++ b/specs/rpm/SOURCES/thermos-observer.startup.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Starts up a Thermos observer process. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +source /etc/sysconfig/thermos-observer + +exec /usr/bin/thermos_observer "${OBSERVER_ARGS[@]}" http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/8c9c2f6a/specs/rpm/SOURCES/thermos-observer.sysconfig ---------------------------------------------------------------------- diff --git a/specs/rpm/SOURCES/thermos-observer.sysconfig b/specs/rpm/SOURCES/thermos-observer.sysconfig new file mode 100644 index 0000000..4bc5430 --- /dev/null +++ b/specs/rpm/SOURCES/thermos-observer.sysconfig @@ -0,0 +1,22 @@ +#!/bin/bash +# Configuration used when executing the Thermos observer process. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +OBSERVER_ARGS=( + --root=/var/run/thermos + --port=1338 + --log_to_disk=NONE + --log_to_stderr=google:INFO +) http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/8c9c2f6a/specs/rpm/aurora.init.sh ---------------------------------------------------------------------- diff --git a/specs/rpm/aurora.init.sh b/specs/rpm/aurora.init.sh deleted file mode 100644 index ac4c438..0000000 --- a/specs/rpm/aurora.init.sh +++ /dev/null @@ -1,199 +0,0 @@ -#!/bin/bash -# -# aurora Starts the Aurora task scheduler for Mesos. -# -# chkconfig: 345 55 25 -# description: This script starts the Aurora service scheduler for Apache Mesos, \ -# used for scheduling and executing long-running tasks and \ -# cron jobs. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -### BEGIN INIT INFO -# Provides: aurora -# Required-Start: -# Required-Stop: -# Should-Start: -# Should-Stop: -# Default-Start: 3 4 5 -# Default-Stop: 0 1 2 6 -# Short-Description: Starts the Aurora task scheduler for Mesos. -# Description: Starts the Aurora task scheduler for Mesos. -### END INIT INFO - -# Source LSB function library. -. /lib/lsb/init-functions - -aurora_user="aurora" -exec="/usr/bin/aurora-scheduler-startup" -prog="aurora" -logdir="/var/log/aurora" -lockfile="/var/run/aurora.lock" -pid_file="/var/run/aurora.pid" -stderr_log="${logdir}/aurora.log" - -# Get a sane screen width -[ -z "${COLUMNS:-}" ] && COLUMNS=80 -[ -z "${CONSOLETYPE:-}" ] && CONSOLETYPE="$(/sbin/consoletype)" - -# Read in init configuration. -if [ -z "${BOOTUP:-}" ]; then - if [ -f /etc/sysconfig/init ]; then - . /etc/sysconfig/init - else - BOOTUP=color - RES_COL=60 - MOVE_TO_COL="echo -en \\033[${RES_COL}G" - SETCOLOR_SUCCESS="echo -en \\033[1;32m" - SETCOLOR_FAILURE="echo -en \\033[1;31m" - SETCOLOR_WARNING="echo -en \\033[1;33m" - SETCOLOR_NORMAL="echo -en \\033[0;39m" - LOGLEVEL=1 - fi - if [ "$CONSOLETYPE" = "serial" ]; then - BOOTUP=serial - MOVE_TO_COL= - SETCOLOR_SUCCESS= - SETCOLOR_FAILURE= - SETCOLOR_WARNING= - SETCOLOR_NORMAL= - fi -fi - -function usage { - err "Starts the Aurora task scheduler for Mesos." - err "Usage: ${0} (restart|start|stop|status)" -} - -function out { - printf '%s\n' "$*"; -} - -function msg { - out "$*" >&2; -} - -function err { - local x=${?}; - msg "$*"; - return $(( ${x} == 0 ? 1 : ${x} )); -} - -function echo_success { - [ "$BOOTUP" = "color" ] && $MOVE_TO_COL - echo -n "[" - [ "$BOOTUP" = "color" ] && $SETCOLOR_SUCCESS - echo -n $" OK " - [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL - echo -n "]" - echo -ne "\r" - return 0 -} - -function echo_failure { - [ "$BOOTUP" = "color" ] && $MOVE_TO_COL - echo -n "[" - [ "$BOOTUP" = "color" ] && $SETCOLOR_FAILURE - echo -n $"FAILED" - [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL - echo -n "]" - echo -ne "\r" - return 1 -} - -# Parse arguments. -ACTION=${1} - -# Ensures that action is. -if [ -z ${ACTION} ]; then - err "ERROR: No action specified." - usage - exit -1 -fi - -start() { - [ -x ${exec} ] || exit 5 - [ -f ${config} ] || exit 6 - echo -n $"Starting $prog: " - start_daemon daemonize -u ${aurora_user} -e ${stderr_log} -p ${pid_file} ${exec} - retval=$? - [ $retval -eq 0 ] && (echo_success; touch $lockfile) || echo_failure - echo - return $retval -} - -stop() { - echo -n $"Stopping $prog: " - killproc -p ${pid_file} ${exec} - retval=$? - [ $retval -eq 0 ] && (echo_success; rm -f $lockfile) || echo_failure - echo - return $retval -} - -restart() { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - pid=$(pidofproc -p ${pid_file} ${prog}) - if [ $? -eq 0 ]; then - echo "${prog} (pid ${pid}) is running..." - return 0 - else - if [ -e $lockfile ]; then - echo "${prog} dead but lockfile exists" - return 2 - else - echo "${prog} is stopped" - return 1 - fi - fi -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - -# Executes the requested daemon action. -case "${ACTION}" in - start) - rh_status_q && rh_status && exit 0 - start - ;; - stop) - stop - ;; - status) - rh_status - ;; - restart) - restart - ;; - *) - err "ERROR: Invalid action specified." - usage - exit -3 -esac - -exit $? http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/8c9c2f6a/specs/rpm/aurora.logrotate ---------------------------------------------------------------------- diff --git a/specs/rpm/aurora.logrotate b/specs/rpm/aurora.logrotate deleted file mode 100644 index 1c43073..0000000 --- a/specs/rpm/aurora.logrotate +++ /dev/null @@ -1,24 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -/var/log/aurora/*.log { - - daily - missingok - rotate 14 - compress - delaycompress - notifempty - copytruncate - -} http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/8c9c2f6a/specs/rpm/aurora.service ---------------------------------------------------------------------- diff --git a/specs/rpm/aurora.service b/specs/rpm/aurora.service deleted file mode 100644 index b81cb63..0000000 --- a/specs/rpm/aurora.service +++ /dev/null @@ -1,27 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -[Unit] -Description=Aurora Scheduler -After=network.target -Wants=network.target - -[Service] -ExecStart=/usr/bin/aurora-scheduler-startup -User=aurora -Group=aurora -Restart=always -RestartSec=20 -LimitNOFILE=16384 - -[Install] -WantedBy=multi-user.target http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/8c9c2f6a/specs/rpm/aurora.spec ---------------------------------------------------------------------- diff --git a/specs/rpm/aurora.spec b/specs/rpm/aurora.spec index 22c107e..3e7b8be 100644 --- a/specs/rpm/aurora.spec +++ b/specs/rpm/aurora.spec @@ -59,6 +59,17 @@ License: ASL 2.0 URL: https://%{name}.apache.org/ Source0: https://github.com/apache/%{name}/archive/%{version}/%{name}.tar.gz +Source1: aurora.service +Source2: thermos-observer.service +Source3: aurora.init.sh +Source4: thermos-observer.init.sh +Source5: aurora.startup.sh +Source6: thermos-observer.startup.sh +Source7: aurora.sysconfig +Source8: thermos-observer.sysconfig +Source9: aurora.logrotate +Source10: thermos-observer.logrotate +Source11: clusters.json BuildRequires: apr-devel BuildRequires: cyrus-sasl-devel @@ -209,23 +220,23 @@ done # Installs all support scripting. %if 0%{?fedora} || 0%{?rhel} > 6 -install -m 644 build-support/packaging/rpm/%{name}.service %{buildroot}%{_sysconfdir}/systemd/system/%{name}.service -install -m 644 build-support/packaging/rpm/thermos-observer.service %{buildroot}%{_sysconfdir}/systemd/system/thermos-observer.service +install -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/systemd/system +install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/systemd/system/thermos-observer.service %else -install -m 755 build-support/packaging/rpm/%{name}.init.sh %{buildroot}%{_sysconfdir}/init.d/%{name} -install -m 755 build-support/packaging/rpm/thermos-observer.init.sh %{buildroot}%{_sysconfdir}/init.d/thermos-observer +install -m 755 %{SOURCE3} %{buildroot}%{_sysconfdir}/init.d/aurora +install -m 755 %{SOURCE4} %{buildroot}%{_sysconfdir}/init.d/thermos-observer %endif -install -m 755 build-support/packaging/rpm/%{name}.startup.sh %{buildroot}%{_bindir}/%{name}-scheduler-startup -install -m 755 build-support/packaging/rpm/thermos-observer.startup.sh %{buildroot}%{_bindir}/thermos-observer-startup +install -m 755 %{SOURCE5} %{buildroot}%{_bindir}/%{name}-scheduler-startup +install -m 755 %{SOURCE6} %{buildroot}%{_bindir}/thermos-observer-startup -install -m 644 build-support/packaging/rpm/%{name}.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/%{name} -install -m 644 build-support/packaging/rpm/thermos-observer.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/thermos-observer +install -m 644 %{SOURCE7} %{buildroot}%{_sysconfdir}/sysconfig/%{name} +install -m 644 %{SOURCE8} %{buildroot}%{_sysconfdir}/sysconfig/thermos-observer -install -m 644 build-support/packaging/rpm/%{name}.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name} -install -m 644 build-support/packaging/rpm/thermos-observer.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/thermos-observer +install -m 644 %{SOURCE9} %{buildroot}%{_sysconfdir}/logrotate.d/%{name} +install -m 644 %{SOURCE10} %{buildroot}%{_sysconfdir}/logrotate.d/thermos-observer -install -m 644 build-support/packaging/rpm/clusters.json %{buildroot}%{_sysconfdir}/%{name}/clusters.json +install -m 644 %{SOURCE11} %{buildroot}%{_sysconfdir}/%{name}/clusters.json %pre http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/8c9c2f6a/specs/rpm/aurora.startup.sh ---------------------------------------------------------------------- diff --git a/specs/rpm/aurora.startup.sh b/specs/rpm/aurora.startup.sh deleted file mode 100644 index 3c444d9..0000000 --- a/specs/rpm/aurora.startup.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# -# Starts up an Aurora scheduler process. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -source /etc/sysconfig/aurora - -# Environment variables control the behavior of the Mesos scheduler driver (libmesos). -export GLOG_v LIBPROCESS_PORT LIBPROCESS_IP -export JAVA_OPTS="${JAVA_OPTS[*]}" - -# Preferences Java 1.8 over any other Java version. -export PATH=/usr/lib/jvm/java-1.8.0/bin:${PATH} - -exec /usr/lib/aurora/bin/aurora-scheduler "${AURORA_FLAGS[@]}" http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/8c9c2f6a/specs/rpm/aurora.sysconfig ---------------------------------------------------------------------- diff --git a/specs/rpm/aurora.sysconfig b/specs/rpm/aurora.sysconfig deleted file mode 100644 index b2a974f..0000000 --- a/specs/rpm/aurora.sysconfig +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash -# Configuration used when executing the Aurora task scheduler process. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -GLOG_v=0 - -LIBPROCESS_PORT=8083 -LIBPROCESS_IP='127.0.0.1' - -# Flags that control the behavior of the JVM. -JAVA_OPTS=( - # Uses server-level GC optimizations, as this is a server. - -server - - # Location of libmesos-XXXX.so / libmesos-XXXX.dylib - -Djava.library.path='/usr/lib;/usr/lib64' -) - -# Flags control the behavior of the Aurora scheduler. -# For a full list of available flags, run /usr/lib/aurora/bin/aurora-scheduler -help -AURORA_FLAGS=( - # The name of this cluster. - -cluster_name='main' - - # The HTTP port upon which Aurora will listen. - -http_port=8081 - - # The ZooKeeper URL of the ZNode where the Mesos master has registered. - -mesos_master_address='zk://127.0.0.1:2181/mesos/master' - - # The ZooKeeper quorum to which Aurora will register itself. - -zk_endpoints='127.0.0.1:2181' - - # The ZooKeeper ZNode within the specified quorum to which Aurora will register its - # ServerSet, which keeps track of all live Aurora schedulers. - -serverset_path='/aurora/scheduler' - - # The log level of the built-in logger. - -vlog='INFO' - - # Allows the scheduling of containers of the provided type. - -allowed_container_types='DOCKER,MESOS' - - ### Native Log Settings ### - - # The native log serves as a replicated database which stores the state of the - # scheduler, allowing for multi-master operation. - - # Size of the quorum of Aurora schedulers which possess a native log. If running in - # multi-master mode, consult the following document to determine appropriate values: - # - # https://aurora.apache.org/documentation/latest/deploying-aurora-scheduler/#replicated-log-configuration - -native_log_quorum_size='1' - # The ZooKeeper ZNode to which Aurora will register the locations of its replicated log. - -native_log_zk_group_path='/aurora/native-log' - # The local directory in which an Aurora scheduler can find Aurora's replicated log. - -native_log_file_path='/var/lib/aurora/db' - # The local directory in which Aurora schedulers will place state backups. - -backup_dir='/var/lib/aurora/backups' - - ### Thermos Settings ### - - # The local path of the Thermos executor binary. - -thermos_executor_path='/usr/bin/thermos_executor' - # Flags to pass to the Thermos executor. - -thermos_executor_flags='--announcer-enable --announcer-ensemble 127.0.0.1:2181' -) http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/8c9c2f6a/specs/rpm/clusters.json ---------------------------------------------------------------------- diff --git a/specs/rpm/clusters.json b/specs/rpm/clusters.json deleted file mode 100644 index 133013b..0000000 --- a/specs/rpm/clusters.json +++ /dev/null @@ -1,6 +0,0 @@ -[{ - "name": "main", - "zk": "127.0.0.1", - "scheduler_zk_path": "/aurora/scheduler", - "auth_mechanism": "UNAUTHENTICATED" -}] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/8c9c2f6a/specs/rpm/thermos-observer.init.sh ---------------------------------------------------------------------- diff --git a/specs/rpm/thermos-observer.init.sh b/specs/rpm/thermos-observer.init.sh deleted file mode 100644 index 65a2452..0000000 --- a/specs/rpm/thermos-observer.init.sh +++ /dev/null @@ -1,197 +0,0 @@ -#!/bin/bash -# -# thermos-observer Starts the Thermos task observer. -# -# chkconfig: 345 55 25 -# description: This script starts the Thermos task observer, which provides a WebUI for \ -# viewing the state of tasks launched by the Thermos executor. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -### BEGIN INIT INFO -# Provides: thermos-observer -# Required-Start: -# Required-Stop: -# Should-Start: -# Should-Stop: -# Default-Start: 3 4 5 -# Default-Stop: 0 1 2 6 -# Short-Description: Starts the Thermos task observer. -# Description: Starts the Thermos task observer. -### END INIT INFO - -# Source LSB function library. -. /lib/lsb/init-functions - -exec="/usr/bin/thermos-observer-startup" -prog="thermos-observer" -logdir="/var/log/thermos" -lockfile="/var/run/thermos-observer.lock" -pid_file="/var/run/thermos-observer.pid" - -stderr_log="${logdir}/observer.log" - -# Get a sane screen width -[ -z "${COLUMNS:-}" ] && COLUMNS=80 -[ -z "${CONSOLETYPE:-}" ] && CONSOLETYPE="$(/sbin/consoletype)" - -# Read in init configuration. -if [ -z "${BOOTUP:-}" ]; then - if [ -f /etc/sysconfig/init ]; then - . /etc/sysconfig/init - else - BOOTUP=color - RES_COL=60 - MOVE_TO_COL="echo -en \\033[${RES_COL}G" - SETCOLOR_SUCCESS="echo -en \\033[1;32m" - SETCOLOR_FAILURE="echo -en \\033[1;31m" - SETCOLOR_WARNING="echo -en \\033[1;33m" - SETCOLOR_NORMAL="echo -en \\033[0;39m" - LOGLEVEL=1 - fi - if [ "$CONSOLETYPE" = "serial" ]; then - BOOTUP=serial - MOVE_TO_COL= - SETCOLOR_SUCCESS= - SETCOLOR_FAILURE= - SETCOLOR_WARNING= - SETCOLOR_NORMAL= - fi -fi - -function usage { - err "Starts the Thermos task observer." - err "Usage: ${0} (restart|start|stop|status)" -} - -function out { - printf '%s\n' "$*"; -} - -function msg { - out "$*" >&2; -} - -function err { - local x=${?}; - msg "$*"; - return $(( ${x} == 0 ? 1 : ${x} )); -} - -function echo_success { - [ "$BOOTUP" = "color" ] && $MOVE_TO_COL - echo -n "[" - [ "$BOOTUP" = "color" ] && $SETCOLOR_SUCCESS - echo -n $" OK " - [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL - echo -n "]" - echo -ne "\r" - return 0 -} - -function echo_failure { - [ "$BOOTUP" = "color" ] && $MOVE_TO_COL - echo -n "[" - [ "$BOOTUP" = "color" ] && $SETCOLOR_FAILURE - echo -n $"FAILED" - [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL - echo -n "]" - echo -ne "\r" - return 1 -} - -# Parse arguments. -ACTION=${1} - -# Ensures that action is. -if [ -z ${ACTION} ]; then - err "ERROR: No action specified." - usage - exit -1 -fi - -start() { - [ -x ${exec} ] || exit 5 - [ -f ${config} ] || exit 6 - echo -n $"Starting $prog: " - start_daemon daemonize -e ${stderr_log} -p ${pid_file} ${exec} - retval=$? - [ $retval -eq 0 ] && (echo_success; touch $lockfile) || echo_failure - echo - return $retval -} - -stop() { - echo -n $"Stopping $prog: " - killproc -p ${pid_file} ${exec} - retval=$? - [ $retval -eq 0 ] && (echo_success; rm -f $lockfile) || echo_failure - echo - return $retval -} - -restart() { - stop - start -} - -reload() { - restart -} - -force_reload() { - restart -} - -rh_status() { - pid=$(pidofproc -p ${pid_file} ${prog}) - if [ $? -eq 0 ]; then - echo "${prog} (pid ${pid}) is running..." - return 0 - else - if [ -e $lockfile ]; then - echo "${prog} dead but lockfile exists" - return 2 - else - echo "${prog} is stopped" - return 1 - fi - fi -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - -# Executes the requested daemon action. -case "${ACTION}" in - start) - rh_status_q && rh_status && exit 0 - start - ;; - stop) - stop - ;; - status) - rh_status - ;; - restart) - restart - ;; - *) - err "ERROR: Invalid action specified." - usage - exit -3 -esac - -exit $? http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/8c9c2f6a/specs/rpm/thermos-observer.logrotate ---------------------------------------------------------------------- diff --git a/specs/rpm/thermos-observer.logrotate b/specs/rpm/thermos-observer.logrotate deleted file mode 100644 index a6a7f5c..0000000 --- a/specs/rpm/thermos-observer.logrotate +++ /dev/null @@ -1,24 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -/var/log/thermos/*.log { - - daily - missingok - rotate 14 - compress - delaycompress - notifempty - copytruncate - -} http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/8c9c2f6a/specs/rpm/thermos-observer.service ---------------------------------------------------------------------- diff --git a/specs/rpm/thermos-observer.service b/specs/rpm/thermos-observer.service deleted file mode 100644 index d019635..0000000 --- a/specs/rpm/thermos-observer.service +++ /dev/null @@ -1,27 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -[Unit] -Description=Thermos Observer -After=network.target -Wants=network.target - -[Service] -ExecStart=/usr/bin/thermos-observer-startup -User=root -Group=root -Restart=always -RestartSec=20 -LimitNOFILE=16384 - -[Install] -WantedBy=multi-user.target http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/8c9c2f6a/specs/rpm/thermos-observer.startup.sh ---------------------------------------------------------------------- diff --git a/specs/rpm/thermos-observer.startup.sh b/specs/rpm/thermos-observer.startup.sh deleted file mode 100644 index 2d94fd9..0000000 --- a/specs/rpm/thermos-observer.startup.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# Starts up a Thermos observer process. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -source /etc/sysconfig/thermos-observer - -exec /usr/bin/thermos_observer "${OBSERVER_ARGS[@]}" http://git-wip-us.apache.org/repos/asf/aurora-packaging/blob/8c9c2f6a/specs/rpm/thermos-observer.sysconfig ---------------------------------------------------------------------- diff --git a/specs/rpm/thermos-observer.sysconfig b/specs/rpm/thermos-observer.sysconfig deleted file mode 100644 index 4bc5430..0000000 --- a/specs/rpm/thermos-observer.sysconfig +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# Configuration used when executing the Thermos observer process. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -OBSERVER_ARGS=( - --root=/var/run/thermos - --port=1338 - --log_to_disk=NONE - --log_to_stderr=google:INFO -)
