summaryrefslogtreecommitdiff
path: root/tools/systemd-prestart-check
blob: 191ff4f101d365e8d783a4dc93d7c77b0c61dfa2 (plain)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 
#!/bin/bash this_unit=$(sed -n "s,.*:name=systemd:.*/\([^/]\+\.service\)/\?.*,\1,p" /proc/self/cgroup) if [ -n "$this_unit" ] && [[ $this_unit == "unity"* ]]; then this_job=$(systemctl --user list-jobs $this_unit | sed -n "s,\([0-9]\+\)\s\+${this_unit//./\\.}.*,\1,p") fi # If gnome-session is going to start compiz, # we don't want to be the ones doing it. if grep -q compiz /usr/share/gnome-session/sessions/ubuntu.session; then echo "GNOME Session is starting Compiz" [ -n "$this_job" ] && systemctl --user cancel $this_job exit 1 fi if [ -z "$UPSTART_SESSION" ]; then exit 0 fi upstart_status=$(initctl status unity7) || true if (echo "$upstart_status" | grep -q "start/running"); then echo "Unity is managed by Upstart" [ -n "$this_job" ] && systemctl --user cancel $this_job exit 1 fi exit 0