Re: [systemd-devel] [PATCH] do not ellipsize cgroup members in full status

2012-09-25 Thread Lukáš Nykrýn
Lennart Poettering píše v Pá 21. 09. 2012 v 12:22 +0200:
 On Thu, 20.09.12 16:30, Lukáš Nykrýn (lnyk...@redhat.com) wrote:
 
  Hello,
  From bug report: https://bugzilla.redhat.com/show_bug.cgi?id=858693
  There is no easy way how to force systemctl status not to crop long
  lines with ellipsis in a virtual terminal. -a or --full options
  doesn't help (and they even shouldn't help, according to the man page)
  
  I am not sure if there should be additional parameter or extend --full,
  but systemctl has already enough parameters.
 
 Using --full for this sounds like a good idea.
 
 Insted of using UINT_MAX here as special value I'd prefer if we could
 follow the semantics of logs-show.h here more closely and introduce a
 bit field?
 
 Lennart
 

I think that in this case we can use the OutputFlags so here is reworked
patch.

Regards
Lukas
From 4d5427101094a29a125176d0010842b3093184fb Mon Sep 17 00:00:00 2001
From: Lukas Nykryn lnyk...@redhat.com
Date: Tue, 25 Sep 2012 15:30:03 +0200
Subject: [PATCH] systemctl: do not ellipsize cgroup members in full status

---
 man/systemctl.xml |2 +-
 src/cgls/cgls.c   |6 ++--
 src/core/selinux-access.c |4 +-
 src/journal/coredump.c|2 +-
 src/journal/journald.c|2 +-
 src/login/loginctl.c  |4 +-
 src/shared/cgroup-show.c  |   36 ++--
 src/shared/cgroup-show.h  |9 +++--
 src/shared/logs-show.h|   20 ---
 src/shared/util.c |   81 +++--
 src/shared/util.h |   22 -
 src/systemctl/systemctl.c |   14 
 12 files changed, 110 insertions(+), 92 deletions(-)

diff --git a/man/systemctl.xml b/man/systemctl.xml
index fedc588..eacd2ed 100644
--- a/man/systemctl.xml
+++ b/man/systemctl.xml
@@ -151,7 +151,7 @@
 termoption--full/option/term
 
 listitemparaDo not ellipsize unit
-names and truncate unit descriptions
+names, cgroup members and truncate unit descriptions
 in the output of
 commandlist-units/command and
 commandlist-jobs/command./para/listitem
diff --git a/src/cgls/cgls.c b/src/cgls/cgls.c
index b2cd968..c7c368d 100644
--- a/src/cgls/cgls.c
+++ b/src/cgls/cgls.c
@@ -132,7 +132,7 @@ int main(int argc, char *argv[]) {
 int q;
 printf(%s:\n, argv[i]);
 
-q = show_cgroup_by_path(argv[i], NULL, 0, arg_kernel_threads, arg_all);
+q = show_cgroup_by_path(argv[i], NULL, 0, arg_kernel_threads, arg_all, 0);
 if (q  0)
 r = q;
 }
@@ -148,7 +148,7 @@ int main(int argc, char *argv[]) {
 
 if (path_startswith(p, /sys/fs/cgroup)) {
 printf(Working Directory %s:\n, p);
-r = show_cgroup_by_path(p, NULL, 0, arg_kernel_threads, arg_all);
+r = show_cgroup_by_path(p, NULL, 0, arg_kernel_threads, arg_all, 0);
 } else {
 char *root = NULL;
 const char *t = NULL;
@@ -163,7 +163,7 @@ int main(int argc, char *argv[]) {
 t = root[0] ? root : /;
 }
 
-r = show_cgroup(SYSTEMD_CGROUP_CONTROLLER, t, NULL, 0, arg_kernel_threads, arg_all);
+r = show_cgroup(SYSTEMD_CGROUP_CONTROLLER, t, NULL, 0, arg_kernel_threads, arg_all, 0);
 free(root);
 }
 
diff --git a/src/core/selinux-access.c b/src/core/selinux-access.c
index 8513634..c4a0901 100644
--- a/src/core/selinux-access.c
+++ b/src/core/selinux-access.c
@@ -236,7 +236,7 @@ static int bus_get_audit_data(
 if (r  0)
 return r;
 
-r = get_process_cmdline(pid, LINE_MAX, true, audit-cmdline);
+r = get_process_cmdline(pid, LINE_MAX, true, audit-cmdline, 0);
 if (r  0)
 return r;
 
@@ -372,7 +372,7 @@ static int get_audit_data(
 if (r  0)
 return r;
 
-r = get_process_cmdline(ucred.pid, LINE_MAX, true, audit-cmdline);
+r = get_process_cmdline(ucred.pid, LINE_MAX, true, audit-cmdline, 0);
 if (r  0)
 return r;
 
diff --git a/src/journal/coredump.c b/src/journal/coredump.c
index a507fc6..8dfadbd 100644
--- a/src/journal/coredump.c
+++ b/src/journal/coredump.c
@@ -205,7 +205,7 @@ int main(int argc, char* argv[]) {
 IOVEC_SET_STRING(iovec[j++], core_exe);
 }
 
-if (get_process_cmdline(pid, LINE_MAX, false, t) = 0) {
+if (get_process_cmdline(pid, LINE_MAX, false, t, 0) = 0) {
 core_cmdline = 

Re: [systemd-devel] [PATCH] do not ellipsize cgroup members in full status

2012-09-25 Thread Lennart Poettering
On Tue, 25.09.12 15:36, Lukáš Nykrýn (lnyk...@redhat.com) wrote:

Heya,

 diff --git a/src/shared/logs-show.h b/src/shared/logs-show.h
 index 3e6b6e0..3b63a5d 100644
 --- a/src/shared/logs-show.h
 +++ b/src/shared/logs-show.h
 @@ -27,26 +27,6 @@
  
  #include util.h
  
 -typedef enum OutputMode {
 -OUTPUT_SHORT,
 -OUTPUT_SHORT_MONOTONIC,
 -OUTPUT_VERBOSE,
 -OUTPUT_EXPORT,
 -OUTPUT_JSON,
 -OUTPUT_JSON_PRETTY,
 -OUTPUT_CAT,
 -_OUTPUT_MODE_MAX,
 -_OUTPUT_MODE_INVALID = -1
 -} OutputMode;
 -
 -typedef enum OutputFlags {
 -OUTPUT_SHOW_ALL   = 1  0,
 -OUTPUT_FOLLOW = 1  1,
 -OUTPUT_WARN_CUTOFF= 1  2,
 -OUTPUT_FULL_WIDTH = 1  3,
 -OUTPUT_COLOR  = 1  4
 -} OutputFlags;
 -

Hmm, I don't think this should be part of util.[ch] really, it's far to
specific to be considered just a utility. Could you please move this to a new
file output.h or so?

 -int get_process_cmdline(pid_t pid, size_t max_length, bool comm_fallback, 
 char **line) {
 -char *r, *k;
 +int get_process_cmdline(pid_t pid, size_t max_length, bool comm_fallback, 
 char **line, OutputFlags flags) {
 +char *r = NULL, *k;
  int c;
 -bool space = false;
 -size_t left;
  FILE *f;

I don't think this flag really should be passed here, this call is too
low-level for that. Instead, max_length == 0 could be used as a good
indicator for as big as needed or so.

Otherwise looks pretty OK!

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] New SELinux Patch to fix gettys not starting and poweroff/reboot commands from userspace working.

2012-09-25 Thread Lennart Poettering
On Mon, 24.09.12 22:00, Daniel J Walsh (dwa...@redhat.com) wrote:

Hmm, the pach doesn't apply got git, is this to 192? Could you rebase
please on current git?

 Call multiple dbus_message_get_args to try to get name field.  One with three
 params, one with two and one with one.  dbus-manager needs to be cleaned up,
 and then we could change SELinux patch to take either a unit file or just a 
 path.

OK, will clean this up, soon, but I guess I should apply your patch first?

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] vconsole: default to the kernel compiled-in font

2012-09-25 Thread Kay Sievers
On Fri, Sep 21, 2012 at 3:57 PM, Bill Nottingham nott...@redhat.com wrote:
 Tom Gundersen (t...@jklm.no) said:
 No longer override the default kernel font if nothing is specified in
 vconsole.conf.

 The default kernel font[0] provides ISO-8859-1 and box characters. Users
 of Arabic, Cyrilic or Hebrew must set a different font manually as these
 character sets were provided by the old default font [1], but are not
 any longer.

 I can see the rationale of fixing the default kernel font, but changing
 the default behavior to one that explicitly excludes a large number of
 configurations that had worked out of the box before is worrisome.

We should really work in that direction. Unconditionally over-loading
stuff from userspace makes not much sense I guess.

 Also, doesn't relying on the default kernel font mean you don't know
 what font you're actually getting? (I.e., if you boot with vgacon, vs
 kmscon, vs vesafb, vs (other), you may get different defaults.)

Not sure how much we should care about native vga fonts in hardware.

They should be all gone with kms drivers loaded, and even qemu has a
kms driver these days in the virtual screen it draws.

I would declare the kernel's defaults for native hardware vga
sufficient, ignoring possible differences to frame buffers a cosmetic
issue. Custom requirements for that can stuff unconditionally
overwrite the font.

So what's needed? An update to the in-kernel font? What's the delta
between the one that is already there and the minimum we need as the
default?

I think anything that needs a custom keymap or setting to be able to
make things work, can also rely on a custom font plugged in at the
same time? Maybe the in-kernel default is already good enough for
that?

Thanks,
Kay
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH v2] vconsole: default to the kernel compiled-in font

2012-09-25 Thread Tom Gundersen
No longer override the default kernel font if nothing is specified in
vconsole.conf.

The default kernel font[0] provides ISO-8859-1 and box characters. Users
of Arabic, Cyrilic or Hebrew must set a different font manually as these
character sets were provided by the old default font [1], but are not
any longer.

Rationale:

 * it is counter-intuitive that an empty vconsole.conf file is different
   from adding FONT=;
 * the version of the default font shipped with Arch (which is the
   upstream one) behaves very badly during early boot[2] (which should
   admittedly be fixed in the font itself);
 * the kernel already supplies a default font, it seems reasonable to
   use that unless anything else is specified;
 * This also avoids a needless slow call to setfont; and
 * We don't want to work around problems in the kernel (in case the
   compiled-in font is not acceptable for whatever reason).

[0]: https://dev.archlinux.org/~tomegun/kernel.bdf
[1]: https://dev.archlinux.org/~tomegun/latarcyrheb.bdf
[2]: http://i.imgur.com/J2tM4.jpg
---

v2: I accidentally forgot to stage a hunk, which caused the previous patch not 
to compile.

 Makefile.am   | 21 +++--
 man/vconsole.conf.xml |  4 +---
 src/vconsole/vconsole-setup.c |  5 ++---
 3 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 5da132c..143546b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -160,43 +160,36 @@ AM_LDFLAGS = $(OUR_LDFLAGS)
 if TARGET_GENTOO
 AM_CPPFLAGS += \
-DKBD_LOADKEYS=\/usr/bin/loadkeys\ \
-   -DKBD_SETFONT=\/usr/bin/setfont\ \
-   -DDEFAULT_FONT=\LatArCyrHeb-16\
+   -DKBD_SETFONT=\/usr/bin/setfont\
 else
 if TARGET_ARCH
 AM_CPPFLAGS += \
-DKBD_LOADKEYS=\/usr/bin/loadkeys\ \
-   -DKBD_SETFONT=\/usr/bin/setfont\ \
-   -DDEFAULT_FONT=\LatArCyrHeb-16\
+   -DKBD_SETFONT=\/usr/bin/setfont\
 else
 if TARGET_FRUGALWARE
 AM_CPPFLAGS += \
-DKBD_LOADKEYS=\/usr/bin/loadkeys\ \
-   -DKBD_SETFONT=\/usr/bin/setfont\ \
-   -DDEFAULT_FONT=\LatArCyrHeb-16\
+   -DKBD_SETFONT=\/usr/bin/setfont\
 else
 if TARGET_MANDRIVA
 AM_CPPFLAGS += \
-DKBD_LOADKEYS=\/bin/loadkeys\ \
-   -DKBD_SETFONT=\/bin/setfont\ \
-   -DDEFAULT_FONT=\LatArCyrHeb-16\
+   -DKBD_SETFONT=\/bin/setfont\
 else
 if TARGET_ANGSTROM
 AM_CPPFLAGS += \
-DKBD_LOADKEYS=\/usr/bin/loadkeys\ \
-   -DKBD_SETFONT=\/usr/bin/setfont\ \
-   -DDEFAULT_FONT=\LatArCyrHeb-16\
+   -DKBD_SETFONT=\/usr/bin/setfont\
 else
 if TARGET_MAGEIA
 AM_CPPFLAGS += \
-DKBD_LOADKEYS=\/bin/loadkeys\ \
-   -DKBD_SETFONT=\/bin/setfont\ \
-   -DDEFAULT_FONT=\LatArCyrHeb-16\
+   -DKBD_SETFONT=\/bin/setfont\
 else
 AM_CPPFLAGS += \
-DKBD_LOADKEYS=\/bin/loadkeys\ \
-   -DKBD_SETFONT=\/bin/setfont\ \
-   -DDEFAULT_FONT=\latarcyrheb-sun16\
+   -DKBD_SETFONT=\/bin/setfont\
 endif
 endif
 endif
diff --git a/man/vconsole.conf.xml b/man/vconsole.conf.xml
index e23a980..258c82b 100644
--- a/man/vconsole.conf.xml
+++ b/man/vconsole.conf.xml
@@ -112,9 +112,7 @@
 
 listitemparaConfigures the console
 font, the console map and the unicode
-font map. varnameFONT=/varname
-defaults to
-
literallatarcyrheb-sun16/literal./para/listitem
+font map./para/listitem
 /varlistentry
 
 /variablelist
diff --git a/src/vconsole/vconsole-setup.c b/src/vconsole/vconsole-setup.c
index 62d9c8d..1227b04 100644
--- a/src/vconsole/vconsole-setup.c
+++ b/src/vconsole/vconsole-setup.c
@@ -215,10 +215,9 @@ int main(int argc, char **argv) {
 utf8 = is_locale_utf8();
 
 vc_keymap = strdup(us);
-vc_font = strdup(DEFAULT_FONT);
 
-if (!vc_keymap || !vc_font) {
-log_error(Failed to allocate strings.);
+if (!vc_keymap) {
+log_error(Failed to allocate string.);
 goto finish;
 }
 
-- 
1.7.12.1

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [ANNOUNCE] systemd 192

2012-09-25 Thread Lennart Poettering
Heya,

Almost exclusively only bug fixes. You want this if you are on 190 or
191 right now.

http://www.freedesktop.org/software/systemd/systemd-192.tar.xz

CHANGES WITH 192:

* The bash completion logic is now available for journalctl
  too.

* We don't mount the cpuset controller anymore together with
  cpu and cpuacct, as cpuset groups generally cannot be
  started if no parameters are assigned to it. cpuset hence
  broke code that assumed it it could create cpu groups and
  just start them.

* journalctl -f will now subscribe to terminal size changes,
  and line break accordingly.

Changes from: Dave Reisner, Kay Sievers, Lennart Poettering,
Lukas Nykrynm, Mirco Tischler, Václav Pavlín

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel