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