Skip to content

Instantly share code, notes, and snippets.

@Markbnj
Created September 15, 2015 06:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Markbnj/f9aaabecead17bc3b7d7 to your computer and use it in GitHub Desktop.
Save Markbnj/f9aaabecead17bc3b7d7 to your computer and use it in GitHub Desktop.
Allow services to start in an Ubuntu 15.04 Docker container
# By default the /usr/sbin/policy-rc.d script in the ubuntu:15.04 docker image is set to return 101
# (action forbidden by policy) every time it is invoked. This prevents systemctl start requests for
# services from completing succesfully. The following command overwrites the contents of policy-rc.d
# to allow service starts.
#
# Note that this won't work right under bash due to expansion of the '!' character. Docker uses sh
# by default when executing the commands in the dockerfile, so this will work there, and you can
# also use sh interactively to run this.
echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment