Merge ~hloeung/ubuntu-mirror-charm:master into ubuntu-mirror-charm:master

Proposed by Haw Loeung
Status: Merged
Approved by: Haw Loeung
Approved revision: 74f1c96593dd800fec968bb5916ac6da0b82ff45
Merged at revision: c50a97a4cc2ffc6349ee03111659039f68f56767
Proposed branch: ~hloeung/ubuntu-mirror-charm:master
Merge into: ubuntu-mirror-charm:master
Diff against target: 29 lines (+10/-0)
2 files modified
hooks/hooks.py (+5/-0)
templates/systemd-apache-override.tmpl (+5/-0)
Reviewer Review Type Date Requested Status
Colin Misare Approve
Canonical IS Reviewers Pending
Review via email: mp+394217@code.launchpad.net

Commit message

Ensure Apache HTTP server started after all interfaces are brought up - LP:1899852

Description of the change

See https://pastebin.canonical.com/p/thzPCcv88P/

Testing:

| ubuntu@juju-87625f-hloeung-66:~$ sudo sysctl net.ipv4.ip_nonlocal_bind=0
| net.ipv4.ip_nonlocal_bind = 0
| ubuntu@juju-87625f-hloeung-66:~$ nc -lv -s 10.10.10.10 -p 35000
| nc: Cannot assign requested address

| ubuntu@juju-87625f-hloeung-66:~$ sudo sysctl net.ipv4.ip_nonlocal_bind=1
| net.ipv4.ip_nonlocal_bind = 1
| ubuntu@juju-87625f-hloeung-66:~$ nc -lv -s 10.10.10.10 -p 35000
| Listening on [10.10.10.10] (family 0, port 35000)
| ^C

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Colin Misare (cmisare) wrote :

LGTM

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision c50a97a4cc2ffc6349ee03111659039f68f56767

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/hooks/hooks.py b/hooks/hooks.py
2index 62aa81d..3c1b3b4 100755
3--- a/hooks/hooks.py
4+++ b/hooks/hooks.py
5@@ -1071,6 +1071,11 @@ def configure_sysctl(conf, hostname):
6 'kernel.pid_max': 65536,
7 # RT#90964: Kill swap on ubuntu-archive servers
8 'vm.swappiness': 0,
9+ # network-online.target but may not be fully up per upstream bug. Let's use
10+ # ip_nonlocal_bind for now.
11+ # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=868650
12+ 'net.ipv4.ip_nonlocal_bind': 1,
13+ 'net.ipv6.ip_nonlocal_bind': 1,
14 }
15 sysctl.create(yaml.dump(general_settings), '/etc/sysctl.d/90-ubuntu-mirror.conf')
16
17diff --git a/templates/systemd-apache-override.tmpl b/templates/systemd-apache-override.tmpl
18index 41bd009..1174c49 100644
19--- a/templates/systemd-apache-override.tmpl
20+++ b/templates/systemd-apache-override.tmpl
21@@ -1,3 +1,8 @@
22+[Unit]
23+# Work around LP:1899852
24+After=network-online.target
25+Wants=network-online.target
26+
27 [Service]
28 TasksMax=infinity
29 LimitNOFILE=${max_fds}

Subscribers

People subscribed via source and target branches