setup_openrc.sh 1.0 KB

12345678910111213141516171819202122
  1. #!/bin/sh
  2. # thanks https://github.com/neeravkumar/dockerfiles/blob/master/alpine-openrc/Dockerfile
  3. # Tell openrc its running inside a container, till now that has meant LXC
  4. sed -i 's/#rc_sys=""/rc_sys="lxc"/g' /etc/rc.conf
  5. # Tell openrc loopback and net are already there, since docker handles the networking
  6. echo 'rc_provide="loopback net"' >> /etc/rc.conf
  7. # can't get ttys unless you run the container in privileged mode
  8. sed -i '/tty/d' /etc/inittab
  9. # can't set hostname since docker sets it
  10. sed -i '/hostname $opts/d' /etc/init.d/hostname
  11. # can't mount tmpfs since not privileged
  12. sed -i '/mount -t tmpfs/d' /lib/rc/sh/init.sh
  13. # can't do cgroups
  14. sed -i '/cgroup_add_service$/d' /lib/rc/sh/openrc-run.sh
  15. sed -i '/^ntpd/d' /bootstrap/start.sh
  16. echo -e 'log_errors = On\nerror_log = syslog' >> /etc/php7/php.ini
  17. sed -i -r 's@ErrorLog .*@ErrorLog "|/usr/bin/logger -n syslog -T -P 514 -t apacheErr"@i' \
  18. /etc/apache2/httpd.conf
  19. echo 'TransferLog "|/usr/bin/logger -n syslog -T -P 514 -t apacheLog"' \
  20. >> /etc/apache2/httpd.conf