KITAITI Makoto
null+****@clear*****
Wed Jan 13 23:55:05 JST 2016
KITAITI Makoto 2016-01-13 23:55:05 +0900 (Wed, 13 Jan 2016) New Revision: 9af611410e07662d642a3bc93fc219bef7e0988b https://github.com/droonga/droonga-http-server/commit/9af611410e07662d642a3bc93fc219bef7e0988b Merged 0f9441b: Merge pull request #13 from KitaitiMakoto/systemd Message: Remove unused files for SysVinit Removed files: install/centos/droonga-http-server install/centos/functions.sh install/debian/droonga-http-server install/debian/functions.sh Deleted: install/centos/droonga-http-server (+0 -67) 100755 =================================================================== --- install/centos/droonga-http-server 2016-01-13 23:54:35 +0900 (495fc63) +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash -# -# /etc/rc.d/init.d/droonga-http-server -# -# <A HTTP Protocol Adapter for Droonga> -# chkconfig: 2345 20 80 - -# TODO: we have to migrate to systemd based management in near future... -SYSTEMCTL_SKIP_REDIRECT=yes - -# Source function library. -. /etc/init.d/functions - -NAME=droonga-http-server -USER=$NAME -GROUP=droonga -DAEMON=/usr/bin/$NAME -export DROONGA_BASE_DIR=/home/$NAME/droonga -cd $DROONGA_BASE_DIR -PIDFILE=/run/$NAME/$NAME.pid -DAEMON_ARGS="--daemon --pid-file=$PIDFILE" - -# This directory is required to write PID file by non-root user. -pid_dir=/run/$NAME -mkdir -p $pid_dir -chown -R $USER:$GROUP $pid_dir - -[ -x $DAEMON ] || exit 0 - -start() { - echo -n "Starting $NAME: " - daemon --user $USER --pidfile $PIDFILE $DAEMON $DAEMON_ARGS - RET_CODE=$? - touch /var/lock/subsys/$NAME - return $RET_CODE -} - -stop() { - echo -n "Shutting down $NAME: " - killproc -p $PIDFILE $DAEMON - RET_CODE=$? - rm -f /var/lock/subsys/$NAME - return $RET_CODE -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - # Note: "-p" option is required to detect the status correctly! - # (otherwise it fails by too long $NAME - maybe.) - status -p $PIDFILE $NAME - ;; - restart) - stop - start - ;; - *) - echo "Usage: $NAME {start|stop|status|reload|restart[|probe]" - exit 1 - ;; -esac -exit $? Deleted: install/centos/functions.sh (+0 -31) 100755 =================================================================== --- install/centos/functions.sh 2016-01-13 23:54:35 +0900 (b165c06) +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (C) 2014-2015 Droonga Project -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License version 2.1 as published by the Free Software Foundation. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -register_service() { - local NAME=$1 - local USER=$2 - local GROUP=$3 - - #TODO: we should migrate to systemd in near future... - - curl -s -o /etc/rc.d/init.d/$NAME $(download_url "install/centos/$NAME") - if [ $? -ne 0 ]; then - echo "ERROR: Failed to download service script!" - exit 1 - fi - - chmod +x /etc/rc.d/init.d/$NAME - /sbin/chkconfig --add $NAME -} Deleted: install/debian/droonga-http-server (+0 -166) 100755 =================================================================== --- install/debian/droonga-http-server 2016-01-13 23:54:35 +0900 (8d9fc14) +++ /dev/null @@ -1,166 +0,0 @@ -#! /bin/sh -### BEGIN INIT INFO -# Provides: droonga-engine -# Required-Start: $remote_fs $syslog -# Required-Stop: $remote_fs $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: A HTTP Protocol Adapter for Droonga -### END INIT INFO - -# Do NOT "set -e" - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -DESC="" -NAME=droonga-http-server -USER=$NAME -GROUP=droonga -DAEMON=/usr/local/bin/$NAME -export DROONGA_BASE_DIR=/home/$NAME/droonga -PIDFILE=/var/run/$NAME/$NAME.pid -DAEMON_ARGS="--daemon --pid-file=$PIDFILE" -SCRIPTNAME=/etc/init.d/$NAME - -# This directory is required to write PID file by non-root user. -pid_dir=/var/run/$NAME -mkdir -p $pid_dir -chown -R $USER:$GROUP $pid_dir - -# 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 -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.2-14) to ensure that this file is present -# and status_of_proc is working. -. /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 --pidfile $PIDFILE --exec $DAEMON --user $USER --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --user $USER --chuid $USER:$GROUP --chdir $DROONGA_BASE_DIR -- \ - $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 - # NOTE: don't specify "--name $NAME" for this service, because you'll see an error like: - # > start-stop-daemon: warning: this system is not able to track process names - # > longer than 15 characters, please use --exec instead of --name. - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --exec /usr/bin/nodejs - 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) - [ "$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 - ;; - status) - # NOTE: we must specify "-p $PIDFILE" option to track the status correctly - # because we use "--exec" instead of "--name $NAME" - # to start the daemon. - status_of_proc -p $PIDFILE "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - #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|status|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: Deleted: install/debian/functions.sh (+0 -29) 100755 =================================================================== --- install/debian/functions.sh 2016-01-13 23:54:35 +0900 (e5a3e59) +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (C) 2014-2015 Droonga Project -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License version 2.1 as published by the Free Software Foundation. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -register_service() { - local NAME=$1 - local USER=$2 - local GROUP=$3 - - curl -s -o /etc/init.d/$NAME $(download_url "install/debian/$NAME") - if [ $? -ne 0 ]; then - echo "ERROR: Failed to download service script!" - exit 1 - fi - - chmod +x /etc/init.d/$NAME - update-rc.d $NAME defaults -} -------------- next part -------------- HTML����������������������������...ダウンロード