From 0430a304f15192fa7cb957c8ca6eeed8bbb1c4b0 Mon Sep 17 00:00:00 2001 From: Gardar Thorsteinsson Date: Thu, 26 Sep 2019 11:51:36 +0000 Subject: [PATCH] Readme updated --- Dockerfile | 19 ++++--------------- README.md | 12 ++++++++++++ naemon-supervisor-wrapper.sh | 11 ----------- run.sh | 3 ++- supervisord.conf | 34 ---------------------------------- 5 files changed, 18 insertions(+), 61 deletions(-) delete mode 100644 naemon-supervisor-wrapper.sh delete mode 100644 supervisord.conf diff --git a/Dockerfile b/Dockerfile index 0e478fb..7ba5633 100644 --- a/Dockerfile +++ b/Dockerfile @@ -120,26 +120,15 @@ RUN systemctl enable naemon #RUN pip install supervisor-quick # Remove cache and default passwd files -RUN rm -rf /var/cache/yum /etc/nagios/passwd /etc/thruk/htpasswd - -# Copy supervisor config over to the container -#COPY supervisord.conf /etc/supervisord.conf - -# Copy custom supervisor init.d script (for nagios start|stop) -#COPY naemon-supervisor-wrapper.sh /usr/bin/naemon-supervisor-wrapper.sh -#RUN sed -i 's|^\(nagios_init_script\)=\(.*\)$|\1="sudo /usr/bin/naemon-supervisor-wrapper.sh"|g' /etc/adagios/adagios.conf -#RUN echo "naemon ALL=NOPASSWD: /usr/bin/naemon-supervisor-wrapper.sh" >> /etc/sudoers - -# Create childlogdir -#RUN mkdir /var/log/supervisor +RUN rm -rf /var/cache/yum /etc/nagios/passwd # Copy over our custom init script #COPY run.sh /usr/bin/run.sh -# Make run.sh and supervisor wrapper script executable -#RUN chmod 755 /usr/bin/run.sh /usr/bin/naemon-supervisor-wrapper.sh +# Make run.sh script executable +#RUN chmod 755 /usr/bin/run.sh -#WORKDIR /etc/naemon +WORKDIR /etc/naemon #ENTRYPOINT ["/bin/bash", "/usr/bin/run.sh"] diff --git a/README.md b/README.md index fcdd3b0..2d17a71 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,18 @@ docker create \ Log in with user `thrukadmin` and password `thrukadmin` +## Building + +``` +git clone https://github.com/opinkerfi/docker-adagios-rpm.git +cd docker-adagios-rpm +docker build -t adagios_systemd_image . +docker run --cap-add=SYS_ADMIN --name adagios -v /sys/fs/cgroup:/sys/fs/cgroup -p 8080:80 -d adagios_systemd_image +``` + +Then you should be able to access http://localhost:8080 +Log in with user `thrukadmin` and password `thrukadmin` + ## Parameters The parameters are split into two halves, separated by a colon, the left hand side representing the host and the right the container side. diff --git a/naemon-supervisor-wrapper.sh b/naemon-supervisor-wrapper.sh deleted file mode 100644 index ac0162b..0000000 --- a/naemon-supervisor-wrapper.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -if [[ "$1" = "status" ]] -then - # We need to return 1 if naemon is not running - status=$(supervisorctl status naemon) - echo $status - grep RUNNING > /dev/null <<< "$status" -else - supervisorctl "$1" naemon -fi diff --git a/run.sh b/run.sh index 0937cdf..ac1fa18 100644 --- a/run.sh +++ b/run.sh @@ -47,4 +47,5 @@ do [[ -x "$script" ]] && "$script" done -exec /usr/bin/supervisord -n -c /etc/supervisord.conf \ No newline at end of file +#systemctl restart httpd +#systemctl restart naemon diff --git a/supervisord.conf b/supervisord.conf deleted file mode 100644 index 3cf34c1..0000000 --- a/supervisord.conf +++ /dev/null @@ -1,34 +0,0 @@ -[unix_http_server] -file=/var/run/supervisor.sock - -[inet_http_server] -port=127.0.0.1:9001 - -[supervisord] -logfile=/var/log/supervisord.log -loglevel=info -pidfile=/var/run/supervisord.pid -nodaemon=false -childlogdir=/var/log/supervisor - -[rpcinterface:supervisor] -supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface - -[supervisorctl] -serverurl=unix:///var/run/supervisor.sock - -[ctlplugin:quick] -supervisor.ctl_factory = supervisor_quick:make_quick_controllerplugin - -[program:httpd] -command=/usr/sbin/httpd -c "ErrorLog /dev/stdout" -DFOREGROUND -redirect_stderr=true - -[program:naemon] -command=/usr/bin/naemon /etc/naemon/naemon.cfg - -[program:npcd] -command=/usr/sbin/npcd -f /etc/pnp4nagios/npcd.cfg - -[group:naemon] -programs=httpd,naemon,npcd \ No newline at end of file