Commit Graph

61 Commits

Author SHA1 Message Date
Lennart Poettering 6524990fdc logind: support for hybrid sleep (i.e. suspend+hibernate at the same time) 2012-10-28 00:50:35 +02:00
Lennart Poettering e8988fc2a2 util: return the remaining string in startswith() 2012-10-27 01:20:01 +02:00
Lennart Poettering 684341b073 coredumpctl: show timestamps in list 2012-10-26 20:34:39 +02:00
Kay Sievers a9e12476ed util: add (x)bsearch_r(), the missing counterpart of qsort_r() 2012-10-22 14:31:46 +02:00
Lennart Poettering 8c7c140fca util: change endswith() to return a pointer to the suffix 2012-10-19 04:53:46 +02:00
Lennart Poettering ed757c0cb0 util: unify line caching and column caching 2012-10-19 00:07:55 +02:00
Lennart Poettering 8481248b9f util: unify usage of on_tty() in util.c 2012-10-19 00:07:55 +02:00
Lennart Poettering 28917d7dc7 util: simplify column caching logic 2012-10-19 00:07:55 +02:00
Lennart Poettering cfbc22abd0 journalctl: implement --since= and --until for filtering by time 2012-10-11 16:43:37 +02:00
Lennart Poettering 0b507b17a7 dbus: add some more safety checks before accepting data from bus clients 2012-10-03 13:29:20 -04:00
Dave Reisner 585314e84c journalctl: reset cached column count on SIGWINCH
This requires a little bit of tip-toeing around to explicitly avoid
touching the environment from a sig handler. Instead, simply create a
function to reset the var to its "unset" state, allowing the next call
to columns() to recalculate and cache the new value.
2012-09-24 08:38:03 -04:00
Lennart Poettering aa408e7799 util: fix overflow checks 2012-09-20 17:53:03 +02:00
Lennart Poettering 040f18ea8a util: overflow hardening 2012-09-20 11:08:27 +02:00
Lennart Poettering 4b8772bf5f util: make sure heap allocators fail when array allocations are out of bounds
https://bugzilla.redhat.com/show_bug.cgi?id=858777
2012-09-20 00:02:04 +02:00
Lennart Poettering 7d5e9c0f60 util: define union dirent_storage and make use of it everywhere
Make sure to allocate enough space for readdir_r().

https://bugzilla.redhat.com/show_bug.cgi?id=858754
2012-09-19 22:21:09 +02:00
Lennart Poettering 901c3d0d85 util: introduce get_process_gid() 2012-09-18 01:53:15 +02:00
Lennart Poettering 669bec5d17 util: various cleanups for printing boot status 2012-09-17 19:05:32 +02:00
Zbigniew Jędrzejewski-Szmek 25ea79fe07 nspawn: use automatic cleanup for umask 2012-09-16 16:20:09 +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 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 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
Lennart Poettering 5b4c61cd0b journald: properly unescape messages from /dev/kmsg 2012-08-09 16:49:28 +02:00
Zbigniew Jędrzejewski-Szmek 11f96fac8f cgtop: use full terminal width 2012-07-26 23:32:01 +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
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
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
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 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
Marc-Antoine Perennou 952d817a41 main: Silence gcc warning 2012-05-31 18:04:41 +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
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
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 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
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 d889a2069a logind: implement suspend/hibernate calls with inhibition logic 2012-05-08 19:02:25 +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
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