aiccu fails to start if DNS services are not started

Bug #967095 reported by James Page
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
aiccu (Ubuntu)
Fix Released
Medium
James Page

Bug Description

I run a DNS server and aiccu on the same server; they act as a home gateway with IPv6 enabled.

I would imagine this might be a common deployment scenario.

aiccu tries to start before bind and as a result aborts during startup:

aiccu[907]: Couldn't resolve host tic.sixxs.net, service 3874
aiccu[907]: Couldn't connect to the TIC server tic.sixxs.net
aiccu[907]: Couldn't retrieve first tunnel for the above reason, aborting

Switching the start on stanza to runlevel [2345] helps but its still racey...

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: aiccu 20070115-14.1ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-20.33-generic 3.2.12
Uname: Linux 3.2.0-20-generic x86_64
ApportVersion: 1.95-0ubuntu1
Architecture: amd64
Date: Wed Mar 28 13:34:45 2012
InstallationMedia: Ubuntu-Server 11.04 "Natty Narwhal" - Beta amd64 (20110413)
SourcePackage: aiccu
UpgradeStatus: Upgraded to precise on 2012-03-02 (25 days ago)

Related branches

Revision history for this message
James Page (james-page) wrote :
Revision history for this message
Lars Düsing (lars.duesing) wrote :

James,
I see your problem, but I cannot find a general fix for your problem at the moment.
Until then two quick and dirty solutions: EITHER
- add tic.sixxs.net and the endpoint of your tunnel to /etc/hosts
OR
- change "start on net-device-up IFACE!=lo" to "start on started bind9 and net-device-up IFACE!=lo"
(last one should work, but not tested, I will do, if you have any problems)

Problem is: you cannot add a general dependency to bind in the upstart configuration, because if no bind is installed it won't match anytime.

Revision history for this message
Lars Düsing (lars.duesing) wrote :

Problem exists, but no general solution at the moment.

Changed in aiccu (Ubuntu):
status: New → Confirmed
Revision history for this message
Lars Düsing (lars.duesing) wrote :

Another solution would be a pre-start-script in upstart-config, which checks wether tic.sixxs.net could be resolved, and wait if not. (Or I have to get through upstart-documentation, wether it is possible to pospone a start of a service and try it x seconds later, or such..)

Revision history for this message
James Page (james-page) wrote : Re: [Bug 967095] Re: aiccu fails to start if DNS services are not started

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 28/03/12 14:33, Lars Düsing wrote:
> I see your problem, but I cannot find a general fix for your
> problem at the moment. Until then two quick and dirty solutions:
> EITHER - add tic.sixxs.net and the endpoint of your tunnel to
> /etc/hosts

This is probably the most workable in my use case.

> OR - change "start on net-device-up IFACE!=lo" to "start on started
> bind9 and net-device-up IFACE!=lo" (last one should work, but not
> tested, I will do, if you have any problems)

This would work with dnsmasq which uses upstart but bind9 does not :-(
- - so I don't think the started bind9 event would ever fire.

The version of upstart in precise does have a new feature called
wait-for-state which could be used in the pre-start script to wait for
any installed dns servers to reach state 'running' for example.

But again I think that only works when everything is upstart....

- --
James Page
Ubuntu Core Developer
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCAAGBQJPcyB5AAoJEL/srsug59jDe6AP/A40/VBcYKO26r5ZJ11xeciw
i1Q6PNEZHpLZUuALt17tLceAyBs/uDI7Pq6LgPhODqT8JYH2mIuv6NHh0MYeeA4y
Iox+tglvow5+Wb24arHh3S1NlGRtg5CtoLtD2nvuiFdIG6K8WqorBmEVS96BJcUf
H4R/D7RsTmvkZM9F+QStct4oI5LZVbNfTTV0fJgznr2PJ6tZ+/9fQpuU3pWbfMYy
2zjxptxH4kvWNzgX0/i3b+ekbjiTAuLDc/dC1ZTnfxt1xlUL9jJfs53qoxN5u24U
oYwXUE8XUwh4m8YG5T9QIC9a4qeZ5C4VocS5fkcbqj1E0cOktCIDMGaMyyxHHpj4
TXJjhaYaq9kTe+O98YLeROVju3ONo3N8iBieA+b0r/blte7fBt2HFGj7aMufw5Jc
ApcQlM/ZmmbAQiSMkOhPcRxRFX9ltLuqrzOpPRqr2xBFyw3eQOmqCgVUdd+Jy23z
0QF/HpxH+6X9BLU7pmVJZ+MNxXuF3xzkY7UUZspNubNqHq1/GkcwwcsSr3tE82fr
/HgJLHvGG7A4XClPHjA6U+u2TmKMnr1EsSvaruyt3UhWantrdDgfr92lY5DIUgvI
wVj2fCh9uRkiVSOSmyIAVfvTaS8j7spSKSOkhcpgWtfpDe1bMgyzEXoFXkgyPOQ1
1qQ61opBNWRI6tKU8LqU
=GOmG
-----END PGP SIGNATURE-----

Revision history for this message
Lars Düsing (lars.duesing) wrote :

what brings us again to: LP: #406397 ...
So, the only general solution is a pre-start-script like
  #!/bin/bash
  count=0
  reachable=0
  while [ $count -le 10 ]; do
        ping -c1 tic.sixxs.net >/dev/null
        reachable=$?
        if [ "$reachable" != "2" ]; then
                count=11
        fi
        count=$[$count+1]
  done

(ping returns a "2" if the name could not be resolved...)

Revision history for this message
Lars Düsing (lars.duesing) wrote :

oh - add a "sleep 1s" or such before the done :-)

Revision history for this message
Lars Düsing (lars.duesing) wrote :

James, could you give me any hint, whether the above dirty hack would have any chance to be accepted?
(It would be nice if we get this in precise before final release...)

Revision history for this message
James Page (james-page) wrote :

Hi Lars

I think so - it would also deal with machines that don't also host DNS.

It would be really nice is aiccu itself did this :-).

I'd also like to get bug 967090 fixed at the same time so the upstart integration is a little better generally.

James Page (james-page)
Changed in aiccu (Ubuntu):
importance: Undecided → Medium
assignee: nobody → James Page (james-page)
status: Confirmed → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package aiccu - 20070115-14.1ubuntu2

---------------
aiccu (20070115-14.1ubuntu2) precise; urgency=low

  * debian/aiccu.upstart:
    - Use pre-start, post-stop scripts to start and stop aiccu as upstart
      cannot track aiccu in any meaningful way (LP: #967090).
    - Check access to IPv6 endpoint before starting aiccu to avoid race
      conditions with local DNS services (LP: #967095).
      Thanks to Lars Düsing for this fix.
    - Updated start on stanza to include local-filesystems.
    - General tidy of upstart configuration including placing logfile in
      /var/log and generating log entry timestamps.
 -- James Page <email address hidden> Fri, 30 Mar 2012 12:50:10 +0100

Changed in aiccu (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.