GNS3
http://forum.gns3.net/

Start GNS3Server on Linux boot
http://forum.gns3.net/topic12316.html
Page 1 of 1

Author:  MagellanTX [ Wed Oct 01, 2014 7:09 pm ]
Post subject:  Start GNS3Server on Linux boot

Linux noob here

Does anyone have a script for Ubuntu 14 that will start the server with the system? Specifically, I would like to be able to do a service gns3server start|stop|restart but the stop portion would need to search for the running processes and kill them (unless there is another way to stop the server).

Thanks!

Author:  mweisel [ Wed Oct 01, 2014 10:09 pm ]
Post subject:  Re: Start GNS3Server on Linux boot

Upstart is a great solution for this. An example HOWTO for Ubuntu Server 14.04:

1. Stop all currently running gns3server processes. Run the following from the terminal:
Code:
sudo pkill gns3server

2. Identify the current user. This will be needed for the setuid value in the Upstart job config file. For example, I'm currently logged in as gns3 as this is the account that contains my personal GNS3 directory (projects, images, etc.). Run the following from the terminal:
Code:
id -un

3. Get the location of the gns3server binary. For example, gns3server is located at /usr/local/bin/gns3server on my system. This will be needed for the exec value in the Upstart job config file. Run the following from the terminal:
Code:
type gns3server

4. Create the Upstart job config file with a text editor. Run the following from the terminal:
Code:
sudo nano /etc/init/upstart-gns3server.conf

...and enter/save the following:
Code:
description "GNS3 Server"

start on runlevel [2345]
stop on runlevel [!2345]
respawn

setuid gns3
exec /usr/local/bin/gns3server

5. Validate the syntax is correct for the Upstart job config file. Run the following from the terminal:
Code:
init-checkconf /etc/init/upstart-gns3server.conf

6. Reboot to verify. Run the following from the terminal:
Code:
sudo reboot

7. Verify the gns3server process(es) are started upon login. Run the following from the terminal:
Code:
initctl status upstart-gns3server
pgrep -a gns3server

Note: Log will be located in /var/log/upstart directory. For example, if you wanted to check on any Warning or Errors, run the following from the terminal:
Code:
sudo egrep '\[W|\[E' /var/log/upstart/upstart-gns3server.log

Need to stop/start/restart manually? Run one of the following from the terminal:
Code:
sudo initctl stop upstart-gns3server
sudo initctl start upstart-gns3server
sudo initctl restart upstart-gns3server

Author:  MagellanTX [ Sun Oct 05, 2014 5:02 pm ]
Post subject:  Re: Start GNS3Server on Linux boot

Thank you very much for taking the time to write that up - it worked perfectly!!

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/