It is currently Wed Aug 16, 2017 1:07 pm


All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Start GNS3Server on Linux boot
PostPosted: Wed Oct 01, 2014 7:09 pm 
Offline

Joined: Thu Sep 04, 2014 6:49 pm
Posts: 5
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!




Top
 Profile  
 
 Post subject: Re: Start GNS3Server on Linux boot
PostPosted: Wed Oct 01, 2014 10:09 pm 
Offline

Joined: Fri May 13, 2011 10:35 pm
Posts: 83
Location: Seattle, WA (USA)
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

_________________
http://binarynature.blogspot.com/search/label/GNS3


Top
 Profile  
 
 Post subject: Re: Start GNS3Server on Linux boot
PostPosted: Sun Oct 05, 2014 5:02 pm 
Offline

Joined: Thu Sep 04, 2014 6:49 pm
Posts: 5
Thank you very much for taking the time to write that up - it worked perfectly!!




Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO