coreos-base/coreos-oem-gce: notify when all daemons are running

Since /run/systemd is mounted from the host, the notify socket will
update the host's agent service.  Also, since systemd-notify is run
by the "init" shell script, it uses the correct MainPID by default.
This commit is contained in:
David Michael 2017-04-20 13:12:15 -07:00
parent fb89db40ae
commit 81e717d84e
2 changed files with 4 additions and 0 deletions

View File

@ -27,6 +27,9 @@ do
/usr/bin/google_${d}_daemon & daemon_pids+=($!) /usr/bin/google_${d}_daemon & daemon_pids+=($!)
done done
# Notify the host that everything is running.
NOTIFY_SOCKET=/run/systemd/notify /usr/bin/systemd-notify --ready
# Pause while the daemons are running, and stop them all when one dies. # Pause while the daemons are running, and stop them all when one dies.
wait -n "${daemon_pids[@]}" || : wait -n "${daemon_pids[@]}" || :
kill "${daemon_pids[@]}" || : kill "${daemon_pids[@]}" || :
@ -48,4 +51,5 @@ session optional pam_permit.so
EOF EOF
# Don't bundle these paths, since they are useless to us. # Don't bundle these paths, since they are useless to us.
mv usr/lib64/systemd/lib*.so* usr/lib64/
rm -fr boot etc/* usr/lib64/systemd var/db/pkg rm -fr boot etc/* usr/lib64/systemd var/db/pkg