Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // start
- Auto Start Ubuntu VirtualBox (VM) & Fastcoin daemon
- --------------------------------------------------------------
- A.0) Start by right clicking your (VM) in VirtualBox and select "Create shortcut on desktop"
- A.1) Copy this file to C:\Users\YourUserName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
- A.2) (simply drag it to the start menu and place it under startup.)
- When windows boots, your VirtualBox machine will now auto-start as well.
- --------------------------------------------------------------
- B.0) Define an IP address for your (VM) so DHCP does not end up changing it.
- --------------------------------------------------------------
- B.1) To define an IP instead of letting DHCP assign an IP.
- sudo nano /etc/network/interfaces
- B.2) Append the following changes to suit your network.
- --------------------------------------------------------------
- auto lo
- iface lo inet loopback
- auto eth0
- iface eth0 inet static
- address 192.168.2.102
- netmask 255.255.255.0
- gateway 192.168.2.250
- dns-nameservers 8.8.8.8 192.168.2.250
- --------------------------------------------------------------
- C.0 Create an upstart for your fastcoin daemon.
- --------------------------------------------------------------
- C.1) sudo apt-get install rungetty
- C.2) sudo editor /etc/init/tty1.conf
- C.3) comment out "exec /sbin/getty 38400 tty1"
- C.4) add the following line
- exec /sbin/rungetty --autologin username tty1
- --------------------------------------------------------------
- D.0) To control the startup and persistent execution of processes, you can use upstart.
- --------------------------------------------------------------
- D.1) Create a file fastcoin_upstart.conf in /etc/init
- sudo nano /etc/init/fastcoin_upstart.conf
- D.2) Append the following lines and modify to suit your needs.
- --------------------------------------------------------------
- # Make sure you create this file in /etc/init
- description "fastcoin_upstart"
- author "Fastcoin Developer"
- # start daemon on system startup
- start on filesystem
- stop on shutdown
- # Automatically respawn in case it forks on execution (runs in background)
- respawn
- respawn limit 20 5
- # Change to suit your host machine username.
- exec /usr/bin/fastcoind -datadir=/home/username/.fastcoin
- # or if you are running from src folder instead of /usr/bin/ replace line above with line below.
- # exec /home/username/fastcoin/src/fastcoind -datadir=/home/username/.fastcoin
- --------------------------------------------------------------
- E.2) You can then control this service using the following commands.
- sudo start fastcoin_upstart, sudo stop fastcoin_upstart, sudo restart
- E.3) Keep in mind that these processes, (setup as they are) will run as root.
- Notes:
- All the log files for upstart are located in /var/log/upstart/fastcoin_upstart.log.
- sudo cat /var/log/upstart/fastcoin.conf to see the entire file.
- List the last few entries by running,
- sudo tail -n 300 /var/log/upstart/fastcoin_upstart.conf
- // end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement