systemd start script and use netifaces from pip

Fix #59, #229
This commit is contained in:
Julien Duponchelle 2015-06-09 17:29:01 +02:00
parent 7c7f8fe3ed
commit c10e692ca2
3 changed files with 32 additions and 2 deletions

View File

@ -42,7 +42,7 @@ You must be connected to the Internet in order to install the dependencies.
Dependencies:
- Python 3.3 or above
- Python 3.4 or above
- aiohttp
- setuptools
- netifaces
@ -53,7 +53,6 @@ The following commands will install some of these dependencies:
.. code:: bash
sudo apt-get install python3-setuptools
sudo apt-get install python3-netifaces
Finally these commands will install the server as well as the rest of the dependencies:
@ -82,6 +81,12 @@ Usefull options:
* --log logfile: store output in a logfile
* --pid pidfile: store the pid of the running process in a file and prevent double execution
All the init script require the creation of a GNS3 user. You can change it to another user.
.. code:: bash
sudo adduser gns3
upstart
~~~~~~~
@ -95,6 +100,15 @@ You need to copy init/gns3.conf.upstart to /etc/init/gns3.conf
sudo service gns3 start
systemd
~~~~~~~~
You need to copy init/gns3.service.systemd to /lib/systemd/system/gns3.service
.. code:: bash
sudo chown root /lib/systemd/system/gns3.service
sudo
Windows
-------

14
init/gns3.service.systemd Normal file
View File

@ -0,0 +1,14 @@
[Unit]
Description=GNS3 server
[Service]
Type=forking
Environment=statedir=/var/cache/gns3
PIDFile=/var/run/gns3.pid
ExecStart=/usr/local/bin/gns3server --log /var/log/gns3.log \
--pid /var/run/gns3.pid --daemon
Restart=on-abort
User=gns3
[Install]
WantedBy=multi-user.target

View File

@ -23,6 +23,7 @@ from setuptools.command.test import test as TestCommand
if sys.version_info < (3, 4):
raise SystemExit("Python 3.4 or higher is required")
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
@ -38,6 +39,7 @@ class PyTest(TestCommand):
dependencies = [
"netifaces>=0.10.4",
"jsonschema>=2.4.0",
"aiohttp>=0.15.1",
"Jinja2>=2.7.3",