Skip to contentSkip to conversation

systemd misc fixes

PATCH In review Chen Qi 2 participants 11 messages Jan 20, 2014 – Jan 23, 2014 3 messages not in the archive

lore
Share & tools
lore

Chen Qi

author
#0 lore raw

v3 cover systemd misc fixes

Changes since V2:
1. Recommend the 'less' package instead of depend on it.

The following changes since commit 8163854adf87ac42a8f08ee25685d0ce1efb4724:

oe-selftest: separated the SStateBase and SStateTests in different modules (2014-01-16 12:18:44 +0000)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib ChenQi/systemd-misc-fixes2
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/systemd-misc-fixes2

Chen Qi (5):
systemd: add 'less' to its RRECOMMENDS
dropbear: add systemd unit files
openssh: fixes for systemd
distcc: add systemd support
at: add systemd support

 .../openssh/openssh-6.4p1/sshd.socket              |    1 -
 .../openssh/openssh-6.4p1/[email protected]            |    1 +
 .../openssh/openssh-6.4p1/sshdgenkeys.service      |    8 ++++----
 meta/recipes-connectivity/openssh/openssh_6.4p1.bb |    4 ++--
 meta/recipes-core/dropbear/dropbear.inc            |   17 ++++++++++++++++-
 .../recipes-core/dropbear/dropbear/dropbear.socket |   10 ++++++++++
 .../dropbear/dropbear/[email protected]            |   11 +++++++++++
 .../dropbear/dropbear/dropbearkey.service          |    8 ++++++++
 meta/recipes-core/systemd/systemd_208.bb           |    2 ++
 meta/recipes-devtools/distcc/distcc_3.1.bb         |   14 +++++++++++---
 meta/recipes-devtools/distcc/files/default         |    5 +++++
 meta/recipes-devtools/distcc/files/distccd.service |   11 +++++++++++
 meta/recipes-extended/at/at_3.1.14.bb              |   10 +++++++++-
 meta/recipes-extended/at/files/atd.service         |    9 +++++++++
 14 files changed, 99 insertions(+), 12 deletions(-)
 create mode 100644 meta/recipes-core/dropbear/dropbear/dropbear.socket
 create mode 100644 meta/recipes-core/dropbear/dropbear/[email protected]
 create mode 100644 meta/recipes-core/dropbear/dropbear/dropbearkey.service
 create mode 100644 meta/recipes-devtools/distcc/files/distccd.service
 create mode 100644 meta/recipes-extended/at/files/atd.service
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH v3 1/5 systemd: add 'less' to its RRECOMMENDS

The less command provided by busybox cannot interpret the control character, resulting in obscure output of the journalctl command in a systemd based image.

Add the 'less' package to systemd's RRECOMMENDS so that the output of 'journalctl' looks clear to users.

[YOCTO #5723]

---
 meta/recipes-core/systemd/systemd_208.bb |    2 ++
 1 file changed, 2 insertions(+)
meta/recipes-core/systemd/systemd_208.bb +2 -0
index 6590235..3c44dec 100644
@@ -219,10 +219,12 @@ FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ $
 
 RDEPENDS_${PN} += "kmod dbus util-linux-mount"
 
+# Recommend the less package to correctly display the contents of 'journalctl'
 RRECOMMENDS_${PN} += "systemd-serialgetty systemd-compat-units \
                       util-linux-agetty \
                       util-linux-fsck e2fsprogs-e2fsck \
                       kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \
+                      less \
 "
 
 PACKAGES =+ "udev-dbg udev udev-utils udev-hwdb"
Signature · 1 line
1.7.9.5
author
#10 lore raw

PATCH v3 2/5 dropbear: add systemd unit files

In reply to Chen Qi

This patch mainly comes from meta-systemd with a few modifications. The purpose is to get rid of the LSB init scripts in systemd images.

[YOCTO #4420]

---
 meta/recipes-core/dropbear/dropbear.inc            |   17 ++++++++++++++++-
 .../recipes-core/dropbear/dropbear/dropbear.socket |   10 ++++++++++
 .../dropbear/dropbear/[email protected]            |   11 +++++++++++
 .../dropbear/dropbear/dropbearkey.service          |    8 ++++++++
 4 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-core/dropbear/dropbear/dropbear.socket
 create mode 100644 meta/recipes-core/dropbear/dropbear/[email protected]
 create mode 100644 meta/recipes-core/dropbear/dropbear/dropbearkey.service
meta/recipes-core/dropbear/dropbear.inc +16 -1
index e85a9e6..d5fceec 100644
@@ -19,17 +19,22 @@ SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \
            file://0004-fix-2kb-keys.patch \
            file://0007-dropbear-fix-for-x32-abi.patch \
            file://init \
+           file://dropbearkey.service \
+           file://[email protected] \
+           file://dropbear.socket \
            ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} "
 
 PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \
                file://0006-dropbear-configuration-file.patch \
                file://dropbear"
 
-inherit autotools update-rc.d
+inherit autotools update-rc.d systemd
 
 INITSCRIPT_NAME = "dropbear"
 INITSCRIPT_PARAMS = "defaults 10"
 
+SYSTEMD_SERVICE_${PN} = "dropbear.socket"
+
 CFLAGS_prepend = " -I. "
 LD = "${CC}"
 
@@ -66,6 +71,16 @@ do_install() {
 		install -d ${D}${sysconfdir}/pam.d
 		install -m 0644 ${WORKDIR}/dropbear  ${D}${sysconfdir}/pam.d/
 	fi
+
+	# deal with systemd unit files
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/dropbearkey.service ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/[email protected] ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/dropbear.socket ${D}${systemd_unitdir}/system
+	sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
+	       -e 's,@BINDIR@,${bindir},g' \
+	       -e 's,@SBINDIR@,${sbindir},g' \
+	       ${D}${systemd_unitdir}/system/dropbear.socket ${D}${systemd_unitdir}/system/*.service
 }
 
 inherit update-alternatives
meta/recipes-core/dropbear/dropbear/dropbear.socket new file +10 -0
new file mode 100644
index 0000000..e5c61b7
@@ -0,0 +1,10 @@
+[Unit]
+Conflicts=dropbear.service
+
+[Socket]
+ListenStream=22
+Accept=yes
+
+[Install]
+WantedBy=sockets.target
+Also=dropbearkey.service
meta/recipes-core/dropbear/dropbear/[email protected] new file +11 -0
new file mode 100644
index 0000000..6fe9942
@@ -0,0 +1,11 @@
+[Unit]
+Description=SSH Per-Connection Server
+Wants=dropbearkey.service
+After=syslog.target dropbearkey.service
+
+[Service]
+EnvironmentFile=-/etc/default/dropbear
+ExecStart=-@SBINDIR@/dropbear -i -r /etc/dropbear/dropbear_rsa_host_key $DROPBEAR_EXTRA_ARGS
+ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
+StandardInput=socket
+KillMode=process
meta/recipes-core/dropbear/dropbear/dropbearkey.service new file +8 -0
new file mode 100644
index 0000000..ccc21d5
@@ -0,0 +1,8 @@
+[Unit]
+Description=SSH Key Generation
+ConditionPathExists=|!/etc/dropbear/dropbear_rsa_host_key
+
+[Service]
+Type=oneshot
+ExecStart=@SBINDIR@/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
+RemainAfterExit=yes
Signature · 1 line
1.7.9.5
author
#11 lore raw

PATCH v3 3/5 openssh: fixes for systemd

In reply to Chen Qi

This patch contains a few fixes for the systemd unit files of openssh. The fixes use the same unit files in Fedora 20 as a reference.

1) Remove sshdgenkeys.service and [email protected] from SYSTEMD_SERVICE.
2) Fix the dependency and logic of sshdgenkeys.service.

---
 .../openssh/openssh-6.4p1/sshd.socket              |    1 -
 .../openssh/openssh-6.4p1/[email protected]            |    1 +
 .../openssh/openssh-6.4p1/sshdgenkeys.service      |    8 ++++----
 meta/recipes-connectivity/openssh/openssh_6.4p1.bb |    4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)
meta/recipes-connectivity/openssh/openssh-6.4p1/sshd.socket +0 -1
index d19ab2a..12c39b2 100644
@@ -8,4 +8,3 @@ Accept=yes
 
 [Install]
 WantedBy=sockets.target
-Also=sshdgenkeys.service
meta/recipes-connectivity/openssh/openssh-6.4p1/[email protected] +1 -0
index 64e009f..4eda659 100644
@@ -1,5 +1,6 @@
 [Unit]
 Description=OpenSSH Per-Connection Daemon
+Wants=sshdgenkeys.service
 After=sshdgenkeys.service
 
 [Service]
meta/recipes-connectivity/openssh/openssh-6.4p1/sshdgenkeys.service +4 -4
index 2fd8a9a..c21d70b 100644
@@ -1,10 +1,10 @@
 [Unit]
-Description=SSH Key Generation
+Description=OpenSSH Key Generation
+ConditionPathExists=|!/etc/ssh/ssh_host_rsa_key
+ConditionPathExists=|!/etc/ssh/ssh_host_dsa_key
+ConditionPathExists=|!/etc/ssh/ssh_host_ecdsa_key
 
 [Service]
 ExecStart=@BINDIR@/ssh-keygen -A
 Type=oneshot
 RemainAfterExit=yes
-
-[Install]
-WantedBy=multi-user.target
meta/recipes-connectivity/openssh/openssh_6.4p1.bb +2 -2
index c61d16f..1f78566 100644
@@ -44,7 +44,7 @@ INITSCRIPT_NAME_${PN}-sshd = "sshd"
 INITSCRIPT_PARAMS_${PN}-sshd = "defaults 9"
 
 SYSTEMD_PACKAGES = "${PN}-sshd"
-SYSTEMD_SERVICE_${PN}-sshd = "sshd.socket [email protected] sshdgenkeys.service"
+SYSTEMD_SERVICE_${PN}-sshd = "sshd.socket"
 
 PACKAGECONFIG ??= "tcp-wrappers"
 PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,,tcp-wrappers"
@@ -114,7 +114,7 @@ ALLOW_EMPTY_${PN} = "1"
 PACKAGES =+ "${PN}-keygen ${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-sftp ${PN}-misc ${PN}-sftp-server"
 FILES_${PN}-scp = "${bindir}/scp.${BPN}"
 FILES_${PN}-ssh = "${bindir}/ssh.${BPN} ${sysconfdir}/ssh/ssh_config"
-FILES_${PN}-sshd = "${sbindir}/sshd ${sysconfdir}/init.d/sshd"
+FILES_${PN}-sshd = "${sbindir}/sshd ${sysconfdir}/init.d/sshd ${systemd_unitdir}/system"
 FILES_${PN}-sshd += "${sysconfdir}/ssh/moduli ${sysconfdir}/ssh/sshd_config ${sysconfdir}/ssh/sshd_config_readonly ${sysconfdir}/default/volatiles/99_sshd"
 FILES_${PN}-sftp = "${bindir}/sftp"
 FILES_${PN}-sftp-server = "${libexecdir}/sftp-server"
Signature · 1 line
1.7.9.5
author
#12 lore raw

PATCH v3 4/5 distcc: add systemd support

In reply to Chen Qi

Add systemd support for distcc.

These unit files mainly use the same files in Fedora 20 as a reference.

[YOCTO #4420]

---
 meta/recipes-devtools/distcc/distcc_3.1.bb         |   14 +++++++++++---
 meta/recipes-devtools/distcc/files/default         |    5 +++++
 meta/recipes-devtools/distcc/files/distccd.service |   11 +++++++++++
 3 files changed, 27 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-devtools/distcc/files/distccd.service
meta/recipes-devtools/distcc/distcc_3.1.bb +11 -3
index e351a58..c3cbd05 100644
@@ -22,12 +22,13 @@ SRC_URI = "http://distcc.googlecode.com/files/${BPN}-${PV}.tar.bz2 \
            file://separatebuilddir.patch \
            file://default \
            file://distccmon-gnome.desktop \
-           file://distcc"
+           file://distcc \
+           file://distccd.service"
 
 SRC_URI[md5sum] = "a1a9d3853df7133669fffec2a9aab9f3"
 SRC_URI[sha256sum] = "f55dbafd76bed3ce57e1bbcdab1329227808890d90f4c724fcd2d53f934ddd89"
 
-inherit autotools pkgconfig update-rc.d useradd
+inherit autotools pkgconfig update-rc.d useradd systemd
 
 EXTRA_OECONF += "--disable-Werror PYTHON=/dev/null"
 
@@ -40,11 +41,17 @@ USERADD_PARAM_${PN} = "--system \
 
 INITSCRIPT_NAME = "distcc"
 
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "distccd.service"
+
 do_install_append() {
     install -d ${D}${sysconfdir}/init.d/
     install -d ${D}${sysconfdir}/default
     install -m 0755 ${WORKDIR}/distcc ${D}${sysconfdir}/init.d/
     install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/distcc
+    install -d ${D}${systemd_unitdir}/system/
+    install -m 0644 ${WORKDIR}/distccd.service ${D}${systemd_unitdir}/system
+    sed -i -e 's,@BINDIR@,${bindir},g' ${D}${systemd_unitdir}/system/distccd.service
     ${DESKTOPINSTALL}
 }
 DESKTOPINSTALL = ""
@@ -58,7 +65,8 @@ FILES_${PN} = " ${sysconfdir} \
 		${bindir}/distcc \
     ${bindir}/lsdistcc \
 		${bindir}/distccd \
-		${bindir}/distccmon-text"
+		${bindir}/distccmon-text \
+		${systemd_unitdir}/system/distccd.service"
 FILES_distcc-distmon-gnome = "  ${bindir}/distccmon-gnome \
 				${datadir}/distcc"
 
meta/recipes-devtools/distcc/files/default +5 -0
index 95290f8..63c4159 100644
@@ -17,3 +17,8 @@ STARTDISTCC="true"
 # ALLOWEDNETS="127.0.0.1"
 
 ALLOWEDNETS="192.168.7.0/24"
+
+#
+# OPTIONS is used for the systemd service file
+#
+OPTIONS="--allow 192.168.7.0/24"
meta/recipes-devtools/distcc/files/distccd.service new file +11 -0
new file mode 100644
index 0000000..0253ddf
@@ -0,0 +1,11 @@
+[Unit]
+Description=Distccd A Distributed Compilation Server
+After=network.target
+
+[Service]
+User=distcc
+EnvironmentFile=-/etc/default/distcc
+ExecStart=@BINDIR@/distccd --verbose --no-detach --daemon $OPTIONS
+
+[Install]
+WantedBy=multi-user.target
Signature · 1 line
1.7.9.5
author
#13 lore raw

PATCH v3 5/5 at: add systemd support

In reply to Chen Qi

Add systemd support for at.

This patch mainly comes from meta-systemd.

[YOCTO #4420]

---
 meta/recipes-extended/at/at_3.1.14.bb      |   10 +++++++++-
 meta/recipes-extended/at/files/atd.service |    9 +++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-extended/at/files/atd.service
meta/recipes-extended/at/at_3.1.14.bb +9 -1
index 0a13157..480e732 100644
@@ -22,6 +22,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/a/at/at_${PV}.orig.tar.gz \
     file://posixtm.h \
     file://file_replacement_with_gplv2.patch \
     file://S99at \
+    file://atd.service \
     ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)}"
 
 PAM_SRC_URI = "file://pam.conf.patch \
@@ -37,7 +38,9 @@ EXTRA_OECONF += "ac_cv_path_SENDMAIL=/bin/true \
                  --with-atspool=/var/spool/at/spool \
                  ac_cv_header_security_pam_appl_h=${@base_contains('DISTRO_FEATURES', 'pam', 'yes', 'no', d)} "
 
-inherit autotools
+inherit autotools systemd
+
+SYSTEMD_SERVICE_${PN} = "atd.service"
 
 PARALLEL_MAKE = ""
 
@@ -53,6 +56,11 @@ do_install () {
 	install -m 0755    ${WORKDIR}/S99at		${D}${sysconfdir}/init.d/atd
 	ln -sf ../init.d/atd ${D}${sysconfdir}/rcS.d/S99at
 
+	# install systemd unit files
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/atd.service ${D}${systemd_unitdir}/system
+	sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/atd.service
+
 	if [ "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; then
 		install -D -m 0644 ${WORKDIR}/${BP}/pam.conf ${D}${sysconfdir}/pam.d/atd
 	fi
meta/recipes-extended/at/files/atd.service new file +9 -0
new file mode 100644
index 0000000..6dc8445
@@ -0,0 +1,9 @@
+[Unit]
+Description=Job spooling tools
+After=syslog.target
+
+[Service]
+ExecStart=@SBINDIR@/atd -f
+
+[Install]
+WantedBy=multi-user.target
Signature · 1 line
1.7.9.5
#2 lore raw

Re: [PATCH V3 1/5] systemd: add 'less' to its RRECOMMENDS

In reply to Chen Qi
Quoted 3 lines · On 20 January 2014 03:23:02 Chen Qi <[email protected]> wrote:

The less command provided by busybox cannot interpret the control character, resulting in obscure output of the journalctl command in a systemd based image.

Can you send me the input containing this control character, please?

Perhaps we can do something sensible about it..
TIA,

Quoted 32 lines

Add the 'less' package to systemd's RRECOMMENDS so that the output of 'journalctl' looks clear to users.

[YOCTO #5723]

---
 meta/recipes-core/systemd/systemd_208.bb |    2 ++
 1 file changed, 2 insertions(+)
meta/recipes-core/systemd/systemd_208.bb +0 -0
index 6590235..3c44dec 100644
@@ -219,10 +219,12 @@ FILES_${PN}-dev += "${base_libdir}/security/*.la 

${datadir}/dbus-1/interfaces/ $

RDEPENDS_${PN} += "kmod dbus util-linux-mount"

meta/recipes-core/systemd/systemd_208.bb +2 -1
+# Recommend the less package to correctly display the contents of 'journalctl'
 RRECOMMENDS_${PN} += "systemd-serialgetty systemd-compat-units \
                       util-linux-agetty \
                       util-linux-fsck e2fsprogs-e2fsck \
                       kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \
+                      less \
 "
 
 PACKAGES =+ "udev-dbg udev udev-utils udev-hwdb"
--

1.7.9.5

Quoted 4 lines

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Sent with AquaMail for Android
http://www.aqua-mail.com

author
#3 lore raw

Re: [PATCH V3 1/5] systemd: add 'less' to its RRECOMMENDS

Quoted 10 lines · Bernhard Reutner-Fischer
Quoted 3 lines · On 20 January 2014 03:23:02 Chen Qi <[email protected]> wrote:

The less command provided by busybox cannot interpret the control character, resulting in obscure output of the journalctl command in a systemd based image.

Can you send me the input containing this control character, please?

Perhaps we can do something sensible about it..
TIA,

For more details, please refer to https://bugzilla.yoctoproject.org/show_bug.cgi?id=5723.
You can also add you comments there.

Best Regards,
Chen Qi

Quoted 47 lines
Quoted 26 lines

Add the 'less' package to systemd's RRECOMMENDS so that the output of 'journalctl' looks clear to users.

[YOCTO #5723]

---
 meta/recipes-core/systemd/systemd_208.bb |    2 ++
 1 file changed, 2 insertions(+)
meta/recipes-core/systemd/systemd_208.bb +0 -0
index 6590235..3c44dec 100644
@@ -219,10 +219,12 @@ FILES_${PN}-dev += 

"${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ $

RDEPENDS_${PN} += "kmod dbus util-linux-mount"

+# Recommend the less package to correctly display the contents of 'journalctl'

 RRECOMMENDS_${PN} += "systemd-serialgetty systemd-compat-units \
                       util-linux-agetty \
                       util-linux-fsck e2fsprogs-e2fsck \
                       kernel-module-autofs4 kernel-module-unix 
Quoted 12 lines

kernel-module-ipv6 \
+ less \
"

PACKAGES =+ "udev-dbg udev udev-utils udev-hwdb"

Signature · 6 lines
1.7.9.5

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Sent with AquaMail for Android
http://www.aqua-mail.com

#4 lore raw

Re: [PATCH V3 1/5] systemd: add 'less' to its RRECOMMENDS

Quoted 11 lines · ChenQi
Quoted 10 lines · Bernhard Reutner-Fischer
Quoted 3 lines · On 20 January 2014 03:23:02 Chen Qi <[email protected]> wrote:

The less command provided by busybox cannot interpret the control character, resulting in obscure output of the journalctl command in a systemd based image.

Can you send me the input containing this control character, please?

Quoted 7 lines
Quoted 2 lines

Perhaps we can do something sensible about it..
TIA,

For more details, please refer to
https://bugzilla.yoctoproject.org/show_bug.cgi?id=5723.
You can also add you comments there.

Can you please try:
http://marc.info/?l=busybox&m=139038437907397&w=2
and let me know if this fixes your issue?

thanks,

author
#7 lore raw

Re: [PATCH V3 1/5] systemd: add 'less' to its RRECOMMENDS

In reply to a message not in the archive
Quoted 27 lines · Bernhard Reutner-Fischer
Quoted 26 lines · ChenQi
Quoted 13 lines · Bernhard Reutner-Fischer
Quoted 12 lines · ChenQi
Quoted 10 lines · Bernhard Reutner-Fischer
Quoted 3 lines · On 20 January 2014 03:23:02 Chen Qi <[email protected]> wrote:

The less command provided by busybox cannot interpret the control character, resulting in obscure output of the journalctl command in a systemd based image.

Can you send me the input containing this control character, please?

Perhaps we can do something sensible about it..
TIA,

Quoted 10 lines
Quoted 3 lines

For more details, please refer to
https://bugzilla.yoctoproject.org/show_bug.cgi?id=5723.
You can also add you comments there.

Can you please try:
http://marc.info/?l=busybox&m=139038437907397&w=2
and let me know if this fixes your issue?

thanks,

Hi,

Quoted 8 lines
Quoted 3 lines

I cannot open the link.
Could you please send me your patches as attachment? I'll try them out tomorrow and let you know the results.

http://marc.info/?l=busybox&m=139038437907397&q=raw
or, just for you:
http://busybox.net/~aldot/tmp/0001-less-Add-R.patch

thanks,

Hi Bernhard,

I just tried this patch out.

1) Test 1
Command: journalctl
Result: control characters not interpreted
Log:

Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: RSDP 000f1610 00014 (v00 BOCHS )[[
0m
Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: RSDT 0fffe450 00034 (v01 BOCHS  BX
PCRSDT 00000001 BXPC 00000001)[[0m
Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: FACP 0fffff80 00074 (v01 BOCHS  BX
PCFACP 00000001 BXPC 00000001)[[0m
Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: DSDT 0fffe490 01137 (v01   BXPC
BXDSDT 00000001 INTL 20120913)[[0m
Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: FACS 0fffff40 00040[[0m
Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: SSDT 0ffff700 00838 (v01 BOCHS  BX
PCSSDT 00000001 BXPC 00000001)[[0m
Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: APIC 0ffff610 00078 (v01 BOCHS  BX
PCAPIC 00000001 BXPC 00000001)[[0m
Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: HPET 0ffff5d0 00038 (v01 BOCHS  BX
PCHPET 00000001 BXPC 00000001)[[0m
Jan 23 07:35:49 qemux86 kernel: ACPI: Local APIC address 0xfee00000
Jan 23 07:35:49 qemux86 kernel: [[1;39m0MB HIGHMEM available.[[0m
Jan 23 07:35:49 qemux86 kernel: [[1;39m255MB LOWMEM available.[[0m

2) Test 2
Command: export SYSTEMD_PAGER="less -R"; journalctl
Result: control characters interpreted

I know the behavior of `less' command from busybox is different from that of the 'less' package. And we can't ask too much.
But do you think it's possible to make 'journalctl' work correctly without setting SYSTEMD_PAGER to "less -R"? I'm wondering why busybox's 'less' doesn't use the '-R' behaviour as its default. If so, we would not need this '-R' option at all.

Best Regards,
Chen Qi

#9 lore raw

Re: [PATCH V3 1/5] systemd: add 'less' to its RRECOMMENDS

In reply to a message not in the archive
Quoted 64 lines · On 23 January 2014 09:23:18 ChenQi <[email protected]> wrote:
Quoted 27 lines · Bernhard Reutner-Fischer
Quoted 26 lines · ChenQi
Quoted 13 lines · Bernhard Reutner-Fischer
Quoted 12 lines · ChenQi
Quoted 10 lines · Bernhard Reutner-Fischer
Quoted 3 lines · On 20 January 2014 03:23:02 Chen Qi <[email protected]> wrote:

The less command provided by busybox cannot interpret the control character, resulting in obscure output of the journalctl command in a systemd based image.

Can you send me the input containing this control character, please?

Perhaps we can do something sensible about it..
TIA,

Quoted 10 lines
Quoted 3 lines

For more details, please refer to
https://bugzilla.yoctoproject.org/show_bug.cgi?id=5723.
You can also add you comments there.

Can you please try:
http://marc.info/?l=busybox&m=139038437907397&w=2
and let me know if this fixes your issue?

thanks,

Hi,

Quoted 8 lines
Quoted 3 lines

I cannot open the link.
Could you please send me your patches as attachment? I'll try them out tomorrow and let you know the results.

http://marc.info/?l=busybox&m=139038437907397&q=raw
or, just for you:
http://busybox.net/~aldot/tmp/0001-less-Add-R.patch

thanks,

Hi Bernhard,

I just tried this patch out.

1) Test 1
Command: journalctl
Result: control characters not interpreted
Log:

Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: RSDP 000f1610 00014 (v00 BOCHS )[[
0m
Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: RSDT 0fffe450 00034 (v01 BOCHS  BX
PCRSDT 00000001 BXPC 00000001)[[0m
Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: FACP 0fffff80 00074 (v01 BOCHS  BX
PCFACP 00000001 BXPC 00000001)[[0m
Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: DSDT 0fffe490 01137 (v01 BXPC
BXDSDT 00000001 INTL 20120913)[[0m
Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: FACS 0fffff40 00040[[0m
Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: SSDT 0ffff700 00838 (v01 BOCHS  BX
PCSSDT 00000001 BXPC 00000001)[[0m
Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: APIC 0ffff610 00078 (v01 BOCHS  BX
PCAPIC 00000001 BXPC 00000001)[[0m
Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: HPET 0ffff5d0 00038 (v01 BOCHS  BX
PCHPET 00000001 BXPC 00000001)[[0m
Jan 23 07:35:49 qemux86 kernel: ACPI: Local APIC address 0xfee00000
Jan 23 07:35:49 qemux86 kernel: [[1;39m0MB HIGHMEM available.[[0m
Jan 23 07:35:49 qemux86 kernel: [[1;39m255MB LOWMEM available.[[0m
Quoted 6 lines

2) Test 2
Command: export SYSTEMD_PAGER="less -R"; journalctl
Result: control characters interpreted

I know the behavior of `less' command from busybox is different from that of the 'less' package. And we can't ask too much.
But do you think it's possible to make 'journalctl' work correctly without setting SYSTEMD_PAGER to "less -R"? I'm wondering why busybox's 'less' doesn't use the '-R' behaviour as its default. If so, we would not need this '-R' option at all.

Apparently Denys does not like the idea of having -R in there at all but even if it gets in, defaulting to -R is not acceptable I think. We could, however, add parsing the LESS env var as the big less does. I guess that would add another 30-40 bytes to the 300-ish for the -R itself, though. Plain -r was much smaller, but I dropped it due to paranoia, fwiw.

To some extent I do agree with Denys that journalctl should only print ANSI colors if it's stdout isatty.

Thanks,

Sent with AquaMail for Android
http://www.aqua-mail.com