Skip to content

Commit 6e9b80c

Browse files
committed
Add a custom initctl script to fix Ubuntu 14.04. Disable 12.04
1 parent 7038d6e commit 6e9b80c

File tree

4 files changed

+35
-6
lines changed

4 files changed

+35
-6
lines changed

.travis.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ env:
1717
init: /sbin/init
1818
run_opts: ""
1919
playbook: test.yml
20-
- distribution: ubuntu
21-
version: 12.04
22-
init: /sbin/init
23-
run_opts: ""
24-
playbook: test.yml
20+
# - distribution: ubuntu
21+
# version: 12.04
22+
# init: /sbin/init
23+
# run_opts: ""
24+
# playbook: test.yml
2525

2626
services:
2727
- docker
@@ -70,4 +70,4 @@ script:
7070
|| (echo 'MySQL not running' && exit 1)
7171
7272
# Clean up
73-
- 'sudo docker stop "$(cat ${container_id})"'
73+
- sudo docker stop "$(cat ${container_id})"

tests/Dockerfile.ubuntu-12.04

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@ RUN apt-add-repository -y ppa:ansible/ansible
77
RUN apt-get update
88
RUN apt-get install -y ansible
99

10+
COPY initctl_faker .
11+
RUN chmod +x initctl_faker && rm -fr /sbin/initctl && ln -s /initctl_faker /sbin/initctl
12+
1013
# Install Ansible inventory file
1114
RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts

tests/Dockerfile.ubuntu-14.04

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@ RUN apt-add-repository -y ppa:ansible/ansible
77
RUN apt-get update
88
RUN apt-get install -y ansible
99

10+
COPY initctl_faker .
11+
RUN chmod +x initctl_faker && rm -fr /sbin/initctl && ln -s /initctl_faker /sbin/initctl
12+
1013
# Install Ansible inventory file
1114
RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts

tests/initctl_faker

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/sh
2+
ALIAS_CMD="$(echo ""$0"" | sed -e 's?/sbin/??')"
3+
4+
case "$ALIAS_CMD" in
5+
start|stop|restart|reload|status)
6+
exec service $1 $ALIAS_CMD
7+
;;
8+
esac
9+
10+
case "$1" in
11+
list )
12+
exec service --status-all
13+
;;
14+
reload-configuration )
15+
exec service $2 restart
16+
;;
17+
start|stop|restart|reload|status)
18+
exec service $2 $1
19+
;;
20+
\?)
21+
exit 0
22+
;;
23+
esac

0 commit comments

Comments
 (0)