Let unbound find rc.local on Debian stretch in DIB

Building an image for stretch results in the unbound configuration
script throwing an error, that it cannot know where to find rc.local.
This happens, because the file is missing in the installed image.

The script now checks for /etc/debian_version instead of erroring out.
This file is available on any debian system. If there's no rc.local and
/etc/debian_version is available, rc.local can just be created with the
appropriate content, /etc/rc.local is executed on Debian.

Change-Id: If98f7ef1657b4f538a4f79ba116c8cff991aefc7
This commit is contained in:
Johannes Kulik 2017-06-22 11:19:08 +02:00
parent 2a2e54e2f1
commit 19232d7ef5
1 changed files with 2 additions and 2 deletions

View File

@ -64,7 +64,7 @@ chmod 0644 /var/log/unbound.log
#
# On Redhat systems, systemd's rc-local service looks for an
# executable /etc/rc.d/rc.local file to run. On Debian/Ubuntu, the
# eqivalent file is /etc/rc.local.
# eqivalent file is /etc/rc.local, which is missing on Debian stretch.
#
# Centos' systemd package symlinks /etc/rc.local to /etc/rc.d/rc.local
# correctly. Fedora, however, does not come with an rc.local file at
@ -76,7 +76,7 @@ chmod 0644 /var/log/unbound.log
# details on all this. As at 2016-10-18 is unresolved.
#
# [1] https://bugzilla.redhat.com/show_bug.cgi?id=1386052
if [[ ! -e /etc/rc.local ]]; then
if [[ ! -e /etc/rc.local ]] && [[ ! -e /etc/debian_version ]]; then
if [[ ! -d /etc/rc.d ]]; then
echo "No rc.local and no rc.d directory! See comments in 89-unbound"
exit 1