blob: 7e862d6b697cb7d0fb3f2a68788711921e84e1c9 [file] [log] [blame]
#!/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