Add a custom initctl script to fix Ubuntu 14.04. Disable 12.04

This commit is contained in:
Oskar Schöldström 2016-02-04 12:57:55 -05:00
parent 7038d6ed61
commit 6e9b80c193
4 changed files with 35 additions and 6 deletions

View file

@ -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})"

View file

@ -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

View file

@ -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

23
tests/initctl_faker Normal file
View file

@ -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