Add another path for service files

In opensuse the service files are located in /usr/lib rather than /lib. This change adds this path
as an option.

Change-Id: I99c2db557a2290c3860bb41233d7efc35d03be0b
This commit is contained in:
sayalilunkad 2018-01-31 18:50:08 +01:00
parent fd70072385
commit 2c60bbf6d5
1 changed files with 6 additions and 1 deletions

View File

@ -44,7 +44,12 @@ exec os-collect-config 2>&1 | logger -t os-collect-config
eof
elif [ "$DIB_INIT_SYSTEM" == "systemd" ] ; then
cat > /lib/systemd/system/os-collect-config.service <<eof
if [ -d "/lib/systemd" ]; then
path=/lib/systemd/system/os-collect-config.service
else
path=/usr/lib/systemd/system/os-collect-config.service
fi
cat > $path <<eof
[Unit]
Description=Collect metadata and run hook commands.
After=cloud-config.service