Skip to content

Instantly share code, notes, and snippets.

@ssinyagin
Created August 4, 2012 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssinyagin/3259628 to your computer and use it in GitHub Desktop.
Save ssinyagin/3259628 to your computer and use it in GitHub Desktop.
/etc/init.d/pciback
#!/bin/bash
### BEGIN INIT INFO
# Provides: pciback
# Required-Start: $syslog $remote_fs xen
# Required-Stop: $syslog $remote_fs xen
# Should-Start: drbd iscsi
# Should-Stop: drbd iscsi
# X-Start-Before: xendomains
# X-Stop-After:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Free PCI devices from dom0
# Description: Assigns PCI devices for domU usage
### END INIT INFO
. /lib/init/vars.sh
. /lib/lsb/init-functions
[ -r /etc/default/pciback ] && . /etc/default/pciback
do_start()
{
[ -n "$PCIBACK_DEVICES" ] || return
for d in $PCIBACK_DEVICES; do
/opt/scripts/pciback.sh ${d}
done
}
case "$1" in
start)
do_start
;;
stop)
;;
restart)
do_start
;;
reload|force-reload)
do_start
;;
*)
echo "Usage: $0 {start|stop|restart|reload|force-reload}"
exit 3
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment