Merge ~paride/utah/+git/utah:latecommand-fixes into utah:master

Proposed by Paride Legovini
Status: Merged
Approved by: Jean-Baptiste Lallement
Approved revision: 96579fbabbc49fff070fe2ea9d8f46b67ac7547d
Merged at revision: 96579fbabbc49fff070fe2ea9d8f46b67ac7547d
Proposed branch: ~paride/utah/+git/utah:latecommand-fixes
Merge into: utah:master
Diff against target: 26 lines (+8/-1)
2 files modified
templates/latecommand-wrapper.jinja2 (+3/-0)
templates/log-function.jinja2 (+5/-1)
Reviewer Review Type Date Requested Status
Jean-Baptiste Lallement Approve
Review via email: mp+370197@code.launchpad.net

Commit message

Fix the "latecommand" execution

Changes:
 * Add workaround for LP: #1836734
 * log-function: to not rely on /dev/log being present

To post a comment you must log in.
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Tested with eoan too. Approved. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/templates/latecommand-wrapper.jinja2 b/templates/latecommand-wrapper.jinja2
2index 4def4b0..7e759e8 100644
3--- a/templates/latecommand-wrapper.jinja2
4+++ b/templates/latecommand-wrapper.jinja2
5@@ -1,5 +1,8 @@
6 #!/bin/sh
7 set -ex
8+
9+export PATH=$PATH:/usr/lib/ubiquity/compat
10+
11 {% include "log-function.jinja2" %}
12
13 log "Running UTAH late command..."
14diff --git a/templates/log-function.jinja2 b/templates/log-function.jinja2
15index 91e69f4..1f8ec1f 100644
16--- a/templates/log-function.jinja2
17+++ b/templates/log-function.jinja2
18@@ -1,3 +1,7 @@
19 log() {
20- logger -s -t utah "$1" 2>>{{log_file}}
21+ if test -e /dev/log ; then
22+ logger -s -t utah "$1" 2>>{{log_file}}
23+ else
24+ printf "%s\n" "$1" >{{log_file}}
25+ fi
26 }

Subscribers

People subscribed via source and target branches