Skip to content

Commit

Permalink
Update alignak packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
mohierf authored and Sebastien Coavoux committed Mar 22, 2017
1 parent 1852d02 commit 773b8fc
Show file tree
Hide file tree
Showing 25 changed files with 1,917 additions and 37 deletions.
6 changes: 0 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,3 @@ This repository contains the materials to build alignak-related packages. Each d
For easy building each supported GNU/Linux distribution has a docker image prepared will build dependencies installed.

You can find the docker repository here : https://github.com/Alignak-monitoring/alignak-docker.git

A Makefile is provided to help you build docker images (make build) and build the packages (make package)
Images are also available on dockerhub under the organization alignak



17 changes: 0 additions & 17 deletions alignak/MANIFEST.in

This file was deleted.

7 changes: 5 additions & 2 deletions alignak/alignak.spec
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ Alignak is a new monitoring tool written in Python.
The main goal of Alignak is to allow users to have a fully flexible
architecture for their monitoring system that can easily scale to large
environments.
Alignak also provide interfaces with NDODB and Merlin database,
Livestatus connector Alignak does not include any human interfaces.
Alignak has several extensions to enrich its standard features:
- a full REST backend that allows to store the monitoring configuration and the live state
- a Web User interface to view and edit the monitored objects
- modules to extend the basic monitoring features: external commands, logs, ...
- checks packages to easily set-up new monitoring objects

%package all
Summary: Alignak Common files
Expand Down
21 changes: 16 additions & 5 deletions alignak/debian/alignak-all.install
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
#bin/init.d/alignak* /etc/init.d/
#etc/default/alignak
etc/daemons/* /etc/alignak/daemons/
etc/certs/* /etc/alignak/certs/
# Define files to install:
# from to
# ---

# systemd files: we use systemd as a default system loader
# comments in this section must be inverted if we do not want to use systemd...
systemd/* /lib/systemd/system/
#systemV/default/alignak /etc/default/alignak/
#systemV/init.d/alignak* /etc/init.d/

# alignak default configuration files
etc/alignak.cfg /etc/alignak/
etc/alignak.ini /etc/alignak/
etc/arbiter/* /etc/alignak/arbiter
systemd/* /lib/systemd/system/
etc/daemons/* /etc/alignak/daemons/
etc/certs/* /etc/alignak/certs/
# Do not copy the samples files - useful to copy?
#etc/samples /etc/alignak/samples
18 changes: 13 additions & 5 deletions alignak/debian/alignak-all.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

case "$1" in
configure)
## Create user and group
# Note: if the user exists, it's properties won't be changed (gid, home, shell)
adduser --quiet --system --home /var/lib/alignak --no-create-home --group alignak || true
## Create alignak user and group
# Note: if the user exists, his properties won't be changed (gid, home, shell)
adduser --quiet --system --home /var/lib/alignak --no-create-home --group alignak || true

## Create nagios group
addgroup --system nagios || true
Expand All @@ -43,16 +43,15 @@ case "$1" in
fi
done

# SysV part
if [ -f /etc/default/alignak ]; then
## System V part
sed -e 's:ETC=.*:ETC=/etc/alignak:g' \
-e 's:VAR=.*:VAR=/var/lib/alignak:g' \
-e 's:BIN=.*:BIN=/usr/bin:g' \
-e 's:RUN=.*:RUN=/var/run/alignak:g' \
-e 's:LOG=.*:LOG=/var/log/alignak:g' \
-i /etc/default/alignak


## Ensure alignak starts automatically
update-rc.d -f alignak-arbiter defaults > /dev/null
update-rc.d -f alignak-scheduler defaults > /dev/null
Expand All @@ -63,6 +62,7 @@ case "$1" in
update-rc.d -f alignak defaults > /dev/null

else
## Systemd part
systemctl daemon-reload > /dev/null || :
systemctl enable alignak-arbiter > /dev/null || :
systemctl enable alignak-scheduler > /dev/null || :
Expand All @@ -72,6 +72,14 @@ case "$1" in
systemctl enable alignak-receiver > /dev/null || :
fi

## Update Alignak configuration paths.cfg
sed -e 's:$ETC$=.*:$ETC$=/etc/alignak:g' \
-e 's:$VAR$=.*:$VAR$=/var/lib/alignak:g' \
-e 's:$RUN$=.*:$RUN$=/var/run/alignak:g' \
-e 's:$LOG$=.*:$LOG$=/var/log/alignak:g' \
-i /etc/alignak/arbiter/resource.d/paths.cfg

## Update Alignak daemons configuration files
for inifiles in /etc/alignak/daemons/*.ini; do
sed -e 's:workdir=.*:workdir=/var/run/alignak:g' \
-e 's:logdir=.*:logdir=/var/log/alignak:g' \
Expand Down
4 changes: 2 additions & 2 deletions alignak/debian/copyright
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ Source: https://alignak-monitoring.github.io/

Files: *
Copyright:
2015-2015 Alignak team
2015-2017 Alignak team
2009-2014 Shinken team
Please see THANKS and AUTHORS for full list of contributors
License: AGPL-3.0+



Files: debian/*
Copyright: 2015 Sebastien Coavoux <[email protected]>
Copyright: 2015-2017 Sebastien Coavoux <[email protected]>
License: GPL-2


Expand Down
42 changes: 42 additions & 0 deletions for_freebsd/alignak-arbiter
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/sh

# $FreeBSD$
#
# PROVIDE: alignak_arbiter
# REQUIRE: LOGIN
# KEYWORD: shutdown

. /etc/rc.subr

name="alignak_arbiter"
rcvar="alignak_arbiter_enable"

alignak_arbiter_daemonfile="/usr/local/etc/alignak/daemons/arbiterd.ini"
alignak_arbiter_configfile="/usr/local/etc/alignak/alignak.cfg"
command="/usr/local/bin/alignak-arbiter"
command_interpreter="/usr/local/bin/python2.7"
command_args="-d -c ${alignak_arbiter_daemonfile} -a ${alignak_arbiter_configfile} > /dev/null 2>&1"
pidfile="/var/run/alignak/arbiterd.pid"

restart_precmd="alignak_checkconfig"
configtest_cmd="alignak_checkconfig"

required_files="${alignak_arbiter_configfile}"
extra_commands="configtest"

load_rc_config "${name}"

[ -z "${alignak_arbiter_enable}" ] && alignak_arbiter_enable="NO"

alignak_checkconfig() {
echo -n "Performing sanity check on alignak configuration: "
${command} -V -a ${alignak_arbiter_configfile} >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "FAILED"
return 1
else
echo "OK"
fi
}

run_rc_command "$1"
26 changes: 26 additions & 0 deletions for_freebsd/alignak-broker
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh

# $FreeBSD$
#
# PROVIDE: alignak_broker
# REQUIRE: LOGIN
# KEYWORD: shutdown

. /etc/rc.subr

name="alignak_broker"
rcvar="alignak_broker_enable"

alignak_broker_configfile="/usr/local/etc/alignak/daemons/brokerd.ini"
command="/usr/local/bin/alignak-broker"
command_interpreter="/usr/local/bin/python2.7"
command_args="-d -c ${alignak_broker_configfile} > /dev/null 2>&1"
pidfile="/var/run/alignak/brokerd.pid"

required_files="${alignak_broker_configfile}"

load_rc_config "${name}"

[ -z "${alignak_broker_enable}" ] && alignak_broker_enable="NO"

run_rc_command "$1"
26 changes: 26 additions & 0 deletions for_freebsd/alignak-poller
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh

# $FreeBSD$
#
# PROVIDE: alignak_poller
# REQUIRE: LOGIN
# KEYWORD: shutdown

. /etc/rc.subr

name="alignak_poller"
rcvar="alignak_poller_enable"

alignak_poller_configfile="/usr/local/etc/alignak/daemons/pollerd.ini"
command="/usr/local/bin/alignak-poller"
command_interpreter="/usr/local/bin/python2.7"
command_args="-d -c ${alignak_poller_configfile} > /dev/null 2>&1"
pidfile="/var/run/alignak/pollerd.pid"

required_files="${alignak_poller_configfile}"

load_rc_config "${name}"

[ -z "${alignak_poller_enable}" ] && alignak_poller_enable="NO"

run_rc_command "$1"
26 changes: 26 additions & 0 deletions for_freebsd/alignak-reactionner
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh

# $FreeBSD$
#
# PROVIDE: alignak_reactionner
# REQUIRE: LOGIN
# KEYWORD: shutdown

. /etc/rc.subr

name="alignak_reactionner"
rcvar="alignak_reactionner_enable"

alignak_reactionner_configfile="/usr/local/etc/alignak/daemons/reactionnerd.ini"
command="/usr/local/bin/alignak-reactionner"
command_interpreter="/usr/local/bin/python2.7"
command_args="-d -c ${alignak_reactionner_configfile} > /dev/null 2>&1"
pidfile="/var/run/alignak/reactionnerd.pid"

required_files="${alignak_reactionner_configfile}"

load_rc_config "${name}"

[ -z "${alignak_reactionner_enable}" ] && alignak_reactionner_enable="NO"

run_rc_command "$1"
26 changes: 26 additions & 0 deletions for_freebsd/alignak-receiver
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh

# $FreeBSD$
#
# PROVIDE: alignak_receiver
# REQUIRE: LOGIN
# KEYWORD: shutdown

. /etc/rc.subr

name="alignak_receiver"
rcvar="alignak_receiver_enable"

alignak_receiver_configfile="/usr/local/etc/alignak/daemons/receiverd.ini"
command="/usr/local/bin/alignak-receiver"
command_interpreter="/usr/local/bin/python2.7"
command_args="-d -c ${alignak_receiver_configfile} > /dev/null 2>&1"
pidfile="/var/run/alignak/receiverd.pid"

required_files="${alignak_receiver_configfile}"

load_rc_config "${name}"

[ -z "${alignak_receiver_enable}" ] && alignak_receiver_enable="NO"

run_rc_command "$1"
26 changes: 26 additions & 0 deletions for_freebsd/alignak-scheduler
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh

# $FreeBSD$
#
# PROVIDE: alignak_scheduler
# REQUIRE: LOGIN
# KEYWORD: shutdown

. /etc/rc.subr

name="alignak_scheduler"
rcvar="alignak_scheduler_enable"

alignak_scheduler_configfile="/usr/local/etc/alignak/daemons/schedulerd.ini"
command="/usr/local/bin/alignak-scheduler"
command_interpreter="/usr/local/bin/python2.7"
command_args="-d -c ${alignak_scheduler_configfile} > /dev/null 2>&1"
pidfile="/var/run/alignak/schedulerd.pid"

required_files="${alignak_scheduler_configfile}"

load_rc_config "${name}"

[ -z "${alignak_scheduler_enable}" ] && alignak_scheduler_enable="NO"

run_rc_command "$1"
Loading

0 comments on commit 773b8fc

Please sign in to comment.