Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warning about disabled subdir-objects #648

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ CMakeLists.txt
# Packages
*.tar.gz
*.tar.bz2
*.pc

# Logs
*.log
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ AC_CONFIG_HEADERS([config.h:config.h.in])
AC_CONFIG_MACRO_DIR([m4])

# Initialize automake
AM_INIT_AUTOMAKE([1.11 foreign])
AM_INIT_AUTOMAKE([1.11 foreign subdir-objects])

# Checks for language
AC_LANG([C])
Expand Down
16 changes: 16 additions & 0 deletions debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM ubuntu:14.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
build-essential \
bzr-builddeb \
bzr-git \
dh-autoreconf \
dh-exec \
dh-make \
git \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*

CMD /bin/bash
4 changes: 4 additions & 0 deletions debian/README.Debian
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dynomite for Debian
-------------------

-- Estelle Poulin <[email protected]> Tue, 09 Apr 2019 03:38:44 +0000
5 changes: 5 additions & 0 deletions debian/README.source
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dynomite for Debian
-------------------

-- Estelle Poulin <[email protected]> Tue, 09 Apr 2019 03:38:44 +0000

12 changes: 12 additions & 0 deletions debian/build-enter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#! /usr/bin/env bash

docker run -it \
--rm \
-u $(id -u):$(id -g) \
-e HOME="$HOME" \
-e USER="$USER" \
-v "$HOME":"$HOME" \
-v /etc/passwd:/etc/passwd \
-v /etc/group:/etc/group \
-w "$HOME" \
local/debbuild
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dynomite (0.7.0-1) trusty; urgency=low

* Initial release.

-- Estelle Poulin <[email protected]> Tue, 09 Apr 2019 03:38:44 +0000
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
15 changes: 15 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Source: dynomite
Section: database
Priority: optional
Maintainer: Estelle Poulin <[email protected]>
Build-Depends: debhelper (>= 9.0.0), dh-autoreconf (>= 9), dh-exec (>= 0.12)
Standards-Version: 3.9.5
Homepage: https://github.com/netflix/dynomite
Vcs-Git: git://github.com:netflix/dynomite.git
Vcs-Browser: https://github.com/netflix/dynomite.git

Package: dynomite
Architecture: amd64
Depends: ${shlibs:Depends}, ${misc:Depends}
Description:Generic dynamo implementation for different
k-v storage engines.
46 changes: 46 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: dynomite
Source: https://github.com/Netflix/dynomite

Files: *
Copyright: 2018-2019 Netflix
License: Apache-2.0

Files: debian/init debian/service
Copyright: 2018-2019 Netflix
License: Apache-2.0

License: Apache-2.0
On Debian systems, the full text of the Apache License version 2
can be found in the file /usr/share/common-licenses/Apache-2.0.

Files: debian/*
Copyright: © 2019 Estelle Poulin <[email protected]>
License: BSD
Copyright (c) The Regents of the University of California.
All rights reserved.
.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.

2 changes: 2 additions & 0 deletions debian/default
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Run /usr/sbin/dynomite --help for options.
# DAEMON_OPTS="$DAEMON_OPTS -v 5"
6 changes: 6 additions & 0 deletions debian/docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CONTRIBUTING.md
NOTICE
OSSMETADATA
README.md
docs
notes
3 changes: 3 additions & 0 deletions debian/examples
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
conf
docker
init
190 changes: 190 additions & 0 deletions debian/init
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
#! /bin/sh

### BEGIN INIT INFO
# Provides: dynomite
# Required-Start: $remote_fs $syslog $network $time
# Required-Stop: $remote_fs $syslog $network $time
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: dynamo layer for different k-v storage engines
# Description: dynomite is a thin dynamo proxy layer that provides
# high availability (HA) and multi-datacenter replication
# for Redis and MemCached.
### END INIT INFO

NAME=dynomite
DESC="distributed dynamo layer"
PATH=/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin
PIDFILE=/var/run/${NAME}.pid
CONFIG=/etc/dynomite/${NAME}.yml
LOG=/var/log/dynomite.log
INIT_OPTIONS=/etc/default/${NAME}
# RHEL specific file
#SYSTEM_CONFIG=/etc/sysconfig/${NAME}
DAEMON=/usr/sbin/${NAME}
DAEMON_OPTS="-d -c ${CONFIG} -p ${PIDFILE} -o ${LOG}"
# TODO: Runas USER
#USER="dynomite"
#GROUP="dynomite"
RETVAL=0

if [ ! -x $DAEMON ] ; then
echo "Executable '${DAEMON}' was not found."
exit 0
fi

if [ ! -f "$CONFIG" ] ; then
echo "Configuration file '${CONFIG}' was not found."
exit 0
fi

if [ -r $INIT_OPTIONS ]; then
. $INIT_OPTIONS
fi

. /lib/lsb/init-functions

# RHEL system configuration
#if [ -r $SYSTEM_CONFIG ];then
# . $SYSTEM_CONFIG
#fi

#
# Start dynomite
#
# Return
# 0 = daemon has been started
# 1 = daemon was already running
# 2 = daemon could not be started
#
start_dynomite () {
local IS_RUNNING=$(is_running)

if [ $IS_RUNNING = false ] ; then
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
--test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
$DAEMON_OPTS 2>/dev/null \
|| return 2
# RHEL specific init.d script: touch /var/lock/subsys/${NAME}
else
return 1 # daemon already running
fi
}

#
# Stop dynomite
#
# Return
# 0 = daemon has been stopped
# 1 = daemon was already stopped (so don't use --oknodo)
# 2 = daemon could not be stopped
# other status code = a failure occurred
#
stop_dynomite () {
local IS_RUNNING=$(is_running)

if [ $IS_RUNNING = true ] ; then
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \
--pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS
RETVAL="$?"
else
RETVAL=1 # deamon already stopped
fi

sleep 1
return "$RETVAL"
}

#
# Test the Dynomite configuration
#
test_dynomite_config () {
$DAEMON -t $DAEMON_OPTS >/dev/null 2>&1
RETVAL="$?"
return "$RETVAL"
}

#
# Check if a Dynomite process exists
#
# Return via echo
# true = PIDFILE exists and process is running
# false = PIDFILE exists but process is not running
# false = PIDFILE does not exist
#
is_running () {
if [ -s $PIDFILE ] ; then
PID=`head -n 1 $PIDFILE 2>/dev/null`;
if [ ! -z "`ps --no-heading $PID`" ] ; then
echo true # PIDFILE exists, process running
else
# RHEL specific init.d script: rm -r /var/lock/subsys/${NAME}
rm -f $PIDFILE;
echo false # PIDFILE exists, process not running
fi
else
echo false # PIDFILE does not exist
fi
}

case "$1" in
start)
log_daemon_msg "Starting ${DESC}..." "$NAME"
start_dynomite
case "$?" in
0|1) log_end_msg 0 ;;
2) log_end_msg 1 ;;
esac
;;
stop)
log_daemon_msg "Stopping ${DESC}..." "$NAME"
stop_dynomite

case "$?" in
0|1) log_end_msg 0 ;;
2) log_end_msg 1 ;;
esac
;;
status)
status_of_proc -p $PIDFILE "$DAEMON" "$NAME" && exit 0 || exit $?
;;
restart|reload|force-reload)
log_daemon_msg "Restarting $DESC..." "$NAME"

# Do not stop the dynomite server if there is a configuration error as
# it will not start again. Notify the user if there is a configuration
# error.
if ! test_dynomite_config; then
log_end_msg 1 # Configuration error
exit 0
fi

stop_dynomite
sleep 1 # Hack to prevent failure of restart when dynomite is stopped
case "$?" in
0)
start_dynomite
case "$?" in
0) log_end_msg 0 ;; # daemon started or already running
*) log_end_msg 1 ;; # daemon failed to start
esac
;;
*)
# stop() failed
log_end_msg 1
;;
esac
;;
configtest|testconfig|conftest|testconf)
log_daemon_msg "Testing $NAME configuration"
test_dynomite_config
log_end_msg $?
;;
*)
echo $"Usage: $0 {start|stop|status|restart|reload|testconf}"
exit 1
;;
esac
exit $RETVAL
5 changes: 5 additions & 0 deletions debian/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#! /usr/bin/dh-exec
init/systemd_environment__dynomite => etc/environment.d/dynomite.conf
dist/conf/dynomite.yml => etc/dynomite/dynomite.yml
dist/ufw/dynomite => etc/ufw/applications.d/dynomite
dist/firewalld/dynomite.xml => usr/lib/firewalld/services/dynomite.xml
Loading