chiark / gitweb /
Merge branch 'master' into journal
authorLennart Poettering <lennart@poettering.net>
Tue, 8 Nov 2011 18:44:16 +0000 (19:44 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 8 Nov 2011 18:44:16 +0000 (19:44 +0100)
1  2 
Makefile.am
TODO
src/manager.c
src/systemctl.c

diff --combined Makefile.am
index e08785a8a39589e5ee4429a7443964832cb197e1,d30d626ebfa3ef34c6d73ae0983c9dfe92c97795..58b3a63517fe7aca3ffdcc51031ab0e99b3d0445
@@@ -119,6 -119,13 +119,13 @@@ AM_CPPFLAGS += 
        -DKBD_LOADKEYS=\"/bin/loadkeys\" \
        -DKBD_SETFONT=\"/bin/setfont\" \
        -DDEFAULT_FONT=\"latarcyrheb-sun16\"
+ else
+ if TARGET_MAGEIA
+ AM_CPPFLAGS += \
+       -DKBD_LOADKEYS=\"/bin/loadkeys\" \
+       -DKBD_SETFONT=\"/bin/setfont\" \
+       -DDEFAULT_FONT=\"LatArCyrHeb-16\"
+ endif
  endif
  endif
  endif
@@@ -134,8 -141,7 +141,8 @@@ rootbin_PROGRAMS = 
        systemd-ask-password \
        systemd-tty-ask-password-agent \
        systemd-tmpfiles \
 -      systemd-machine-id-setup
 +      systemd-machine-id-setup \
 +        systemd-journalctl
  
  bin_PROGRAMS = \
        systemd-cgls \
@@@ -174,8 -180,7 +181,8 @@@ rootlibexec_PROGRAMS = 
        systemd-detect-virt \
        systemd-sysctl \
          systemd-logind \
 -        systemd-uaccess
 +        systemd-uaccess \
 +        systemd-journald
  
  if ENABLE_BINFMT
  rootlibexec_PROGRAMS += \
@@@ -227,9 -232,7 +234,9 @@@ noinst_PROGRAMS = 
        test-env-replace \
        test-strv \
          test-login \
 -        test-install
 +        test-install \
 +        test-id128 \
 +        test-journal
  
  if HAVE_PAM
  pamlib_LTLIBRARIES = \
@@@ -318,7 -321,7 +325,7 @@@ dbusinterface_DATA += 
  endif
  
  dist_bashcompletion_DATA = \
-       src/systemctl-bash-completion.sh
+       src/systemd-bash-completion.sh
  
  dist_tmpfiles_DATA = \
        tmpfiles.d/systemd.conf \
@@@ -546,6 -549,13 +553,13 @@@ dist_systemunit_DATA += 
        units/suse/halt-local.service
  endif
  
+ if TARGET_MAGEIA
+ dist_systemunit_DATA += \
+       units/mageia/prefdm.service \
+       units/fedora/rc-local.service \
+       units/fedora/halt-local.service
+ endif
  if HAVE_PLYMOUTH
  dist_systemunit_DATA += \
        units/plymouth-start.service \
@@@ -691,8 -701,7 +705,8 @@@ libsystemd_core_la_SOURCES = 
          src/dbus-common.c \
          src/sd-daemon.c \
          src/install.c \
 -        src/cgroup-attr.c
 +        src/cgroup-attr.c \
 +        src/sd-id128.c
  
  nodist_libsystemd_core_la_SOURCES = \
          src/load-fragment-gperf.c \
@@@ -954,60 -963,6 +968,60 @@@ test_install_CFLAGS = 
  test_install_LDADD = \
        libsystemd-basic.la
  
 +test_id128_SOURCES = \
 +      src/test-id128.c \
 +        src/sd-id128.c
 +
 +test_id128_CFLAGS = \
 +      $(AM_CFLAGS)
 +
 +test_id128_LDADD = \
 +      libsystemd-basic.la
 +
 +test_journal_SOURCES = \
 +      src/journal/test-journal.c \
 +      src/journal/sd-journal.c \
 +        src/journal/journal-file.c \
 +        src/journal/lookup3.c \
 +        src/sd-id128.c
 +
 +test_journal_CFLAGS = \
 +      $(AM_CFLAGS)
 +
 +test_journal_LDADD = \
 +      libsystemd-basic.la
 +
 +systemd_journald_SOURCES = \
 +      src/journal/journald.c \
 +      src/journal/sd-journal.c \
 +        src/journal/journal-file.c \
 +        src/journal/lookup3.c \
 +        src/sd-id128.c \
 +        src/acl-util.c \
 +        src/cgroup-util.c
 +
 +systemd_journald_CFLAGS = \
 +      $(AM_CFLAGS) \
 +        $(ACL_CFLAGS)
 +
 +systemd_journald_LDADD = \
 +      libsystemd-basic.la \
 +        libsystemd-daemon.la \
 +        $(ACL_LIBS)
 +
 +systemd_journalctl_SOURCES = \
 +      src/journal/journalctl.c \
 +      src/journal/sd-journal.c \
 +        src/journal/journal-file.c \
 +        src/journal/lookup3.c \
 +        src/sd-id128.c
 +
 +systemd_journalctl_CFLAGS = \
 +      $(AM_CFLAGS)
 +
 +systemd_journalctl_LDADD = \
 +      libsystemd-basic.la
 +
  systemd_stdout_syslog_bridge_SOURCES = \
        src/stdout-syslog-bridge.c \
        src/tcpwrap.c
@@@ -1152,12 -1107,10 +1166,12 @@@ systemd_uaccess_SOURCES = 
  
  if HAVE_ACL
  systemd_logind_SOURCES += \
 -      src/logind-acl.c
 +      src/logind-acl.c \
 +        src/acl-util.c
  
  systemd_uaccess_SOURCES += \
 -      src/logind-acl.c
 +      src/logind-acl.c \
 +        src/acl-util.c
  endif
  
  systemd_uaccess_CFLAGS = \
@@@ -1205,8 -1158,7 +1219,8 @@@ systemd_tmpfiles_LDADD = 
  
  systemd_machine_id_setup_SOURCES = \
        src/machine-id-setup.c \
 -      src/machine-id-main.c
 +      src/machine-id-main.c \
 +        src/sd-id128.c
  
  systemd_machine_id_setup_CFLAGS = \
        $(AM_CFLAGS)
@@@ -1488,7 -1440,8 +1502,8 @@@ systemd_stdio_bridge_LDADD = 
  
  systemadm_SOURCES = \
        src/systemadm.vala \
-       src/systemd-interfaces.vala
+       src/systemd-interfaces.vala \
+       src/wraplabel.vala
  
  systemadm_CFLAGS = \
        $(AM_CFLAGS) \
  systemadm_VALAFLAGS = \
        --pkg=posix \
        --pkg=gtk+-2.0 \
+       --pkg=gee-1.0 \
        -g
  
  systemadm_LDADD = \
@@@ -2061,6 -2015,23 +2077,23 @@@ if TARGET_SUS
                $(LN_S) $(systemunitdir)/halt-local.service halt-local.service )
  endif
  
+ if TARGET_MAGEIA
+       $(MKDIR_P) -m 0755 $(DESTDIR)$(systemunitdir)/final.target.wants
+       ( cd $(DESTDIR)$(systemunitdir)/multi-user.target.wants && \
+               rm -f rc-local.service && \
+               $(LN_S) $(systemunitdir)/rc-local.service rc-local.service )
+       ( cd $(DESTDIR)$(systemunitdir)/final.target.wants && \
+               rm -f halt-local.service && \
+               $(LN_S) $(systemunitdir)/halt-local.service halt-local.service )
+       ( cd $(DESTDIR)$(systemunitdir) && \
+               rm -f display-manager.service && \
+               $(LN_S) prefdm.service display-manager.service && \
+               $(LN_S) prefdm.service dm.service )
+       ( cd $(DESTDIR)$(systemunitdir)/graphical.target.wants && \
+               rm -f display-manager.service && \
+               $(LN_S) $(systemunitdir)/display-manager.service display-manager.service )
+ endif
  if HAVE_SYSV_COMPAT
        ( cd $(DESTDIR)$(systemunitdir)/local-fs.target.wants && \
                rm -f var-lock.mount && \
diff --combined TODO
index b993a6b2eb543576feb08e64a391ca91a39149f7,5303497164f70d1402a732a2f552a4e7b1a1c1fc..8c3034e079c734fdc3a14824927065526980545a
--- 1/TODO
--- 2/TODO
+++ b/TODO
@@@ -17,14 -17,16 +17,20 @@@ Bugfixes
  
  * make polkit checks async
  
 +* properly handle .mount unit state tracking when two mount points are stacked one on top of another on the exact same mount point.
 +
  Features:
  
 +* check utf8 everywhere
 +
+ * when an instanced service exits, remove its parent cgroup too if possible.
+ * as Tom Gundersen pointed out there's a always a dep loop if people use crypto file systems with random keys
  * unset container= in PID1?
  
+ * automatically escape unit names passed on the service (i.e. think "systemctl start serial-getty.service@serial/by-path/jshdfjsdfhkjh" being automatically escaped as necessary.
  * if we can not get user quota for tmpfs, mount a separate tmpfs instance
    for every user in /run/user/$USER with a configured maximum size
  
diff --combined src/manager.c
index ac5bbef1a802ef63f2b190c2781e73707baad11d,111167a8c2a19147af66dfec669a72de2b2f444a..f8cbcfcc98ff8fa7faf1f25dadf1ec7fa908e5f5
@@@ -286,7 -286,10 +286,10 @@@ int manager_new(ManagerRunningAs runnin
                  goto fail;
  
  #ifdef HAVE_AUDIT
-         if ((m->audit_fd = audit_open()) < 0)
+         if ((m->audit_fd = audit_open()) < 0 &&
+             /* If the kernel lacks netlink or audit support,
+              * don't worry about it. */
+             errno != EAFNOSUPPORT && errno != EPROTONOSUPPORT)
                  log_error("Failed to connect to audit log: %m");
  #endif
  
@@@ -1214,13 -1217,18 +1217,18 @@@ static int transaction_apply(Manager *m
  
                  /* When isolating first kill all installed jobs which
                   * aren't part of the new transaction */
+         rescan:
                  HASHMAP_FOREACH(j, m->jobs, i) {
                          assert(j->installed);
  
                          if (hashmap_get(m->transaction_jobs, j->unit))
                                  continue;
  
-                         job_finish_and_invalidate(j, JOB_CANCELED);
+                         /* 'j' itself is safe to remove, but if other jobs
+                            are invalidated recursively, our iterator may become
+                            invalid and we need to start over. */
+                         if (job_finish_and_invalidate(j, JOB_CANCELED) > 0)
+                                 goto rescan;
                  }
          }
  
@@@ -2024,7 -2032,7 +2032,7 @@@ static int manager_dispatch_sigchld(Man
                  if (si.si_code == CLD_EXITED || si.si_code == CLD_KILLED || si.si_code == CLD_DUMPED) {
                          char *name = NULL;
  
 -                        get_process_name(si.si_pid, &name);
 +                        get_process_comm(si.si_pid, &name);
                          log_debug("Got SIGCHLD for process %lu (%s)", (unsigned long) si.si_pid, strna(name));
                          free(name);
                  }
@@@ -2109,7 -2117,7 +2117,7 @@@ static int manager_process_signal_fd(Ma
                  if (sfsi.ssi_pid > 0) {
                          char *p = NULL;
  
 -                        get_process_name(sfsi.ssi_pid, &p);
 +                        get_process_comm(sfsi.ssi_pid, &p);
  
                          log_debug("Received SIG%s from PID %lu (%s).",
                                    signal_to_string(sfsi.ssi_signo),
diff --combined src/systemctl.c
index a423fdbf93b7fb0f66751093882e656e4b100457,175159d68fb42fc87380d72263d198bc9f3eadeb..18074402e57a11af47433943bbc132a72e22af7a
@@@ -551,11 -551,30 +551,30 @@@ static bool output_show_unit_file(cons
  }
  
  static void output_unit_file_list(const UnitFileList *units, unsigned c) {
-         unsigned n_shown = 0;
+         unsigned max_id_len, id_cols, state_cols, n_shown = 0;
          const UnitFileList *u;
  
-         if (on_tty())
-                 printf("%-25s %-6s\n", "UNIT FILE", "STATE");
+         max_id_len = sizeof("UNIT FILE")-1;
+         state_cols = sizeof("STATE")-1;
+         for (u = units; u < units + c; u++) {
+                 if (!output_show_unit_file(u))
+                         continue;
+                 max_id_len = MAX(max_id_len, strlen(file_name_from_path(u->path)));
+                 state_cols = MAX(state_cols, strlen(unit_file_state_to_string(u->state)));
+         }
+         if (!arg_full) {
+                 unsigned basic_cols;
+                 id_cols = MIN(max_id_len, 25);
+                 basic_cols = 1 + id_cols + state_cols;
+                 if (basic_cols < (unsigned) columns())
+                         id_cols += MIN(columns() - basic_cols, max_id_len - id_cols);
+         } else
+                 id_cols = max_id_len;
+         if (!arg_no_legend)
+                 printf("%-*s %-*s\n", id_cols, "UNIT FILE", state_cols, "STATE");
  
          for (u = units; u < units + c; u++) {
                  char *e;
  
                  id = file_name_from_path(u->path);
  
-                 e = arg_full ? NULL : ellipsize(id, 25, 33);
+                 e = arg_full ? NULL : ellipsize(id, id_cols, 33);
  
-                 printf("%-25s %s%-6s%s\n",
-                        e ? e : id,
-                        on, unit_file_state_to_string(u->state), off);
+                 printf("%-*s %s%-*s%s\n",
+                        id_cols, e ? e : id,
+                        on, state_cols, unit_file_state_to_string(u->state), off);
  
                  free(e);
          }
  
-         if (on_tty())
+         if (!arg_no_legend)
                  printf("\n%u unit files listed.\n", n_shown);
  }
  
@@@ -2182,7 -2201,7 +2201,7 @@@ static void print_status_info(UnitStatu
  
                          if (i->running) {
                                  char *t = NULL;
 -                                get_process_name(i->main_pid, &t);
 +                                get_process_comm(i->main_pid, &t);
                                  if (t) {
                                          printf(" (%s)", t);
                                          free(t);
  
                          printf(" Control: %u", (unsigned) i->control_pid);
  
 -                        get_process_name(i->control_pid, &t);
 +                        get_process_comm(i->control_pid, &t);
                          if (t) {
                                  printf(" (%s)", t);
                                  free(t);
@@@ -3443,7 -3462,7 +3462,7 @@@ finish
  static int enable_sysv_units(char **args) {
          int r = 0;
  
- #if defined (HAVE_SYSV_COMPAT) && (defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA) || defined(TARGET_SUSE) || defined(TARGET_MEEGO) || defined(TARGET_ALTLINUX))
+ #if defined (HAVE_SYSV_COMPAT) && (defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA) || defined(TARGET_SUSE) || defined(TARGET_MEEGO) || defined(TARGET_ALTLINUX) || defined(TARGET_MAGEIA))
          const char *verb = args[0];
          unsigned f = 1, t = 1;
          LookupPaths paths;