Hi Michael,

the features are basically systemd-journal-gatewayd and systemd-journal-remote.
The package also provides /lib/systemd/system/systemd-journal-gatewayd.socket 
and /lib/systemd/system/systemd-journal-remote.socket which are just not 
enabled by default.
While journal-gatewayd is meant to be run as a sevice, journal-remote can be 
used also from command-line, script or custom service.

I use journal-remote in a custom service like this for example:
ExecStart=/lib/systemd/systemd-journal-remote 
--output=/var/log/journal/remote/remote-mc.journal --getter='/usr/bin/python3 
-u -B /usr/sbin/mc-log mc 5600'

To make it work out of the box we could add options to enable the one or the 
other socket.

I don't see a good way to better name this option or make it more 
feature-oriented.

Artur

--
Dipl. Ing. Artur Wiebe
Software-Ingenieur

Email: ar...@4wiebe.de
Telefon: +491632699840
Web: artur.4wiebe.de
Quellenstraße 49, 72124 Pliezhausen
USt-IdNr: DE299286057

Am Montag, Januar 16, 2017 11:40 CET, Michael Olbrich 
<m.olbr...@pengutronix.de> schrieb:
 On Tue, Jan 10, 2017 at 02:05:24PM +0100, Artur Wiebe wrote:
> Build systemd with libmicrohttpd support
>
> Signed-off-by: Artur Wiebe <ar...@4wiebe.de>
> ---
> projectroot/etc/group | 4 +++-
> projectroot/etc/passwd | 3 +++
> rules/systemd.in | 27 +++++++++++++++++++--------
> rules/systemd.make | 8 +++++++-
> 4 files changed, 32 insertions(+), 10 deletions(-)
>
> diff --git a/projectroot/etc/group b/projectroot/etc/group
> index 9ff570261..bee568357 100644
> --- a/projectroot/etc/group
> +++ b/projectroot/etc/group
> @@ -22,5 +22,7 @@ input:x:116:
> mysql:x:117:
> systemd-journal:x:201:
> systemd-network:x:202:
> -systemd-journal-remote:x:203:
> +systemd-journal-gateway:x:206:
> +systemd-journal-remote:x:207:
> +systemd-journal-upload:x:208:

Don't change an existing goup id.

> nogroup:x:65534:
> diff --git a/projectroot/etc/passwd b/projectroot/etc/passwd
> index 29c85577a..b41d6e8a8 100644
> --- a/projectroot/etc/passwd
> +++ b/projectroot/etc/passwd
> @@ -9,5 +9,8 @@ systemd-network:x:202:202:systemd-network:/dev/null:/bin/false
> systemd-resolve:x:203:65534:systemd-resolve:/dev/null:/bin/false
> systemd-timesync:x:204:65534:systemd-timesync:/dev/null:/bin/false
> systemd-bus-proxy:x:205:65534:systemd-timesync:/dev/null:/bin/false

Hmm, systemd-bus-proxy should be removed first. It's no longer used. I'll
make a patch for that.

> +systemd-journal-gateway:x:206:206:systemd-journal-gateway:/dev/null:/bin/false
> +systemd-journal-remote:x:207:207:systemd-journal-remote:/dev/null:/bin/false
> +systemd-journal-upload:x:208:208:systemd-journal-upload:/dev/null:/bin/false
> rpcuser:x:65533:65534:RPC user:/dev/null:/bin/false
> nobody:x:65534:65534:Unprivileged Nobody:/dev/null:/bin/false
> diff --git a/rules/systemd.in b/rules/systemd.in
> index 86ee54534..ccce1f908 100644
> --- a/rules/systemd.in
> +++ b/rules/systemd.in
> @@ -21,6 +21,7 @@ menuconfig SYSTEMD
> select MACHINE_ID if RUNTIME
> select XZ if SYSTEMD_XZ
> select LZ4 if SYSTEMD_LZ4
> + select LIBMICROHTTPD if SYSTEMD_MICROHTTPD
> select LIBSECCOMP if SYSTEMD_SECCOMP
> select LIBSELINUX if GLOBAL_SELINUX
> select IPTABLES if SYSTEMD_IPMASQUERADE
> @@ -58,14 +59,6 @@ config SYSTEMD_VCONSOLE
> bool
> prompt "virtual console support"
>
> -config SYSTEMD_XZ
> - bool
> - prompt "XZ compressed journal support"
> -
> -config SYSTEMD_LZ4
> - bool
> - prompt "LZ4 compressed journal support"
> -
> config SYSTEMD_DISABLE_RANDOM_SEED
> bool
> prompt "disable random seed services"
> @@ -113,5 +106,23 @@ config SYSTEMD_SECCOMP
> Enable this if you want to use SystemCallFilter in service files
>
>
> +menu "journald "
> +
> +config SYSTEMD_XZ
> + bool
> + prompt "XZ compressed journal support"
> +
> +config SYSTEMD_LZ4
> + bool
> + prompt "LZ4 compressed journal support"
> +
> +config SYSTEMD_MICROHTTPD

I'd like to see a more feature oriented option here. Both the name and how
it is used. I've never used this myself but from what I can tell, this is
used to send or receive a journal in push or pull mode. I'd like to see
options, that work out of the box without extra rules to actually make it
work.
You don't need to implement all use-cases. Just start with your use-case.
We can add others as needed.

Michael


> + bool
> + prompt "Journald gateway and remote support"
> + help
> + Build systemd with libmicrohttpd support
> +
> +endmenu
> +
> endif
>
> diff --git a/rules/systemd.make b/rules/systemd.make
> index f78de72d4..525097525 100644
> --- a/rules/systemd.make
> +++ b/rules/systemd.make
> @@ -89,7 +89,7 @@ SYSTEMD_CONF_OPT := \
> --disable-libcryptsetup \
> --disable-qrencode \
> --disable-gnutls \
> - --disable-microhttpd \
> + --$(call ptx/endis,PTXCONF_SYSTEMD_MICROHTTPD)-microhttpd \
> --disable-libcurl \
> --disable-libidn \
> --$(call ptx/endis,PTXCONF_SYSTEMD_IPMASQUERADE)-libiptc \
> @@ -187,6 +187,8 @@ SYSTEMD_HELPER := \
> systemd-hostnamed \
> systemd-initctl \
> systemd-journald \
> + $(call ptx/ifdef, PTXCONF_SYSTEMD_MICROHTTPD,systemd-journal-gatewayd,) \
> + $(call ptx/ifdef, PTXCONF_SYSTEMD_MICROHTTPD,systemd-journal-remote,) \
> $(call ptx/ifdef, PTXCONF_SYSTEMD_LOCALES,systemd-localed,) \
> $(call ptx/ifdef, PTXCONF_SYSTEMD_LOGIND,systemd-logind,) \
> systemd-modules-load \
> @@ -312,6 +314,10 @@ ifdef PTXCONF_SYSTEMD_LOCALES
> @$(call install_copy, systemd, 0, 0, 0644, -, 
> /usr/share/systemd/kbd-model-map)
> endif
>
> +ifdef PTXCONF_SYSTEMD_MICROHTTPD
> + @$(call install_alternative, systemd, 0, 0, 0644, 
> /etc/systemd/journal-remote.conf)
> +endif
> +
> @$(call install_copy, systemd, 0, 0, 0644, -, 
> /lib/udev/rules.d/99-systemd.rules)
> ifdef PTXCONF_SYSTEMD_NETWORK
> @$(call install_tree, systemd, 0, 0, -, /lib/systemd/network)
> --
> 2.11.0
>
>
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de

--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
 
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

Reply via email to