# plymouth-ready - send an event to indicate plymouth is up
#
# This job notifies that the plymouth splash screen is up, either started
# from the initrd or when the 'plymouth-splash' job starts.  The login
# managers use the event to avoid a race with plymouth-splash:
#
# https://bugs.launchpad.net/ubuntu/+source/plymouth/+bug/982889

description "Send an event to indicate plymouth is up"

task
start on startup or started plymouth-splash
instance $UPSTART_EVENTS

emits plymouth-ready

script
  if [ "$UPSTART_EVENTS" = started ] || \
     status plymouth-splash | grep -q "start/started" || \
     plymouth --ping
  then
    initctl emit plymouth-ready
  fi
end script
