Advertisement
m0gliE

Auto Start Ubuntu VirtualBox & Fastcoin daemon

Jun 27th, 2014
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 3.07 KB | None | 0 0
  1. // start
  2. Auto Start Ubuntu VirtualBox (VM) & Fastcoin daemon
  3. --------------------------------------------------------------
  4. A.0) Start by right clicking your (VM) in VirtualBox and select "Create shortcut on desktop"
  5. A.1) Copy this file to C:\Users\YourUserName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
  6. A.2) (simply drag it to the start menu and place it under startup.)
  7.  
  8. When windows boots, your VirtualBox machine will now auto-start as well.
  9. --------------------------------------------------------------
  10. B.0) Define an IP address for your (VM) so DHCP does not end up changing it.
  11. --------------------------------------------------------------
  12. B.1) To define an IP instead of letting DHCP assign an IP.
  13.     sudo nano /etc/network/interfaces
  14. B.2) Append the following changes to suit your network.
  15. --------------------------------------------------------------
  16.     auto lo
  17.     iface lo inet loopback
  18.     auto eth0
  19.     iface eth0 inet static
  20.     address 192.168.2.102
  21.     netmask 255.255.255.0
  22.     gateway 192.168.2.250
  23.     dns-nameservers 8.8.8.8 192.168.2.250
  24. --------------------------------------------------------------
  25. C.0 Create an upstart for your fastcoin daemon.
  26. --------------------------------------------------------------
  27. C.1) sudo apt-get install rungetty
  28. C.2) sudo editor /etc/init/tty1.conf
  29. C.3) comment out "exec /sbin/getty 38400 tty1"
  30. C.4) add the following line
  31.  
  32.      exec /sbin/rungetty --autologin username tty1
  33. --------------------------------------------------------------
  34. D.0) To control the startup and persistent execution of processes, you can use upstart.
  35. --------------------------------------------------------------
  36. D.1) Create a file fastcoin_upstart.conf in /etc/init
  37.     sudo nano /etc/init/fastcoin_upstart.conf
  38. D.2) Append the following lines and modify to suit your needs.
  39. --------------------------------------------------------------
  40.     # Make sure you create this file in /etc/init
  41.     description "fastcoin_upstart"
  42.     author      "Fastcoin Developer"
  43.  
  44.     # start daemon on system startup
  45.     start on filesystem
  46.     stop on shutdown
  47.    
  48.     # Automatically respawn in case it forks on execution (runs in background)
  49.     respawn
  50.     respawn limit 20 5
  51.  
  52.     # Change to suit your host machine username.
  53.     exec /usr/bin/fastcoind -datadir=/home/username/.fastcoin
  54.    
  55.     # or if you are running from src folder instead of /usr/bin/ replace line above with line below.
  56.     # exec /home/username/fastcoin/src/fastcoind -datadir=/home/username/.fastcoin
  57. --------------------------------------------------------------
  58. E.2) You can then control this service using the following commands.
  59.     sudo start fastcoin_upstart, sudo stop fastcoin_upstart, sudo restart
  60. E.3) Keep in mind that these processes, (setup as they are) will run as root.
  61.  
  62. Notes:
  63.  
  64. All the log files for upstart are located in /var/log/upstart/fastcoin_upstart.log.
  65.     sudo cat /var/log/upstart/fastcoin.conf to see the entire file.
  66. List the last few entries by running,
  67.     sudo tail -n 300 /var/log/upstart/fastcoin_upstart.conf
  68.  
  69. // end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement