Commit Graph

293 Commits

Author SHA1 Message Date
Lennart Poettering 57f3067825 util: fix bad strstrip() return value in normalize_env_assignment()
https://bugzilla.redhat.com/show_bug.cgi?id=858780
2012-09-19 22:01:31 +02:00
Zbigniew Jędrzejewski-Szmek d3b52baff9 systemctl: use automatic cleanup
Introduce a helper method to unref dbus messages and use it.
2012-09-19 08:25:36 +02:00
Zbigniew Jędrzejewski-Szmek 67445f4e22 core: move ManagerRunningAs to shared
Note: I did s/MANAGER/SYSTEMD/ everywhere, even though it makes the
patch quite verbose. Nevertheless, keeping MANAGER prefix in some
places, and SYSTEMD prefix in others would just lead to confusion down
the road. Better to rip off the band-aid now.
2012-09-18 19:53:34 +02:00
Lennart Poettering c198300fc4 journalctl: don't choke on entries with no MESSAGE= field
https://bugs.freedesktop.org/show_bug.cgi?id=50177
2012-09-18 11:12:31 +02:00
Lennart Poettering 901c3d0d85 util: introduce get_process_gid() 2012-09-18 01:53:15 +02:00
Lennart Poettering cd15c4182b log: avoid function loop
https://bugs.freedesktop.org/show_bug.cgi?id=54766
2012-09-17 22:16:01 +02:00
Lennart Poettering faa368e337 conf-parser: don't unescape parsed configuration strings by default
In many cases this might have a negative effect since we drop escaping
from strings where we better shouldn't have dropped it.

If unescaping makes sense for some settings we can readd it later again,
on a per-case basis.

https://bugs.freedesktop.org/show_bug.cgi?id=54522
2012-09-17 21:58:03 +02:00
Lennart Poettering 669bec5d17 util: various cleanups for printing boot status 2012-09-17 19:05:32 +02:00
Lennart Poettering a866073d35 main: when transitioning from initrd to the main system log to kmsg
When the new PID is invoked the journal socket from the initrd might
still be around. Due to the default log target being journal we'd log to
that initially when the new main systemd initializes even if the kernel
command line included a directive to redirect systemd's logging
elsewhere.

With this fix we initially always log to kmsg now, if we are PID1, and
only after parsing the kernel cmdline try to open the journal if that's
desired.

(The effective benefit of this is that SELinux performance data is now
logged again to kmsg like it used to be.)
2012-09-17 17:47:47 +02:00
Kay Sievers 72edcff5db hwclock: always set the kernel's timezone
Properly tell the kernel at bootup, and any later time zone changes,
the actual system time zone.

Things like the kernel's FAT filesystem driver needs the actual time
zone to calculate the proper local time to use for the on-disk time
stamps.

https://bugzilla.redhat.com/show_bug.cgi?id=802198
2012-09-17 16:56:26 +02:00
Zbigniew Jędrzejewski-Szmek 4db17f291c build-sys: __secure_getenv lost dunder in libc 2.17 2012-09-17 00:21:25 +02:00
Zbigniew Jędrzejewski-Szmek 25ea79fe07 nspawn: use automatic cleanup for umask 2012-09-16 16:20:09 +02:00
Zbigniew Jędrzejewski-Szmek d8831ed554 install: use automatic cleanup 2012-09-16 16:20:06 +02:00
Zbigniew Jędrzejewski-Szmek d5891fdacf install: treat non-existent directory as empty
When looking for symlinks, it doesn't make sense to error-out if
the directory is missing. The user might delete an empty directory.

This check caused test-unit-file to fail when run before installation.
2012-09-16 14:00:25 +02:00
Lennart Poettering 424a19f8a2 timedate: assorted improvements
- Make writing/reading of /etc/timezone dependendent of HAVE_SYSV_COMPAT

- Introduce symlink_atomic() after all, and use it

- Use relative symlink for /etc/localtime
2012-09-14 20:02:52 +02:00
Lennart Poettering 67f3c40265 systemctl: show unit name when a job fails
https://bugzilla.redhat.com/show_bug.cgi?id=845028
https://bugzilla.redhat.com/show_bug.cgi?id=846483
2012-09-14 15:11:07 +02:00
Lennart Poettering 73836c5c43 util: more modernizations 2012-09-14 10:36:50 +02:00
Lennart Poettering a05f97b3ac util: various additional modernizations 2012-09-14 10:24:27 +02:00
Lennart Poettering e67f47e55b util: modernize a few functions with automatic cleanup variables
Just trying to get the feel for it. And it's pretty cool.
2012-09-14 10:06:42 +02:00
Lennart Poettering 2fbe635a83 macro: introduce _cleanup_free_ macro for automatic freeing of scoped vars and make use of it 2012-09-13 22:30:26 +02:00
Lennart Poettering 8556879e0d unit-name: rework unit_name_replace_instance function()
https://bugzilla.redhat.com/show_bug.cgi?id=855863
2012-09-12 04:46:38 +02:00
Tom Gundersen b3d284696c util: rm_rf_children_dangerous: delete all descendants dangerously
Call rm_rf_children_dangerous() recursively rather than falling back to
rm_rf_children(). This fixes a bug in systemd-tmpfiles.

The problem can easily be reproduced by:

  # mount /dev/sda1 /mnt
  # mkdir /mnt/test
  # echo "D /mnt" > /root/test.conf
  # systemd-tmpfiles --remove /root/test.conf
  Attempted to remove disk file system, and we can't allow that.
  rm_rf(/root/test): Operation not permitted

Reported-by: Lukas Jirkovsky <l.jirkovsky@gmail.com>
2012-09-11 02:55:29 +02:00
Lennart Poettering b5b46d5995 when determining unit file list, include invalid unit names in an "invalid" state 2012-09-11 01:14:25 +02:00
Lennart Poettering 3137e0bd52 dbus: minor coding style fixes 2012-09-10 09:38:49 +02:00
Mantas Mikulėnas fa125f4e44 path-util: fall back to stat() if kernel does not support name_to_handle_at()
Fixes instant hang on kernels that do not have CONFIG_FHANDLE enabled.
2012-09-10 09:21:24 +02:00
Mantas Mikulėnas 8ac7549330 path-util: do not fail in path_is_mountpoint() if path doesn't exist
This was accidentally lost in commit 1640a0b6b0.
2012-09-10 09:21:10 +02:00
Lennart Poettering d87be9b0af nspawn: handle poweroff/reboot nicely in containers 2012-09-05 16:23:41 -07:00
Lennart Poettering a6e87e90ed journalctl: rework JSON output mode
This splits the JSON output mode into different modes: json and
json-pretty. The former printing one entry per line, the latter showing
JSON objects nicely indented and in multiple lines to make it easier to
read for humans.
2012-09-05 15:25:32 -07:00
Lennart Poettering f408b8f1bb path: fix invalid variable access in path_is_mount_point() 2012-09-04 17:05:23 -07:00
Lennart Poettering 1640a0b6b0 path-util: in path_is_mount_point() fall back to the classic stat() test if fs does not support name_to_handle_at() 2012-09-04 16:37:57 -07:00
Lennart Poettering a8348796c0 missing: define name_to_handle_at on our own if it is missing 2012-09-04 15:30:24 -07:00
Brandon Philips e268b81e97 shared: logs-show: fflush after each output type
journalctl -f redirected to a pipe or file wasn't working for some
output formats but was working for json. It turns out only json was
doing an fflush.

Make all output formats flush.
2012-09-03 19:16:20 -07:00
Lennart Poettering 1946b0bd55 journalctl: include logs from PID 1 about services in systemctl status 2012-09-03 18:59:05 -07:00
Lennart Poettering cde9cb343a util: make path_is_mount_point() recognize bind mounts, too 2012-09-03 18:59:05 -07:00
Lennart Poettering 81270860a5 journal: suppress structured messages if they'd go to the console 2012-09-03 18:59:04 -07:00
Lennart Poettering 877d54e9b0 journal: generate structured journal messages for a number of events 2012-09-03 18:59:04 -07:00
Lennart Poettering 88fae6e044 shared: in code that might get called from suid programs use __secure_getenv() rather than getenv()
It's better to be safe than sorry.
2012-09-03 18:59:04 -07:00
Lukas Nykryn 9f89986d2b hashmap: hashmap_contains does not need hashmap_entry 2012-08-23 13:53:30 +02:00
Lennart Poettering 5809560d85 journal: move syslog specific calls out of util.c 2012-08-22 03:24:46 +02:00
Lennart Poettering ef63833d53 journald: split /dev/kmsg related stuff into its own .c file 2012-08-22 03:09:44 +02:00
Dave Reisner 84cc2abf34 shared/util: add fstab support for partuuid/partlabel
udev has supported this since 172, so it should be a safe (and welcome)
addition for users of GPT partitioned disks.
2012-08-21 11:48:26 -04:00
Dave Reisner 383182b5c4 shared/util: refactor fstab_node_to_udev_node
Since this is purely duplicated logic, separate it out into a small
static function.
2012-08-21 11:48:26 -04:00
Lennart Poettering 01ed0e2307 dev-setup: make NULL as parameter for dev_setup() equivalent to "" 2012-08-21 17:23:03 +02:00
Dave Reisner 8f0e73f250 dev-setup: allow a path prefix for use in chroots
With this adjustment, we can reuse this code elsewhere, such as in
nspawn.
2012-08-21 17:19:35 +02:00
Lennart Poettering a228a22fda journalctl: really include .journal~ files in listing 2012-08-21 02:13:21 +02:00
Lennart Poettering f6a971bc0b journalctl: output FSS key as QR code on generating 2012-08-20 22:02:19 +02:00
Lennart Poettering 07cacf5f3b conf-parser: make parsing exit status lists non-fatal 2012-08-16 17:10:57 +02:00
Lennart Poettering d046b20b11 conf-parser: simplify a few things by using set_ensure_allocated() rather than set_new() 2012-08-14 18:42:26 +02:00
Lukas Nykryn 96342de68d service: add options RestartPreventExitStatus and SuccessExitStatus
In some cases, like wrong configuration, restarting after error
does not help, so administrator can specify statuses by RestartPreventExitStatus
which will not cause restart of a service.

Sometimes you have non-standart exit status, so this can be specified
by SuccessfulExitStatus.
2012-08-14 14:46:03 +02:00
Lennart Poettering ac0930c892 namespace: rework namespace support
- don't use pivot_root() anymore, just reuse root hierarchy
- first create all mounts, then mark them read-only so that we get the
  right behaviour when people want writable mounts inside of
  read-only mounts
- don't pass invalid combinations of MS_ constants to the kernel
2012-08-13 15:27:04 +02:00
Simon Peeters c516c8d17f systemctl: fix issue with systemctl daemon-reexec 2012-08-10 18:08:22 +02:00
Dave Reisner fd5b4ca11e shared/utf8: mark char* as const
Avoids compiler warning:

  src/shared/utf8.c: In function 'ascii_filter':
  src/shared/utf8.c:278:16: warning: assignment discards 'const' qualifier
      from pointer target type [enabled by default]
2012-08-10 17:59:39 +02:00
Lennart Poettering 5b4c61cd0b journald: properly unescape messages from /dev/kmsg 2012-08-09 16:49:28 +02:00
Lennart Poettering 64825d3c58 fix a couple of issues found with llvm-analyze 2012-08-08 23:54:21 +02:00
Simon Peeters c67de56f50 move bus_method_call_with_reply() to dbus-common 2012-08-08 02:04:40 +02:00
Shawn Landen 193556b69e logs-show: fix off-by-one error
Ellipsize lines that are one character too long.
2012-08-03 18:12:07 +02:00
Lennart Poettering 56d4fbf92e systemctl: append .service to unit names lacking suffix
https://bugs.freedesktop.org/show_bug.cgi?id=39386
2012-07-28 13:20:35 +02:00
Zbigniew Jędrzejewski-Szmek 11f96fac8f cgtop: use full terminal width 2012-07-26 23:32:01 +02:00
Lennart Poettering 498261871d journalctl: hightlight log lines by priority
warn/notice = bright white
< error = red
2012-07-26 16:56:21 +02:00
Lennart Poettering 46b0d92225 logs-show: fix OOM path 2012-07-26 16:56:21 +02:00
Michal Schmidt 6dc1e7e0ba log: out-of-line __log_oom()
The callers' code gets smaller.
2012-07-26 14:24:40 +02:00
Michal Schmidt cd6f1c0f87 log: log_oom() must be a macro 2012-07-26 14:07:27 +02:00
Shawn Landden 0d0f0c50d3 log.h: new log_oom() -> int -ENOMEM, use it
also a number of minor fixups and bug fixes: spelling, oom errors
that didn't print errors, not properly forwarding error codes,
few more consistency issues, et cetera
2012-07-26 11:48:26 +02:00
Michal Schmidt a7b9ecf9b2 unit-name: style fix in unit_name_is_template()
to make it look like the newly added unit_name_is_instance()
2012-07-26 10:14:33 +02:00
Michal Sekletar 29283ea4cf systemd: enable/disable instances of template
https://bugzilla.redhat.com/show_bug.cgi?id=752774
2012-07-26 10:02:10 +02:00
Shawn Landden 669241a076 use "Out of memory." consistantly (or with "\n")
glibc/glib both use "out of memory" consistantly so maybe we should
consider that instead of this.

Eliminates one string out of a number of binaries. Also fixes extra newline
in udev/scsi_id
2012-07-25 11:23:57 +02:00
Auke Kok d4447f4d95 main: set PR_SET_CHILD_REAPER for MANAGER_USER
Become the reaper for all children part of the user session. Tested
with several forking services.
2012-07-25 00:17:30 +02:00
Michal Schmidt 578ac0604e conf-files: continue searching if one dir fails
A problem with systemd-tmpfiles has been observed where the service
failed just because one of the configuration directories could not be
read due to SELinux policy.

Complain about the failure, but try to go on.

https://bugzilla.redhat.com/show_bug.cgi?id=839736
2012-07-24 23:33:54 +02:00
Zbigniew Jedrzejewski-Szmek fafb6eccc2 journalctl: fix ellipsization with PAGER=cat
There are other reasons for not opening the pager then the --no-pager
or --follow options (described below). If the pager is not used,
messages must be ellipsized.

On Fri, Jul 20, 2012 at 05:42:44AM +0000, Shawn Landen wrote:
> "Pager to use when --no-pager is not given; overrides $PAGER.
> Setting this to an empty string or the value cat is equivalent to passing --no-pager."
2012-07-23 17:57:11 +02:00
Eelco Dolstra b61a4660fc journalctl: fix assertion failure in ellipsize_mem()
When showing the journal through "journalctl --no-pager", if the
prefix of the log message (i.e. the date and syslog identifier) is
less than 3 characters shorter than the width of the terminal, you
get:

Assertion 'new_length >= 3' failed at src/shared/util.c:3859, function ellipsize_mem(). Aborting.

because there is not enough space for the "...".  This patch add the
necessary check.
2012-07-20 00:12:30 +02:00
Shawn Landden c2f1db8f83 use #pragma once instead of foo*foo #define guards
#pragma once has been "un-deprecated" in gcc since 3.3, and is widely supported
in other compilers.

I've been using and maintaining (rebasing) this patch for a while now, as
it annoyed me to see #ifndef fooblahfoo, etc all over the place,
almost arrogant about the annoyance of having to define all these names to
perform a commen but neccicary functionality, when a completely superior
alternative exists.

I havn't sent it till now, cause its kindof a style change, and it is bad
voodoo to mess with style that has been established by more established
editors. So feel free to lambast me as a crazy bafoon.

v2 - preserve externally used headers
2012-07-19 12:30:59 +02:00
Zbigniew Jędrzejewski-Szmek 92a1fd9e95 journalctl: do not ellipsize when using pager
If a pager is used, ellipsization is redundant — the pager does
that better by hiding the part that cannot be shown. Pager's advantage
is that the user can press → to view the hidden part of a message,
and then ← to return.
2012-07-17 17:20:58 +02:00
Zbigniew Jędrzejewski-Szmek 085d71209b logs: Adapt interface in log-show.c (show_journal_by_unit)
Convert more flag arguments into one flag variable.
2012-07-17 17:20:58 +02:00
Zbigniew Jędrzejewski-Szmek 25277cd7fb logs: Adapt interface in log-show.c (output_journal)
In preparation for adding more output switches, convert a series of
flags arguments into one flag variable.
2012-07-17 17:20:57 +02:00
Lennart Poettering 8351ceaea9 execute: support syscall filtering using seccomp filters 2012-07-17 04:17:53 +02:00
Lennart Poettering d05c5031ad unit: introduce %s specifier for the user shell 2012-07-16 12:34:54 +02:00
Lennart Poettering 7c5f152aca util: add getusername_malloc(), get_shell(), get_home_dir() 2012-07-16 12:16:30 +02:00
Ville Skyttä 49f43d5f91 Spelling fixes. 2012-07-16 12:16:29 +02:00
Kay Sievers 4a0ff4780d aquire_terminal(): fix uninitialized variable
./src/shared/util.c:2457:45: warning: 'r' may be used uninitialized in this function [-Wmaybe-uninitialized]
2012-07-15 15:34:22 +02:00
Kay Sievers 19d1e4eeb6 journal: align byte-buffer that gets cased to an object
On Sun, Jul 15, 2012 at 2:00 PM, Koen Kooi <koen@dominion.thruhere.net> wrote:
> | src/journal/sd-journal.c: In function 'sd_journal_process':
> | src/journal/sd-journal.c:1891:21: warning: cast increases required alignment of target type [-Wcast-align]
> | src/journal/sd-journal.c:1900:29: warning: cast increases required alignment of target type [-Wcast-align]
2012-07-15 14:58:29 +02:00
Lennart Poettering b59866aefa man: document sd_journal_get_cutoff_realtime_usec() 2012-07-13 20:17:37 +02:00
Lennart Poettering 32c4bef882 util: temporarily ignore SIGHUP while we are issuing TIOCSTTY 2012-07-13 13:55:35 +02:00
Lennart Poettering b7def68494 util: rename join() to strjoin()
This is to match strappend() and the other string related functions.
2012-07-13 13:41:01 +02:00
Zbigniew Jędrzejewski-Szmek ba961854dd journalctl: show any printable Unicode character
This makes sure we are OK in outputting all valid, non-control UTF-8
characters, instead of just printable 7bit ASCII.
2012-07-13 01:07:41 +02:00
Lennart Poettering e02d1cf72d journal: introduce sd_journal_wait() to simplify writing synchronous clients 2012-07-10 21:46:11 +02:00
Lennart Poettering cd3bd60a2e switch-root: reopen /dev/console before we switch root 2012-07-10 19:19:59 +02:00
Lennart Poettering f56d5db919 util: rm_rf() refuse cleaning non-memory file systems, as extra paranoia 2012-07-10 19:05:58 +02:00
Lennart Poettering 825c6fe5eb util: add extra safety check to in_initrd()
initrds can only be on tmpfs or ramfs, so check for that
2012-07-10 18:46:26 +02:00
Zbigniew Jędrzejewski-Szmek f69614f811 unit: Move UnitLoadState definitions from core/unit.c to shared/unit-name.c
This makes it possible to use them from systemctl without linking
against the core.
2012-07-10 17:18:49 +02:00
Lennart Poettering 5f73969991 unit-name: remove unit_name_is_valid_no_type() and move unit_name_is_valid() to unit-name.h 2012-07-10 17:07:32 +02:00
Zbigniew Jędrzejewski-Szmek 0a9f8ed00c unit: Move UnitType definitions from core/unit.c to shared/unit-name.c
This makes it possible to use them from systemctl without linking
against the core. A string->enum lookup table is added.
2012-07-10 16:48:08 +02:00
Lennart Poettering 461b182232 paranoia: refuse rm_rf("/") 2012-07-09 17:30:22 +02:00
Lennart Poettering 451b34cc1d service: flush the start counter in "systemctl reset-failed" 2012-07-04 00:23:42 +02:00
Lennart Poettering c9bc076461 mount-setup: don't complain if we try to fix the label of a dir beneath a mount but can't due to EROFS 2012-07-03 16:25:50 +02:00
Lennart Poettering 61b1477c81 hashmap: make hashmap_clear() work on NULL hashmaps 2012-07-03 16:15:57 +02:00
Lennart Poettering 9946996cda load-fragment: a few modernizations 2012-07-03 16:10:04 +02:00
Lennart Poettering a7480dbad2 core: rename system.preset to system-presets to follow naming scheme of other dirs in /usr/lib/systemd/
Thankfully nobody is using this yet, and presets aren't documented yet,
hence take the liberty to rename this.
2012-06-27 14:34:24 +02:00
Lennart Poettering af6da548aa core: make systemd.confirm_spawn=1 actually work
This adds a timeout if the TTY cannot be acquired and makes sure we
always output the question to the console, never to the TTY of the
respective service.
2012-06-26 12:21:43 +02:00
Lennart Poettering 35eb6b124e cryptsetup: fix escaping when generating cryptsetup units 2012-06-25 20:16:15 +02:00
Lennart Poettering b0193f1c1f systemctl: automatically turn paths and unescaped unit names into proper unit names
This makes sure that

  systemctl status /home

is implicitly translated to:

  systemctl status /home.mount

Similar, /dev/foobar becomes dev-foobar.device.

Also, all characters that cannot be part of a unit name are implicitly
escaped.
2012-06-22 13:08:48 +02:00
Lennart Poettering b4bdfefac3 preset: don't look for preset files in /lib unless /usr is split off 2012-06-21 23:22:53 +02:00
Lennart Poettering 089842938d journal: expose and make use of cutoff times of journal
This helps explaining when the log output of "systemctl status" is
incomplete because the logs got rotated since the service was started.
2012-06-17 00:03:12 +02:00
Michal Schmidt 48899192a7 unit-name: introduce unit_dbus_path_from_name()
Use the same function in core and in systemctl.
get_unit_path() in systemctl becomes unnecessary.
2012-06-13 18:42:02 +02:00
Kay Sievers 4b7126538c unit-name: never create a unit name with a leading '.'
Supposed to prevent creating unit files like:
  ├── dev-sda1.device.wants
  │   └── .dot.mount -> /run/systemd/generator/.dot.mount
  ├── .dot.mount
from:
  # cat /etc/fstab
  /dev/sda1    /.dot           vfat ro           1 3

which we later skip reading because of the leading '.'.
2012-06-04 14:57:24 +02:00
Lennart Poettering 48ac500bb6 missing: define MS_STRICTATIME if not defined already 2012-06-01 21:25:29 +02:00
Lennart Poettering 213ba152fd journal: allow setting of a cutoff log level for disk storage, syslog, kmsg, console forwarding 2012-06-01 17:27:16 +02:00
Marc-Antoine Perennou 952d817a41 main: Silence gcc warning 2012-05-31 18:04:41 +02:00
Kay Sievers 0f9963a8b8 Revert "label: fix systemd-udev labeling of /run directory."
This reverts commit 9b5af248f0.

Udev now explicitely labels only files/directories in /dev. The selinux
array API is not released and will not work on other distros at this moment.
2012-05-31 13:34:41 +02:00
Kay Sievers c66e7f0499 mkdir: provide all functions with and without selinux label application 2012-05-31 13:17:26 +02:00
Kay Sievers d2e54fae5c mkdir: append _label to all mkdir() calls that explicitly set the selinux context 2012-05-31 12:40:20 +02:00
Kay Sievers 051d68786b util: don't require libcap when building libsystemd-shared
src/shared/util.c includes <sys/capability.h> but doesn't use anything
defined there.  Since <sys/capability.h> is part of libcap, not libc,
don't require it.

Allows systemd-without-udevd to require fewer external libraries.
2012-05-31 11:58:06 +02:00
Lennart Poettering d88a251b12 util: introduce a proper nsec_t and make use of it where appropriate 2012-05-31 04:27:03 +02:00
Daniel J Walsh 9b5af248f0 label: fix systemd-udev labeling of /run directory.
systemd-udev is currently incorrectly labeling /run/udev/* content because it is
using selinux prefix labeling of /dev.  This patch will allow systemd-udev to
use prefix labeling of /dev and /run.
2012-05-31 01:43:27 +02:00
Lennart Poettering 107a2db901 selinux: downgrade database load time message to LOG_DEBUG 2012-05-31 01:10:53 +02:00
Lennart Poettering ba1261bc02 build-sys: fix built with --disable-logind 2012-05-30 22:25:01 +02:00
Lennart Poettering 069cfc85f8 logind: optionally handle power, sleep and lid switch events
This takes handling of chassis power and sleep keys as well as the lid
switch over from acpid.

This logic is enabled by default for power and sleep keys, but not for
the lid switch.

If a graphical session is in the foreground no action is taken under the
assumption that the graphical session does this.
2012-05-30 15:01:51 +02:00
Lennart Poettering 939b8f14dc capabilities: when dropping capabilities system-wide also drop them from usermode helpers
This hooks things up with /proc/sys/kernel/usermodehelper/bset and
/proc/sys/kernel/usermodehelper/inheritable.
2012-05-29 23:35:17 +02:00
Lennart Poettering ec8927ca59 main: add configuration option to alter capability bounding set for PID 1
This also ensures that caps dropped from the bounding set are also
dropped from the inheritable set, to be extra-secure. Usually that should
change very little though as the inheritable set is empty for all our uses
anyway.
2012-05-24 04:00:56 +02:00
Lennart Poettering 07719a21b6 manager: rework generator logic
Previously generated units were always placed at the end of the search
path. With this change there will be three unit dirs instead of one, to
place generated entries at the beginning, in the middle and at the end
of the search path:

beginning: for units that need to override all configuration, regardless
of user or vendor. Example use: system-update-generator uses this to
temporarily redirect default.target.

middle: for units that need to override vendor configuration, but not
vendor configuration. Example use: /etc/fstab should override vendor
supplied configuration (think /tmp), but should not override native user
configuration.

end: does not override anything but is available as well. Possible usage
might be to convert D-Bus bus service files to native units but allowing
vendor supplied native units to win.
2012-05-23 03:43:29 +02:00
Lennart Poettering a690306153 log: make sure generators never log into the journal to avoid activation deadlocks
This makes all generators log to kmsg by default.
2012-05-22 22:00:37 +02:00
Lennart Poettering 7925c22a78 util: make sure to fstatat() at most once in rm_rf_children() 2012-05-22 16:14:34 +02:00
Lennart Poettering 8f33b5b8b3 util: rework in_initrd() logic
Checking the device major/minor is not a good idea. Let's replace this
with an explicit flag file, which we model after /etc/os-release and
call /etc/initrd-release.
2012-05-21 20:00:58 +02:00
Harald Hoyer 597f43c784 util: rm_rf_children() add root_dev parameter
if root_dev is set, remove subdirectories only, if the device is the
same as the root_dev. This prevents to remove files across device
boundaries.
2012-05-21 18:52:49 +02:00
Harald Hoyer 9be346c94e util.c: add in_initrd()
in_initrd() checks, if the stat() for the device for "/" is 1, which it
is for the initramfs.
2012-05-21 18:47:39 +02:00
Harald Hoyer f67cc036ba main: corrected do_switch_root()
do_switch_root now mount moves "/dev", "/proc", "/sys", "/run" and
removes the old root recursively.
2012-05-21 18:45:10 +02:00
Frederic Crozat 4d768ced49 util: fix typo in newdup 2012-05-21 18:18:49 +02:00
Lennart Poettering 344de60901 hostname-setup: also consider (ńone) an unset hostname 2012-05-21 17:19:58 +02:00
Lennart Poettering 78d54bd42b unit: introduce RequiredBy= setting in [Install], to complement WantedBy= 2012-05-21 15:27:26 +02:00
Lennart Poettering 49dbfa7b2b units: introduce new Documentation= field and make use of it everywhere
This should help making the boot process a bit easier to explore and
understand for the administrator. The simple idea is that "systemctl
status" now shows a link to documentation alongside the other status and
decriptionary information of a service.

This patch adds the necessary fields to all our shipped units if we have
proper documentation for them.
2012-05-21 15:14:51 +02:00
Lennart Poettering 03ad1136ba tmpfiles: if we are supposed to write a string to a file, it's OK if we can't write the trailing newline 2012-05-15 14:35:51 +02:00
Michal Schmidt ba49b4a1a2 install: fix inverted meaning of '--force' in systemctl enable 2012-05-15 08:13:29 +02:00
Andreas Schwab 990478a0ef missing: Fix broken syscall(__NR_fanotify_mark... on ppc32
The same situation as on o32 mips.
2012-05-14 22:57:07 +02:00
Michal Schmidt 9ab7a8d2a3 unit: print the color status marks on the left
The alignment of the "[  OK  ]" and "[FAILED]" status marks to the right
side of the terminal makes it difficult to link them with the messages
on the left if your console is wide.

I considered the options:
 1. Align them to the 80th column regardless of the console width.
    Disadvantage - either:
    - truncating messages needlessly, not using available space; or
    - If the message is long, write the mark over it. => ugly
 2. Write them to the 80th column for short messages,
    and further to the right for longer ones.
    Disadvantage:
    - jagged look
 3. Write the marks on the left, before the message.
    Disadvantage:
    - Breaks tradition from RHL.
    Advantages:
    + slightly simpler code
    + Will annoy holy-traditionalists.

I chose option 3.
BTW, Debian now uses similar marks on the left with its makefile-style
boot.

Special values of the "status" argument to status_vprintf are:
  NULL - no status mark, no message indentation
  ""   - no status mark, message indented as if the mark was there
2012-05-14 14:29:53 +02:00
Michal Schmidt 5f23d5b149 job: change red [ABORT] status to yellow [DEPEND]
The red "[ABORT]" for a dependency failure is too scary.
It suggests a crash. And it suggests a problem with the unit itself.
Change it to a yellow "[DEPEND]" message. The color communicates the
level of seriousness better.
2012-05-14 14:29:53 +02:00
Lennart Poettering d4d046e3fd util: a few updates for rm_rf() 2012-05-09 01:25:52 +02:00
Lennart Poettering 14753f3419 path-util: there is no function path_parent() 2012-05-08 23:37:25 +02:00
Lennart Poettering d889a2069a logind: implement suspend/hibernate calls with inhibition logic 2012-05-08 19:02:25 +02:00
Lennart Poettering 6edd7d0a09 sleep: implement suspend/hibernate as first class targets 2012-05-08 13:54:23 +02:00
Kay Sievers 9eb977db5b util: split-out path-util.[ch] 2012-05-08 02:33:10 +02:00
Kay Sievers bbc98d3256 util: split-out hwclock.[ch] 2012-05-08 01:57:17 +02:00
Kay Sievers 2c21044f05 util: split-out conf-file.[ch] 2012-05-07 19:01:24 +02:00
Kay Sievers 0a1a17aa2d conf_files_list(): split out conf_files_list_strv() 2012-05-07 13:20:29 +02:00
Kay Sievers cd9556cc84 conf_files_list(): files-add() - do not canonicalize file names
File names in /etc, /run, /usr/lib are sorted/overridden by basename.
Sorting things like "/dev/null" with the basename "null" in the hash
of config files breaks the ordering and the overriding logic.
2012-05-07 13:15:25 +02:00
Lennart Poettering eecd1362f7 logind: implement delay inhibitor locks in addition to block inhibitor locks
This is useful to allow applications to synchronously save data before
the system is suspended or shut down.
2012-05-05 00:36:08 +02:00
Lennart Poettering 37099707e2 cgroup: fix alloca() misuse in cg_shorten_controllers() 2012-05-03 23:23:38 +02:00
Lennart Poettering 6e476bc9d1 dbus: handle invalid enum values better 2012-05-03 23:06:19 +02:00
Lennart Poettering e677bf7ef6 hwclock: add taint flag for non-local hwclock 2012-05-03 16:00:49 +02:00
Lucas De Marchi c4326aa4af util: introduce container_of() macro
This macro comes from kernel and it's useful for unwrapping structs
inside another one. The generated code is actually the same to the one
where this logic is used in udev, but using this macro is much cleaner
and less error prone.
2012-04-29 19:14:05 +02:00
Lennart Poettering ab94af9201 util: unify getenv() logic for other PID 2012-04-22 15:00:42 +02:00
Lennart Poettering 0f0dbc46cc nspawn: add -b switch to automatically look for an init binary 2012-04-22 14:11:32 +02:00