gislab-npo / gislab

GIS.lab - total reduction of deployment and maintenance costs for complete free and open source geospatial infrastructure
http://gislab-npo.github.io/gislab/
GNU General Public License v3.0
40 stars 14 forks source link

gislab-network start is failing #516

Closed landam closed 6 years ago

landam commented 6 years ago

With recent version of GIS.lab the command

sudo gislab-network start
[GIS.lab]: Starting connection forwarding service.
[GIS.lab]: Starting DNS service.
[GIS.lab]: Starting DHCP service.
[GIS.lab]: Network services start failed!

seems to fail. The clients are able to connect, DHCP server seems to work, see

sudo gislab-network status
[GIS.lab]: Connection forwarding service is enabled and active.
[GIS.lab]: DNS service is enabled and failed!
[GIS.lab]: DHCP service is enabled and active.

Tested both on the unit and VM.

landam commented 6 years ago

More info

systemctl status bind9.service
● bind9.service - BIND Domain Name Server
   Loaded: loaded (/lib/systemd/system/bind9.service; enabled; vendor preset: enabled)
  Drop-In: /run/systemd/generator/bind9.service.d
           └─50-insserv.conf-$named.conf
   Active: failed (Result: exit-code) since Sun 2018-02-25 13:29:03 UTC; 9min ago
     Docs: man:named(8)
  Process: 8939 ExecStop=/usr/sbin/rndc stop (code=exited, status=1/FAILURE)
  Process: 8935 ExecStart=/usr/sbin/named -f $OPTIONS (code=exited, status=1/FAILURE)
 Main PID: 8935 (code=exited, status=1/FAILURE)

Feb 25 13:29:02 server systemd[1]: Started BIND Domain Name Server.
Feb 25 13:29:03 server named[8935]: usage: named [-4|-6] [-c conffile] [-d debuglevel] [-E engine] [-f|-g]
Feb 25 13:29:03 server named[8935]:              [-n number_of_cpus] [-p port] [-s] [-t chrootdir] [-u username]
Feb 25 13:29:03 server named[8935]:              [-m {usage|trace|record|size|mctx}]
Feb 25 13:29:03 server named[8935]: named: extra command line arguments
Feb 25 13:29:03 server systemd[1]: bind9.service: Main process exited, code=exited, status=1/FAILURE
Feb 25 13:29:03 server rndc[8939]: rndc: connect failed: 127.0.0.1#953: connection refused
Feb 25 13:29:03 server systemd[1]: bind9.service: Control process exited, code=exited status=1
Feb 25 13:29:03 server systemd[1]: bind9.service: Unit entered failed state.
Feb 25 13:29:03 server systemd[1]: bind9.service: Failed with result 'exit-code'.
mpastor commented 6 years ago

Can you paste your /etc/default/bind9?

landam commented 6 years ago

same for xenial/bionic-based version:

RESOLVCONF=no
OPTIONS="-4 -u bind" # use IPv4 only
mpastor commented 6 years ago

Restart network and send relevant output from journalctl -xe or from system log file.

But much better will be use of systemctl command directly: systemctl stop bind9.service systemctl start bind9.service

landam commented 6 years ago
-- Subject: Unit bind9.service has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit bind9.service has finished starting up.
-- 
-- The start-up result is RESULT.
Oct 09 10:52:40 server named[5924]: usage: named [-4|-6] [-c conffile] [-d debuglevel] [-E engine] [-f|-g]
Oct 09 10:52:40 server named[5924]:              [-n number_of_cpus] [-p port] [-s] [-S sockets] [-t chrootdir]
Oct 09 10:52:40 server named[5924]:              [-u username] [-U listeners] [-m {usage|trace|record|size|mctx}]
Oct 09 10:52:40 server named[5924]: usage: named [-v|-V]
Oct 09 10:52:40 server named[5924]: named: extra command line arguments
Oct 09 10:52:40 server systemd[1]: bind9.service: Main process exited, code=exited, status=1/FAILURE
Oct 09 10:52:40 server systemd[1]: bind9.service: Failed with result 'exit-code'.
Oct 09 10:52:41 server sudo[5902]: pam_unix(sudo:session): session closed for user root
mpastor commented 6 years ago

Stop the bind9 service and run it manually from cmd: /usr/sbin/named -f -4 -u bind

landam commented 6 years ago

Do you mean

sudo service bind9 stop
sudo  /usr/sbin/named -f -4 -u bind

?

The second command just hangs.

mpastor commented 6 years ago

That is ok, it is running in foreground.

Interesting thing is:

Process: 8935 ExecStart=/usr/sbin/named -f $OPTIONS (code=exited, status=1/FAILURE)

$OPTIONS is not evaluated. Reinstaling bind9 package fixed it. I don't know where is a problem (crappy systemd :( ).

mpastor commented 6 years ago

Just remove trailing comment from service variable configuration file /etc/default/bind9:

RESOLVCONF=no
OPTIONS="-4 -u bind"
landam commented 6 years ago

IIUW, it seems to have no effect

vagrant@server.GIS.lab(gislab_vagrant_bionic):~$ cat /etc/default/bind9 
RESOLVCONF=no
OPTIONS="-4 -u bind"
vagrant@server.GIS.lab(gislab_vagrant_bionic):~$ sudo gislab-network start
[GIS.lab]: Starting connection forwarding service.
[GIS.lab]: Starting DNS service.
[GIS.lab]: Starting DHCP service.
[GIS.lab]: Network services start failed!
mpastor commented 6 years ago

It's workin for me. Which service is failing? # gislab-network status

landam commented 6 years ago
sudo gislab-network status
[GIS.lab]: Connection forwarding service is enabled and active.
[GIS.lab]: DNS service is enabled and failed!
[GIS.lab]: DHCP service is enabled and active.
mpastor commented 6 years ago

Paste output pls:

systemctl status bind9.service
landam commented 6 years ago

@mpastor You are right. It seems to solve the issue. Implemented in master and version-0.7 (since Xenial seems to be also affected). Closing.