sudo make -C $UIPathToBuild install
fi
-echo "To run SO with UI please run:"
-echo 'sudo -H /usr/rift/rift-shell -r -i /usr/rift -a /usr/rift/.artifacts -- ./demos/launchpad.py --use-xml-mode'
-echo
-echo "To run SO without UI please run:"
-echo 'sudo -H /usr/rift/rift-shell -r -i /usr/rift -a /usr/rift/.artifacts -- ./demos/launchpad.py --use-xml-mode --no-ui'
+echo "Creating Service ...."
+sudo $(dirname $0)/create_launchpad_service
+
--- /dev/null
+#!/bin/bash
+# install the launchpad systemd service
+# these files should work on both ub16 and fc20
+
+if [ $(whoami) != "root" ]; then
+ echo must be root
+ exit 1
+fi
+
+
+cat <<EOF >/etc/systemd/system/launchpad.service
+[Unit]
+Description=RIFT.ware Launchpad
+After=network-online.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/bin/sh -c 'nohup sudo -b -H /usr/rift/rift-shell -r -i /usr/rift -a /usr/rift/.artifacts -- ./demos/launchpad.py --use-xml-mode'
+ExecStop=/bin/sh -c 'killall rwmain'
+
+[Install]
+WantedBy=default.target
+EOF
+
+chmod 664 /etc/systemd/system/launchpad.service
+
+if ! systemctl daemon-reload; then
+ echo "WARNING: Not able to reload daemons: this must be run in a privileged container: sudo systemctl daemon-reload ; sudo systemctl enable launchpad.service"
+else
+ # enable launchpad at boot - should always succeed in a privileged container
+ systemctl enable launchpad.service
+fi
+
+# start launchpad?
+#sudo systemctl start launchpad.service
+
+echo
+echo "Launchpad service created and enabled. Run 'sudo systemctl start launchpad.service' to start the service."
+echo