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

Updated sysvinit scripts #1126

Open
wants to merge 4 commits into
base: develop
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
527 changes: 27 additions & 500 deletions bin/systemV/init.d/alignak

Large diffs are not rendered by default.

126 changes: 51 additions & 75 deletions bin/systemV/init.d/alignak-arbiter
Original file line number Diff line number Diff line change
@@ -1,83 +1,59 @@
#!/bin/sh
#
# Copyright (C) 2015-2016: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Alignak 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Alignak. If not, see <http://www.gnu.org/licenses/>.
#
#
# This file incorporates work covered by the following copyright and
# permission notice:
#
# Copyright (C) 2009-2014:
# Gabes Jean, [email protected]
# Gerhard Lausser, [email protected]
# Gregory Starck, [email protected]
# Hartmut Goebel, [email protected]
#
# This file is part of Shinken.
#
# Shinken is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Shinken 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Shinken. If not, see <http://www.gnu.org/licenses/>.

# Initially generated by sysd2v v0.3 -- http://www.trek.eu.org/devel/sysd2v
### BEGIN INIT INFO
# Provides: alignak-arbiter
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Alignak arbiter daemon
# Description: Alignak is a monitoring tool and the Arbiter
# is one of its daemon. This one reads the configuration,
# cuts it into parts and dispatches it. Then it waits
# for orders from the users to dispatch them too.
# Provides: alignak-arbiter
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Alignak arbiter daemon instance
### END INIT INFO

### Chkconfig Header
# Alignak Starts Alignak Arbiter
#
# chkconfig: 345 99 01
# description: Start Alignak arbiter daemon
# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
fi
set -a
ALIGNAK_CONFIGURATION_FILE=/usr/local/share/alignak/etc/alignak.ini
ALIGNAK_USER=alignak
ALIGNAK_GROUP=alignak
[ -r /etc/default/alignak ] && . /etc/default/alignak

# Alignak debs get installed inside "site-packages", but Debian's Python doesn't include it inside sys.path
# So let's find out which Python Alignak is going to use
PYTHONVER=$( /usr/bin/env python -V 2>&1 | cut -d' ' -f 2 | cut -d. -f 1,2 )
PYTHONPATH=/usr/local/lib/python$PYTHONVER/site-packages
set +a

NAME=arbiter-master
DESC=alignak-arbiter
DAEMON=/usr/local/bin/alignak-arbiter
PIDFILE=/var/run/alignak/arbiter-master.pid
LOGFILE=/var/log/alignak/arbiter-master.log
DAEMON_ARGS="-d -n ${NAME} -e "${ALIGNAK_CONFIGURATION_FILE}" -i ${PIDFILE} -l ${LOGFILE}"

# Author: Gabes Jean <[email protected]>
# Olivier LI-KIANG-CHEONG <[email protected]>
do_start_cmd_override() {
/bin/mkdir -p /var/log/alignak || return 2
/bin/chown -R ${ALIGNAK_USER}:${ALIGNAK_GROUP} /var/log/alignak || return 2
/bin/chmod 775 /var/log/alignak || return 2
/bin/mkdir -p /var/run/alignak || return 2
/bin/chown -R ${ALIGNAK_USER}:${ALIGNAK_GROUP} /var/run/alignak || return 2
/bin/chmod 775 /var/run/alignak || return 2
do_start_cmd || return $?
}

SHORTNAME=arbiter
NAME="alignak-$SHORTNAME"
SCRIPT=$(readlink -f "$0")
curdir=$(dirname "$SCRIPT")
do_status_override() {
status_of_proc -p "$PIDFILE" "$DAEMON" "$NAME" && return 0 || return $?
}

export ALIGNAK_MODULE_FILE="$NAME" ## for 'alignak' init script to see that it's called by us
do_stop_cmd_override() {
start-stop-daemon --stop --quiet --pidfile "$PIDFILE" --user "$ALIGNAK_USER" || return 2
}

case "$1" in
start|stop|reload|restart|force-reload|status|check|checkconfig)
"$curdir/alignak" $@ "$SHORTNAME"
exit $?
;;
*)
echo "Usage: /etc/init.d/$NAME [-d] {start|stop|reload|restart|force-reload|status|check}"
exit 1
;;
esac
do_reload() {
log_daemon_msg "Reloading $DESC configuration files" "$NAME"
start-stop-daemon --stop --signal HUP --quiet --pidfile "$PIDFILE" --user "$ALIGNAK_USER"
log_end_msg $?
}
126 changes: 51 additions & 75 deletions bin/systemV/init.d/alignak-broker
Original file line number Diff line number Diff line change
@@ -1,83 +1,59 @@
#!/bin/sh
#
# Copyright (C) 2015-2016: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Alignak 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Alignak. If not, see <http://www.gnu.org/licenses/>.
#
#
# This file incorporates work covered by the following copyright and
# permission notice:
#
# Copyright (C) 2009-2014:
# Gabes Jean, [email protected]
# Gerhard Lausser, [email protected]
# Gregory Starck, [email protected]
# Hartmut Goebel, [email protected]
#
# This file is part of Shinken.
#
# Shinken is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Shinken 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Shinken. If not, see <http://www.gnu.org/licenses/>.

# Initially generated by sysd2v v0.3 -- http://www.trek.eu.org/devel/sysd2v
### BEGIN INIT INFO
# Provides: alignak-broker
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Alignak broker daemon
# Description: Alignak is a monitoring tool and the Broker
# is one of its daemon. This one gets the configuration from the arbiter
# His purpose is to get the broks from the schedulers specified in the
# configuration
# Provides: alignak-broker
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Alignak broker daemon instance
### END INIT INFO

### Chkconfig Header
# Alignak Starts Alignak Broker
#
# chkconfig: 345 99 01
# description: Start Alignak broker daemon
# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
fi
set -a
ALIGNAK_CONFIGURATION_FILE=/usr/local/share/alignak/etc/alignak.ini
ALIGNAK_USER=alignak
ALIGNAK_GROUP=alignak
[ -r /etc/default/alignak ] && . /etc/default/alignak

# Alignak debs get installed inside "site-packages", but Debian's Python doesn't include it inside sys.path
# So let's find out which Python Alignak is going to use
PYTHONVER=$( /usr/bin/env python -V 2>&1 | cut -d' ' -f 2 | cut -d. -f 1,2 )
PYTHONPATH=/usr/local/lib/python$PYTHONVER/site-packages
set +a

NAME=broker-master
DESC=alignak-broker
DAEMON=/usr/local/bin/alignak-broker
PIDFILE=/var/run/alignak/broker-master.pid
LOGFILE=/var/log/alignak/broker-master.log
DAEMON_ARGS="-d -n ${NAME} -e "${ALIGNAK_CONFIGURATION_FILE}" -i ${PIDFILE} -l ${LOGFILE}"

# Author: Gabes Jean <[email protected]>
# Olivier LI-KIANG-CHEONG <[email protected]>
do_start_cmd_override() {
/bin/mkdir -p /var/log/alignak || return 2
/bin/chown -R ${ALIGNAK_USER}:${ALIGNAK_GROUP} /var/log/alignak || return 2
/bin/chmod 775 /var/log/alignak || return 2
/bin/mkdir -p /var/run/alignak || return 2
/bin/chown -R ${ALIGNAK_USER}:${ALIGNAK_GROUP} /var/run/alignak || return 2
/bin/chmod 775 /var/run/alignak || return 2
do_start_cmd || return $?
}

SHORTNAME=broker
NAME="alignak-$SHORTNAME"
SCRIPT=$(readlink -f "$0")
curdir=$(dirname "$SCRIPT")
do_status_override() {
status_of_proc -p "$PIDFILE" "$DAEMON" "$NAME" && return 0 || return $?
}

export ALIGNAK_MODULE_FILE="$NAME" ## for 'alignak' init script to see that it's called by us
do_stop_cmd_override() {
start-stop-daemon --stop --quiet --pidfile "$PIDFILE" --user "$ALIGNAK_USER" || return 2
}

case "$1" in
start|stop|reload|restart|force-reload|status|check|checkconfig)
"$curdir/alignak" $@ "$SHORTNAME"
exit $?
;;
*)
echo "Usage: /etc/init.d/$NAME [-d] {start|stop|reload|restart|force-reload|status|check}"
exit 1
;;
esac
do_reload() {
log_daemon_msg "Reloading $DESC configuration files" "$NAME"
start-stop-daemon --stop --signal HUP --quiet --pidfile "$PIDFILE" --user "$ALIGNAK_USER"
log_end_msg $?
}
Loading