Also makes this work for various systemd config files that support .d. (cherry picked from commit 28365e88)