[systemd-devel] [PATCH] build-sys: require certain version of libselinux

2012-09-20 Thread Jan Engelhardt
./.libs/libsystemd-core.a(libsystemd_core_la-selinux-access.o):
In function selinux_access_check:
src/core/selinux-access.c:487: undefined reference to
selinux_check_access
---
 configure.ac |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index b989136..9cb9d83 100644
--- a/configure.ac
+++ b/configure.ac
@@ -203,7 +203,7 @@ fi
 have_selinux=no
 AC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [Disable optional 
SELINUX support]))
 if test x$enable_selinux != xno; then
-PKG_CHECK_MODULES(SELINUX, [ libselinux ],
+PKG_CHECK_MODULES([SELINUX], [libselinux = 2.1.9],
 [AC_DEFINE(HAVE_SELINUX, 1, [Define if SELinux is available]) 
have_selinux=yes], have_selinux=no)
 if test x$have_selinux = xno -a x$enable_selinux = xyes; then
 AC_MSG_ERROR([*** SELinux support requested but libraries not 
found])
-- 
1.7.10.4

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


Re: [systemd-devel] [PATCH] build-sys: require certain version of libselinux

2012-09-20 Thread Lennart Poettering
On Thu, 20.09.12 10:20, Jan Engelhardt (jeng...@inai.de) wrote:

 ./.libs/libsystemd-core.a(libsystemd_core_la-selinux-access.o):
 In function selinux_access_check:
 src/core/selinux-access.c:487: undefined reference to
 selinux_check_access

Applied. Thanks!

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] [systemd-commits] 3 commits - TODO configure.ac src/shared

2012-09-20 Thread Zbigniew Jędrzejewski-Szmek
On Thu, Sep 20, 2012 at 02:12:42AM -0700, Lennart Poettering wrote:
 commit 4b8772bf5f2887aa2bdb74efa2f5dfd40fff946d
 Author: Lennart Poettering lenn...@poettering.net
 Date:   Thu Sep 20 00:02:01 2012 +0200
 
 util: make sure heap allocators fail when array allocations are out of 
 bounds
 
 https://bugzilla.redhat.com/show_bug.cgi?id=858777

Any chance of making this bug public?

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


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

2012-09-20 Thread Lukáš Nykrýn
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.

Regards
Lukas
From a7f8b7492c273b3878122822f517be7d7e185b5c Mon Sep 17 00:00:00 2001
From: Lukas Nykryn lnyk...@redhat.com
Date: Thu, 20 Sep 2012 16:17:52 +0200
Subject: [PATCH] systemctl: do not ellipsize cgroup members in full status

---
 man/systemctl.xml |2 +-
 src/shared/cgroup-show.c  |   13 ---
 src/shared/util.c |   79 +++-
 src/systemctl/systemctl.c |   15 +---
 4 files changed, 65 insertions(+), 44 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/shared/cgroup-show.c b/src/shared/cgroup-show.c
index 9003a12..1b9f3cd 100644
--- a/src/shared/cgroup-show.c
+++ b/src/shared/cgroup-show.c
@@ -75,11 +75,12 @@ static void show_pid_array(int pids[], unsigned n_pids, const char *prefix, unsi
 /* And sort */
 qsort(pids, n_pids, sizeof(pid_t), compare);
 
-if (n_columns  8)
-n_columns -= 8;
-else
-n_columns = 20;
-
+if (n_columns != UINT_MAX) {
+if (n_columns  8)
+n_columns -= 8;
+else
+n_columns = 20;
+}
 for (i = 0; i  n_pids; i++) {
 char *t = NULL;
 
@@ -217,7 +218,7 @@ int show_cgroup_by_path(const char *path, const char *prefix, unsigned n_columns
 }
 }
 
-show_cgroup_by_path(last, p1, n_columns-2, kernel_threads, all);
+show_cgroup_by_path(last, p1, n_columns == UINT_MAX ? n_columns : n_columns-2, kernel_threads, all);
 free(last);
 }
 
diff --git a/src/shared/util.c b/src/shared/util.c
index 02ee637..570da7c 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -972,10 +972,8 @@ int get_process_comm(pid_t pid, char **name) {
 }
 
 int get_process_cmdline(pid_t pid, size_t max_length, bool comm_fallback, char **line) {
-char *r, *k;
+char *r = NULL, *k;
 int c;
-bool space = false;
-size_t left;
 FILE *f;
 
 assert(max_length  0);
@@ -994,47 +992,66 @@ int get_process_cmdline(pid_t pid, size_t max_length, bool comm_fallback, char *
 
 if (!f)
 return -errno;
+if (max_length != UINT_MAX) {
+bool space = false;
+size_t left;
+r = new(char, max_length);
+if (!r) {
+fclose(f);
+return -ENOMEM;
+}
 
-r = new(char, max_length);
-if (!r) {
-fclose(f);
-return -ENOMEM;
-}
+k = r;
+left = max_length;
+while ((c = getc(f)) != EOF) {
+
+if (isprint(c)) {
+if (space) {
+if (left = 4)
+break;
 
-k = r;
-left = max_length;
-while ((c = getc(f)) != EOF) {
+*(k++) = ' ';
+left--;
+space = false;
+}
 
-if (isprint(c)) {
-if (space) {
 if (left = 4)
 break;
 
-*(k++) = ' ';
+*(k++) = (char) c;
 left--;
-space = false;
-}
-
-if (left = 4)
-break;
+}  else
+space = true;
+}
 
-*(k++) = (char) c;
-left--;
-}  else
-space = true;
+

[systemd-devel] [ANNOUNCE] systemd 190

2012-09-20 Thread Lennart Poettering
Heya!

Many many bugfixes, but also a number of smaller features:

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

CHANGES WITH 190:

* Whenever a unit changes state we'll now log this to the
  journal and show along the unit's own log output in
  systemctl status.

* ConditionPathIsMountPoint= can now properly detect bind
  mount points too. (Previously, a bind mount of one file
  system to another place in the same file system could not be
  detected as mount, since they shared struct stat's st_dev
  field.)

* We will now mount the cgroup controllers cpu, cpuacct,
  cpuset and the controllers net_cls, net_prio together by
  default.

* nspawn containers will now have a virtualized boot
  ID. (i.e. /proc/sys/kernel/random/boot_id is now mounted
  over with a randomized ID at container initialization). This
  has the effect of making journalctl -b do the right thing
  in a container.

* The JSON output journal serialization has been updated not
  to generate endless list objects anymore, but rather one
  JSON object per line. This is more in line how most JSON
  parsers expect JSON objects. The new output mode
  json-pretty has been added to provide similar output, but
  neatly aligned for readability by humans.

* We dropped all explicit sync() invocations in the shutdown
  code. The kernel does this implicitly anyway in the kernel
  reboot() syscall. halt(8)'s -n option is now a compatibility
  no-op.

* We now support virtualized reboot() in containers, as
  supported by newer kernels. We will fall back to exit() if
  CAP_SYS_REBOOT is not available to the container. Also,
  nspawn makes use of this now and will actually reboot the
  container if the containerized OS asks for that.

* journalctl will only show local log output by default
  now. Use --merge (-m) to show remote log output, too.

* libsystemd-journal gained the new sd_journal_get_usage()
  call to determine the current disk usage of all journal
  files. This is exposed in the new journalctl --disk-usage
  command.

* journald gained a new configuration setting SplitMode= in
  journald.conf which may be used to control how user journals
  are split off. See journald.conf(5) for details.

* A new condition type ConditionFileNotEmpty= has been added.

* tmpfiles' w lines now support file globbing, to write
  multiple files at once.

* We added Python bindings for the journal submission
  APIs. More Python APIs for a number of selected APIs will
  likely follow. Note that we intend to add native bindings
  only for the Python language, as we consider it common
  enough to deserve bindings shipped within systemd. There are
  various projects outside of systemd that provide bindings
  for languages such as PHP or Lua.

* Many conditions will now resolve specifiers such as %i. In
  addition, PathChanged= and related directives of .path units
  now support specifiers as well.

* There's now a new RPM macro definition for the system preset
  dir: %_presetdir.

* journald will now warn if it can't foward a message to the
  syslog daemon because it's socket is full.

* timedated will no longer write or process /etc/timezone,
  except on Debian. As we do not support late mounted /usr
  anymore /etc/localtime always being a symlink is now safe,
  and hence the information in /etc/timezone is not necessary
  anymore.

* logind will now always reserve one VT for a text getty (VT6
  by default). Previously if more than 6 X sessions where
  started they took up all the VTs with auto-spawned gettys,
  so that no text gettys were available anymore.

* udev will now automatically inform the btrfs kernel logic
  about btrfs RAID components showing up. This should make
  simple hotplug based btrfs RAID assembly work.

* PID 1 will now increase its RLIMIT_NOFILE to 64K by default
  (but not for its children which will stay at the kernel
  default). This should allow setups with a lot more listening
  sockets.

* systemd will now always pass the configured timezone to the
  kernel at boot. timedated will do the same when the timezone
  is changed.

* logind's inhibition logic has been updated. By default,
  logind will now handle the lid switch, the power and sleep
  keys all the time, even in graphical sessions. If DEs want
  to handle these events on their own they should take the new
  handle-power-key,