#!/bin/sh # Think of this scenario: # 1. ck-launch-session is used to register the session. # 2. User uses the GUI feature of his session manager to shutdown or reboot. # 3. Session manager sends a dbus signal to HAL requesting shutdown. # 4. Session is over. Session manager exits. # 5. ck-launch-session sees that its child exited. It de-registers the # session and exits too. # 6. HAL uses PolicyKit to determine if the request came from an active # session. No, it did not, session is not active. # 7. HAL tosses the request from the vile hacker. # This wrapper adds a little delay to kludgily keep the session running when # HAL checks the shutdown request. # In my experience HAL usually gets the CPU before the session ends. # But it's still a race condition that we lose about 20% of the time. # Call like this: ck-launch-session ck-launch-wrapper commandline..... "$@" sleep 2