This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 4th, 2012  |  syntax: None  |  size: 0.75 KB  |  views: 241  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ##/etc/systemd/system/arch32.service:
  2. [Unit]
  3. Description=32-bit chroot
  4.  
  5. [Service]
  6. Type=oneshot
  7. RemainAfterExit=yes
  8. ExecStart=/usr/local/bin/arch32 start
  9. ExecStop=/usr/local/bin/arch32 stop
  10.  
  11. [Install]
  12. WantedBy=multi-user.target
  13.  
  14. ##/usr/local/bin/arch32:
  15. #!/bin/bash
  16.  
  17. # Add '/var/run /var/lib/dbus' to the list to enable pulseaudio.
  18. dirs=(/dev /dev/pts /dev/shm /tmp /home)
  19.  
  20. case $1 in
  21.     start)
  22.         for d in "${dirs[@]}"; do
  23.             mount -o bind $d /opt/arch32$d
  24.         done
  25.         ;;
  26.     stop)
  27.         for (( i = ${#dirs[@]} - 1; i >= 0; i-- )); do
  28.             umount "/opt/arch32${dirs[i]}"
  29.         done
  30.         umount /opt/arch32/{proc,sys}
  31.         ;;
  32.     *)
  33.         echo "usage: $0 (start|stop)"
  34.         exit 1
  35. esac
clone this paste RAW Paste Data