From 6e9b80c1939fd778d020372bc95cfc8897c6dc47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Thu, 4 Feb 2016 12:57:55 -0500 Subject: [PATCH] Add a custom initctl script to fix Ubuntu 14.04. Disable 12.04 --- .travis.yml | 12 ++++++------ tests/Dockerfile.ubuntu-12.04 | 3 +++ tests/Dockerfile.ubuntu-14.04 | 3 +++ tests/initctl_faker | 23 +++++++++++++++++++++++ 4 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 tests/initctl_faker diff --git a/.travis.yml b/.travis.yml index 2d7eed5..e8e064c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,11 +17,11 @@ env: init: /sbin/init run_opts: "" playbook: test.yml - - distribution: ubuntu - version: 12.04 - init: /sbin/init - run_opts: "" - playbook: test.yml + # - distribution: ubuntu + # version: 12.04 + # init: /sbin/init + # run_opts: "" + # playbook: test.yml services: - docker @@ -70,4 +70,4 @@ script: || (echo 'MySQL not running' && exit 1) # Clean up - - 'sudo docker stop "$(cat ${container_id})"' + - sudo docker stop "$(cat ${container_id})" diff --git a/tests/Dockerfile.ubuntu-12.04 b/tests/Dockerfile.ubuntu-12.04 index d0c130c..8aebd65 100644 --- a/tests/Dockerfile.ubuntu-12.04 +++ b/tests/Dockerfile.ubuntu-12.04 @@ -7,5 +7,8 @@ RUN apt-add-repository -y ppa:ansible/ansible RUN apt-get update RUN apt-get install -y ansible +COPY initctl_faker . +RUN chmod +x initctl_faker && rm -fr /sbin/initctl && ln -s /initctl_faker /sbin/initctl + # Install Ansible inventory file RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts diff --git a/tests/Dockerfile.ubuntu-14.04 b/tests/Dockerfile.ubuntu-14.04 index ca33287..f81cabe 100644 --- a/tests/Dockerfile.ubuntu-14.04 +++ b/tests/Dockerfile.ubuntu-14.04 @@ -7,5 +7,8 @@ RUN apt-add-repository -y ppa:ansible/ansible RUN apt-get update RUN apt-get install -y ansible +COPY initctl_faker . +RUN chmod +x initctl_faker && rm -fr /sbin/initctl && ln -s /initctl_faker /sbin/initctl + # Install Ansible inventory file RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts diff --git a/tests/initctl_faker b/tests/initctl_faker new file mode 100644 index 0000000..a2267f3 --- /dev/null +++ b/tests/initctl_faker @@ -0,0 +1,23 @@ +#!/bin/sh +ALIAS_CMD="$(echo ""$0"" | sed -e 's?/sbin/??')" + +case "$ALIAS_CMD" in + start|stop|restart|reload|status) + exec service $1 $ALIAS_CMD + ;; +esac + +case "$1" in + list ) + exec service --status-all + ;; + reload-configuration ) + exec service $2 restart + ;; + start|stop|restart|reload|status) + exec service $2 $1 + ;; + \?) + exit 0 + ;; +esac