miredo.service fails on boot

Bug #1482069 reported by Aminda Suomalainen
48
This bug affects 9 people
Affects Status Importance Assigned to Milestone
Miredo
New
Undecided
Unassigned
miredo (Debian)
Fix Released
Unknown
miredo (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

```
* miredo.service - Teredo IPv6 tunneling
   Loaded: loaded (/lib/systemd/system/miredo.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2015-08-06 09:07:29 EEST; 12min ago

Aug 06 09:07:28 terasar systemd[1]: Starting Teredo IPv6 tunneling...
Aug 06 09:07:29 terasar systemd[1]: miredo.service: Control process exited, code=exited status=255
Aug 06 09:07:29 terasar systemd[1]: Failed to start Teredo IPv6 tunneling.
Aug 06 09:07:29 terasar miredo-checkconf[882]: Invalid hostname "teredo.trex.fi" at line 7: Tilapäinen virhe nimenselvityksessä
Aug 06 09:07:29 terasar miredo-checkconf[882]: Server address not specified
Aug 06 09:07:29 terasar miredo-checkconf[882]: Fatal configuration error
Aug 06 09:07:29 terasar systemd[1]: miredo.service: Unit entered failed state.
Aug 06 09:07:29 terasar systemd[1]: miredo.service: Failed with result 'exit-code'.
```

"Tilapäinen virhe nimenselvityksessä" means "Temporary error in name resolution". I think this is caused by this laptop being wirelesss and not having network connectivity when systemd starts miredo.

I believe the fix would be making miredo.service require network-online.target, see http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/

ProblemType: Bug
DistroRelease: Ubuntu 15.10
Package: miredo 1.2.6-3
ProcVersionSignature: Ubuntu 4.1.0-3.3-generic 4.1.3
Uname: Linux 4.1.0-3-generic x86_64
NonfreeKernelModules: fglrx
ApportVersion: 2.18-0ubuntu5
Architecture: amd64
CurrentDesktop:

Date: Thu Aug 6 09:16:38 2015
InstallationDate: Installed on 2015-07-31 (5 days ago)
InstallationMedia: Ubuntu-MATE 15.10 "Wily Werewolf" - Alpha amd64 (20150729)
SourcePackage: miredo
UpgradeStatus: No upgrade log present (probably fresh install)
mtime.conffile..etc.miredo.conf: 2015-07-31T12:24:56.544343

Revision history for this message
Aminda Suomalainen (mikaela) wrote :
Revision history for this message
Aminda Suomalainen (mikaela) wrote :

I tried editing the unit file and replacing network.target with network-online.target worked.

```
% cat /etc/systemd/system/miredo.service
[Unit]
Description=Teredo IPv6 tunneling
After=network-online.target

[Service]
ExecStartPre=/usr/sbin/miredo-checkconf -f /etc/miredo/miredo.conf
ExecStart=/usr/sbin/miredo -f
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target
```

```
% LC_ALL=C systemctl status -l miredo
* miredo.service - Teredo IPv6 tunneling
   Loaded: loaded (/etc/systemd/system/miredo.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2015-08-06 09:30:27 EEST; 3min 4s ago
  Process: 1037 ExecStartPre=/usr/sbin/miredo-checkconf -f /etc/miredo/miredo.conf (code=exited, status=0/SUCCESS)
 Main PID: 1053 (miredo)
   CGroup: /system.slice/miredo.service
           |-1053 /usr/sbin/miredo -f
           |-1056 /usr/sbin/miredo -f
           `-1057 /usr/lib/x86_64-linux-gnu/miredo/miredo-privproc 4

Aug 06 09:30:27 terasar systemd[1]: Starting Teredo IPv6 tunneling...
Aug 06 09:30:27 terasar systemd[1]: Started Teredo IPv6 tunneling.
Aug 06 09:30:27 terasar miredo[1053]: Starting...
Aug 06 09:30:27 terasar miredo[1053]: miredo[1053]: Starting...
Aug 06 09:30:27 terasar miredo[1056]: New Teredo address/MTU
Aug 06 09:30:27 terasar miredo[1056]: Teredo pseudo-tunnel started
Aug 06 09:30:27 terasar miredo[1056]: (address: REMOVED, MTU: 1280)
Aug 06 09:30:27 terasar miredo[1053]: miredo[1056]: New Teredo address/MTU
Aug 06 09:30:27 terasar miredo[1053]: miredo[1056]: Teredo pseudo-tunnel started
Aug 06 09:30:27 terasar miredo[1053]: miredo[1056]: (address: REMOVED, MTU: 1280)
```

(REMOVED is not part of the output, I removed the real addresses from those spots.)

Revision history for this message
Dainius 'GreatEmerald' Masiliūnas (pastas4) wrote :

Confirmed, both the problem and the workaround, and it's present upstream too. The issue is described here:
http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/
Requiring only network.target means requiring NetworkManager to start, but not requiring DNS to be up; since miredo is started before DNS is up, and it can't cope with it, the result is failure.

The possible solutions/workarounds are: 1) As per above, require network-online.target (one can use /etc/systemd/system/miredo.service.d/network-online.conf or similar override instead of editing the whole file); 2) Enable NetworkManager-wait-online (not recommended as it slows down boot); 3) Fix Miredo to wait for DNS to be up by itself.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in miredo (Ubuntu):
status: New → Confirmed
Changed in miredo (Ubuntu):
importance: Undecided → Medium
Changed in miredo (Debian):
status: Unknown → New
Revision history for this message
Gannet (ken20001) wrote :

It's a pity but adding

network-online.target worked

to

/etc/systemd/system/miredo.service

doesn't work for me.

I've changed name address to IP after which Miredo starts well.

Revision history for this message
Romik Forest (forest-software) wrote :

I've wrote in /etc/miredo/miredo.conf

# Pick a Teredo server:
#ServerAddress teredo.ipv6.microsoft.com
#ServerAddress teredo-debian.remlab.net
ServerAddress 83.170.6.76 # ip of teredo-debian.remlab.net

And in /etc/network/if-up.d/miredo

if [ "$ADDRFAM" = "ipx" ] || [ "$ADDRFAM" = "inet6" ]; then
exit 0
fi

replaced for

if [ "$ADDRFAM" = "ipx" ] || [ "$ADDRFAM" = "inet6" ]; then
ip -6 route add default dev teredo; exit 0
fi

to have miredo working on ubuntu 16.04 and 15.10

Revision history for this message
Gannet (ken20001) wrote :

Still not fixed in 17.10.

Changed in miredo (Debian):
status: New → Fix Released
Revision history for this message
Gannet (ken20001) wrote :

Still is in Bionic.

tags: added: bionic
Norbert (nrbrtx)
tags: removed: wily
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.