Skip to content

Commit

Permalink
Add patches for Ubuntu16. Update manual
Browse files Browse the repository at this point in the history
  • Loading branch information
cvicente committed Nov 6, 2018
1 parent c96c06f commit db0558c
Show file tree
Hide file tree
Showing 8 changed files with 335 additions and 325 deletions.
266 changes: 129 additions & 137 deletions doc/manual/netdot-manual-es.html

Large diffs are not rendered by default.

Binary file modified doc/manual/netdot-manual-es.pdf
Binary file not shown.
50 changes: 20 additions & 30 deletions doc/manual/netdot-manual-es.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,36 +122,6 @@ Clonar el repositorio del proyecto desde Github.com. Necesitará la utilidad Git
+cd Netdot/
~~~~

## Requerimientos

* Perl 5.6.1 o superior

* Apache2 con `mod_perl2`

* MySQL o PostgreSQL

* Servidor de autenticación (opcional). Netdot implementa
autenticacion local y también a través de RADIUS y LDAP.

* Para RADIUS, recomendamos FreeRadius, disponible en:
<http://www.freeradius.org/>

* Para LDAP, puede optar por OpenLdap, disponible en:
<http://www.openldap.org/>

* El paquete RRDtool, incluyendo sus módulos Perl, disponible en:
<http://oss.oetiker.ch/rrdtool/>

* el paquete GraphViz, disponible en:
<http://www.graphviz.org/>

* La última versión de las MIBs de Netdisco
<http://sourceforge.net/projects/netdisco/files/netdisco-mibs/>

* Varios módulos Perl

* El programa 'make'

### Instalación de dependencias

Existen dos formas de instalar las dependencias: La primera
Expand Down Expand Up @@ -344,6 +314,26 @@ Luego instale el nuevo Netdot y reinicie Apache:
las variables APACHEUSER y APACHEGROUP con el valor "www-data",
el cual es el usuario con el que el servidor Apache se ejecuta.

## Ubuntu 16.04

A partir de Ubuntu 16.04, es necesario parchar manualmente algunos ficheros.

The patches are included in the Netdot distribution. Before applying them,
you need to move to the root directory, then use the patch command
(adjust the location of your Netdot repository as needed):

Los parches vienen incluidos en la distribución de Netdot. Antes de
aplicarlos, debe cambiarse al directorio raíz y una vez allí, usar el
comando "patch" como sigue (ajuste la ubicación de su repositorio de Netdot si
es necesario):

~~~
cd /
patch -p0 < ~/Netdot/patches/ubuntu-1604/DBI.pm.patch
patch -p0 < ~/Netdot/patches/ubuntu-1604/apache2-init.patch
~~~

En el futuro, añadiremos parches para otras versiones de Ubuntu más recientes.

## Configuración del Servidor Web Apache

Expand Down
263 changes: 129 additions & 134 deletions doc/manual/netdot-manual.html

Large diffs are not rendered by default.

Binary file modified doc/manual/netdot-manual.pdf
Binary file not shown.
40 changes: 16 additions & 24 deletions doc/manual/netdot-manual.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,30 +116,6 @@ cd Netdot/
~~~~


## Requirements

* Perl 5.6.1 or later

* Apache2 with `mod_perl2`

* MySQL or PostgreSQL

* Authentication Server (optional). Netdot supports local
authentication, as well as RADIUS, LDAP and Kerberos.

* The RRDtool package, including its Perl modules, available at:
<http://oss.oetiker.ch/rrdtool/>

* The GraphViz package, available at:
<http://www.graphviz.org/>

* The latest Netdisco MIBs.
<http://sourceforge.net/projects/netdisco/files/netdisco-mibs/>

* Various Perl modules.

* The 'make' utility.

### Installing dependencies

There are two ways to install dependencies: The first and
Expand Down Expand Up @@ -324,6 +300,22 @@ Finally, install the new Netdot code and restart Apache:
runs as.


## Ubuntu 16.04

Starting with Ubuntu 16.04, you will need to manually patch some files.

The patches are included in the Netdot distribution. Before applying them,
you need to move to the root directory, then use the patch command
(adjust the location of your Netdot repository as needed):

~~~
cd /
patch -p0 < ~/Netdot/patches/ubuntu-1604/DBI.pm.patch
patch -p0 < ~/Netdot/patches/ubuntu-1604/apache2-init.patch
~~~

We will add patches for more recent versions of Ubuntu in the future.

## Apache Configuration

Edit the supplied Apache config template for either Local, RADIUS, Kerberos or
Expand Down
27 changes: 27 additions & 0 deletions patches/ubuntu-1604/DBI.pm.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
--- /usr/share/perl5/Class/DBI.pm 2007-10-04 21:27:07.000000000 +0000
+++ /usr/share/perl5/Class/DBI.pm.orig 2018-11-06 21:08:32.364069274 +0000
@@ -597,6 +597,7 @@

sub _auto_increment_value {
my $self = shift;
+ my $sth = shift;
my $dbh = $self->db_Main;

# Try to do this in a standard method. Fall back to MySQL/SQLite
@@ -607,6 +608,7 @@
my $id = $dbh->last_insert_id(undef, undef, $self->table, undef) # std
|| $dbh->{mysql_insertid} # mysql
|| eval { $dbh->func('last_insert_rowid') }
+ || $sth->{'mysql_insertid'} # Added for MySQL 5.7
or $self->_croak("Can't get last insert id");
return $id;
}
@@ -623,7 +625,7 @@
$self->_bind_param($sth, \@columns);
$sth->execute(values %$data);
my @primary_columns = $self->primary_columns;
- $data->{ $primary_columns[0] } = $self->_auto_increment_value
+ $data->{ $primary_columns[0] } = $self->_auto_increment_value($sth)
if @primary_columns == 1
&& !defined $data->{ $primary_columns[0] };
};
14 changes: 14 additions & 0 deletions patches/ubuntu-1604/apache2-init.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--- /etc/init.d/apache2.orig 2018-11-06 20:30:52.478691277 +0000
+++ /etc/init.d/apache2 2018-11-06 20:32:00.800835274 +0000
@@ -159,8 +159,11 @@
fi

if apache_conftest ; then
+ a2disconf netdot
$APACHE2CTL start
apache_wait_start $?
+ a2enconf netdot
+ $APACHE2CTL graceful
return $?
else
APACHE2_INIT_MESSAGE="The apache2$DIR_SUFFIX configtest failed."

0 comments on commit db0558c

Please sign in to comment.