Commit Graph

3528 Commits

Author SHA1 Message Date
Lennart Poettering 83f6936a01 journal: extend catalog header to 64bit for all fields, just to be safe and follow the rest of the file formats 2012-11-16 01:35:11 +01:00
Lennart Poettering 0049f05a8b shutdown: readd explicit sync() when shutting down
As it turns out reboot() doesn't actually imply a file system sync, but
only a disk sync. Accordingly, readd explicit sync() invocations
immediately before we invoke reboot().

This is much less dramatic than it might sounds as we umount all
disks/read-only remount them anyway before going down.
2012-11-16 01:35:11 +01:00
Anders Olofsson f553b3b107 udev: make blkid optional
I'm building systemd for an embedded system and we would prefer not having
to include the entire util-linux package just to get a libblkid whose
functionality we don't need.
2012-11-16 01:17:18 +01:00
Lennart Poettering d4205751d4 journal: implement message catalog
The message catalog can be used to attach short help texts to log lines,
keyed by their MESSAGE_ID= fields. This is useful to help the
administrator understand the context and cause of a message, find
possible solutions and find further related documentation.

Since this is keyed off MESSAGE_ID= this will only work for native
journal messages.

The message catalog supports i18n, and is useful to augment english
language system messages with explanations in the local language.

This commit only includes short explanatory messages for a few example
message IDs, we'll add more complete documentation for the relevant
systemd messages later on.
2012-11-15 23:09:07 +01:00
Lennart Poettering 59f432ea6d hostnamectl: fix parsing of --no-ask-password 2012-11-15 23:07:25 +01:00
Lennart Poettering 8885064fd0 polkit: if PK is not around, consider this a permission denied error
Uninstalling PK should cleanly disable PK authorization but not result
in further runtime errors.
2012-11-15 23:07:25 +01:00
Kay Sievers 33c770b174 udev: hwdb - properly handle a missing database
On Thu, Nov 15, 2012 at 5:05 PM, Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> wrote:
> Something like this appeared with latest git:
>
> Nov 15 16:55:46 fedora-15 systemd-udevd[334]: worker [364] terminated by signal 11 (Segmentation fault)
> Nov 15 16:55:46 fedora-15 [387]: Process 364 (systemd-udevd) dumped core.
> Nov 15 16:55:46 fedora-15 systemd-udevd[334]: worker [364] failed while handling '/devices/virtual/net/lo'
> Nov 15 16:55:46 fedora-15 systemd-udevd[334]: worker [360] terminated by signal 11 (Segmentation fault)
> Nov 15 16:55:46 fedora-15 systemd-udevd[334]: worker [360] failed while handling '/devices/pci0000:00/0000:00:03.0/virtio0/net
> Nov 15 16:55:46 fedora-15 [389]: Process 360 (systemd-udevd) dumped core.
>
> Core was generated by usr/lib/systemd/systemd-udevd'.
> Program terminated with signal 11, Segmentation fault.
> #0  0x0000000000423c87 in udev_hwdb_get_properties_list_entry (hwdb=0x0, modalias=0x7fffbcd155f0
2012-11-15 17:30:03 +01:00
Zbigniew Jędrzejewski-Szmek f72daa64dc dbus-manager: modernize style 2012-11-15 16:30:24 +01:00
Eelco Dolstra 645a9e5a2b dbus-manager: fix a fatal dbus abort in bus_manager_message_handler()
If ListUnitFiles fails, or an OOM occurs, then dbus_message_unref()
will be called twice on "reply", causing systemd to crash.  So remove
the call to dbus_message_unref(); it is unnecessary because of
the cleanup attribute on "reply".

[zj: modified to leave one dbus_message_unref() alone, per Colin
Walters' comment.]
2012-11-15 16:29:53 +01:00
Holger Hans Peter Freyther bb11271068 sched: Only setting CPUSchedulingPriority=rr doesn't work
A service that only sets the scheduling policy to round-robin
fails to be started. This is because the cpu_sched_priority is
initialized to 0 and is not adjusted when the policy is changed.

Clamp the cpu_sched_priority when the scheduler policy is set. Use
the current policy to validate the new priority.

Change the manual page to state that the given range only applies
to the real-time scheduling policies.

Add a testcase that verifies this change:

$ make test-sched-prio; ./test-sched-prio
[test/sched_idle_bad.service:6] CPU scheduling priority is out of range, ignoring: 1
[test/sched_rr_bad.service:7] CPU scheduling priority is out of range, ignoring: 0
[test/sched_rr_bad.service:8] CPU scheduling priority is out of range, ignoring: 100
2012-11-15 16:16:45 +01:00
Lekensteyn 71c0159692 journalctl: require argument for --priority
This fixes a segfault due to a missing value for --priority. -p is
unaffected because it is specified in the getopt_long parameter list.
2012-11-15 16:09:02 +01:00
Zbigniew Jędrzejewski-Szmek 0f67f1efae core: lift restriction on order of - and @ in ExecStart 2012-11-15 16:01:22 +01:00
Oleksii Shevchuk 7e1a84f552 core: interpret \; token in ExecStart as escaped ;
Some commands (like 'find') take a semicolon as separate arg. With
current parser implementation there is no way to pass one.

Patch adds token \;
2012-11-15 16:01:10 +01:00
Zbigniew Jędrzejewski-Szmek 2c5417ade0 tests: add tests for config_parse_exec 2012-11-15 16:00:45 +01:00
Oleksii Shevchuk a66f3bea8b core/load-fragment-gperf: add missing CONDITION_FILE_NOT_EMPTY
Unit files couldn't be properly parsed, because of
absent ConditionFileNotEmpty in load-fragment table.
2012-11-15 16:00:03 +01:00
Oleksii Shevchuk 774de5a97f core: fix %h, %s, %p handling in templates in user session 2012-11-15 15:59:50 +01:00
Olivier Brunel f09a7d2554 systemd: highlight ordering cycle deletions
Having unit(s) removed/not started, even if it solved the issue and allowed
to boot successfully, should still be considered an error, as something
clearly isn't right.

This patch elevates the log message from warning to error, and adds a status
message to make things more obvious.
2012-11-15 15:59:39 +01:00
Zbigniew Jędrzejewski-Szmek 45c0c61df3 systemctl: add help for --type/-t
The list of types and load states if lengthy, so a little reminder
can be sometimes useful.
2012-11-15 11:54:57 +01:00
Zbigniew Jędrzejewski-Szmek 48c2826b4e systemctl: remove empty line in case of no units 2012-11-15 11:39:23 +01:00
Zbigniew Jędrzejewski-Szmek d025f1e4dc build-sys: store journald code in a noinst library
The point is to allow the use of journald functions by other binaries.
Before, journald code was split into multiple files (journald-*.[ch]),
but all those files all required functions from journald.c. And
journald.c has its own main(). Now, it is possible to link against
those functions, e.g. from test binaries.

This constitutes a fix for https://bugzilla.redhat.com/show_bug.cgi?id=872638.

The patch does the following:
1. rename journald.h to journald-server.h and move corresponding code
   to journald-server.c.
2. add journald-server.c and other journald-*.c parts to
   libsystemd-journal-internal.
3. remove journald-syslog.c from test_journal_syslog_SOURCES, since
   it is now contained in libsystemd-journal-internal.
There are no code changes, apart from the removal of a few static's,
to allow function calls between files.
2012-11-14 23:39:53 +01:00
Zbigniew Jędrzejewski-Szmek fea05a40ff timedatectl: break line to not exceed 80 columns 2012-11-14 22:49:29 +01:00
Lennart Poettering 6e6fb527f9 shared: add API for replacing @FOO@ style variables in strings 2012-11-14 22:21:16 +01:00
Lennart Poettering 409bc9c33e util: add strreplace() to replace a substring by another string 2012-11-14 22:21:16 +01:00
Lennart Poettering 7ae03f3697 specifier: minor modernizations 2012-11-14 22:21:16 +01:00
Lennart Poettering 0290296582 polkit: fix type on comparison 2012-11-14 22:21:16 +01:00
Thomas Hindoe Paaboel Andersen 377ec8bf19 delta.c: fix option '-t'
Both the help and man page claims that it accepts -t with an argument
so let's do that.
2012-11-14 00:18:02 +01:00
Thomas Hindoe Paaboel Andersen e26970a82c delta.c: use _cleanup_ 2012-11-13 23:45:41 +01:00
Marti Raudsepp 73c0495f68 python: add journal backend for the logging framework
Supports Python versions 2.6 through 3.3 (tested on 2.7 and 3.2).
See JournalHandler docstring for usage details.

[zj: - use send() instead of using sendv() directly
     - do exception handling like in the logging module
     - bumped min version to python2.6, since the module
       does not work with python2.5 anyway ]
2012-11-13 11:13:52 +01:00
Zbigniew Jędrzejewski-Szmek 0c0271841a systemd-analyze: use argparse instead of getopt
Makes the output way nicer with shorter code. Also brings
systemd-analyze behaviour more in line with other systemd-programs.

Argparse is in Python since 2.6, and is available as a package for
previous versions, if someone is stuck with very old Python.
2012-11-13 02:23:02 +01:00
Zbigniew Jędrzejewski-Szmek c94f4b8b53 systemd-python: fix nesting of #ifs and #pragmas 2012-11-13 02:23:02 +01:00
Zbigniew Jędrzejewski-Szmek 6b6ed3e3eb shared/socket-util: kill gcc warning about uninitialized variable
The warning was invalid, but distracting.
2012-11-13 02:23:02 +01:00
Kay Sievers bf9d233f78 udev: properly handle symlink removal by 'change' event
If a 'change' event is supposed to remove created symlinks, we create
a new device structure from the sysfs device and fill it with the list
of links, to compute the delta of the old and new list of links to apply.
If the device is already 'remove'd by the kernel though, udev fails to
create the device structure, so the links are not removed properly.

> From: Neil Brown <nfbrown@suse.com>
> Date: Thu, 8 Nov 2012 10:39:06 +0100
> Subject: [PATCH] If a 'change' event does not get handled by udev until
> after the device has subsequently disappeared, udev mis-handles
> it. This can happen with 'md' devices which emit a change
> event and then a remove event when they are stopped. It is
> normally only noticed if udev is very busy (lots of arrays
> being stopped at once) or the machine is otherwise loaded
> and reponding slowly.
>
> There are two problems.
>
> 1/ udev_device_new_from_syspath() will refuse to create the device
>    structure if the device does not exist in /sys, and particularly if
>    the uevent file does not exist.
>    If a 'db' file does exist, that is sufficient evidence that the device
>    is genuine and should be created.  Equally if we have just received an
>    event from the kernel about the device, it must be real.
>
>    This patch just disabled the test for the 'uevent' file, it doesn't
>    try imposing any other tests - it isn't clear that they are really
>    needed.
>
> 2/ udev_event_execute_rules() calls udev_device_read_db() on a 'device'
>    structure that is largely uninitialised and in particular does not
>    have the 'subsystem' set.  udev_device_read_db() needs the subsystem
>    so it tries to read the 'subsystem' symlink out of sysfs.  If the
>    device is already deleted, this naturally fails.
>    udev_event_execute_rules() knows the subsystem (as it was in the
>    event message) so this patch simply sets the subsystem for the device
>    structure to be loaded to match the subsystem of the device structure
>    that is handling the event.
>
> With these two changes, deleted handling of change events will still
> correctly remove any symlinks that are not needed any more.

Use udev_device_new() instead of allowing udev_device_new_from_syspath()
to proceed without a sysfs device.
2012-11-13 02:14:17 +01:00
Mauro Dreissig cf2292f5ac libudev: avoid leak during realloc failure 2012-11-13 01:59:33 +01:00
Thomas Hindoe Paaboel Andersen 33b4055123 remove duplicate semicolons 2012-11-12 22:38:44 +01:00
Michal Schmidt 45a5ff0de7 util: nicer tree drawings
Draw trees more similar to pstree/findmnt/lsblk/...
2012-11-12 22:27:48 +01:00
Dave Reisner a9cdc94f7f enable localization for common *ctl commands 2012-11-12 14:16:07 -05:00
Kay Sievers 1298001ec5 use the same email address everywhere 2012-11-12 19:47:43 +01:00
Kay Sievers 88a6477ef3 libudev: update copyright headers 2012-11-12 17:50:33 +01:00
Kay Sievers 40fe8b11be udev: use usec_t and now() 2012-11-12 01:03:14 +01:00
Kay Sievers 2311eb2ff0 timedatectl: properly print 30 minutes DST transitions 2012-11-11 16:55:25 +01:00
Dave Reisner ef216ca3d7 coredumpctl: add missing -F, --field option to help 2012-11-09 14:14:53 -05:00
Dave Reisner 584f587295 systemd-coredumpctl: add 'gdb' to usage output 2012-11-09 10:04:08 -05:00
Lennart Poettering bece1f5215 dbus: when verifying PK privs, bypass PK if uid=0 of client
This reduces the number of roundtrips when the client is privileged and
makes the PK dep optional for root clients.
2012-11-09 15:55:36 +01:00
Kay Sievers a660c63c55 udev: net_id - add builtin to retrieve data for network devices 2012-11-09 13:05:19 +01:00
Kay Sievers 59803c380d udev: hwdb - search parents for 'modalias' and data 2012-11-09 13:05:11 +01:00
Kay Sievers c3cfed0d6c udev: update file headers 2012-11-09 12:39:27 +01:00
Michal Schmidt 40b8acd039 fstab-generator: more specific error messages 2012-11-09 12:00:46 +01:00
Dave Reisner 8db9d8c2a4 cryptsetup: fix inverted comparison in pass_volume_key 2012-11-06 10:18:10 -05:00
Dave Reisner e4f44e734c Revert "Implement SocketUser= and SocketGroup= for [Socket]"
This was never intended to be pushed.

This reverts commit aea54018a5.
2012-11-06 09:54:17 -05:00
Dave Reisner 65343c7494 cryptsetup: hash=plain means don't use a hash
"plain" is a semantic value that cryptsetup(8) uses to describe a plain
dm-crypt volume that does not use a hash. Catch this value earlier and
ensure that a NULL params.hash is passed to crypt_format to avoid
passing an invalid hash type to the libcryptsetup backend.

FDO bug #56593.
2012-11-06 09:53:00 -05:00
Dave Reisner aea54018a5 Implement SocketUser= and SocketGroup= for [Socket]
Since we already allow defining the mode of AF_UNIX sockets and FIFO, it
makes sense to also allow specific user/group ownership of the socket
file for restricting access.
2012-11-05 21:17:55 -05:00
Kay Sievers 6aa220e019 mount-setup: try mounting 'efivarfs' only if the system bootet with EFI 2012-11-04 17:03:48 +01:00
Kay Sievers 3dfb265083 kmod-setup: mounting efivarfs, *after* we tried to mount it, is pointless
The mount() system call, which we issue before loading modules, will trigger
a modprobe by the kernel and block until it returns. Trying to load it again
later, will have exactly the same result as the first time.
2012-11-04 17:00:57 +01:00
Kay Sievers 1022373284 kmod-setup: add conditional module loading callback 2012-11-04 16:54:19 +01:00
Kay Sievers c1e5704657 shared: add is_efiboot() 2012-11-04 16:06:27 +01:00
Dave Reisner 075ff6863d drop Arch Linux support for reading /etc/rc.conf 2012-11-03 20:11:52 -04:00
Dave Reisner 53d05b44f1 drop Arch Linux support for reading /etc/rc.conf 2012-11-03 19:59:42 -04:00
Miklos Vajna da974c2ff2 vconsole: remove Frugalware legacy file support 2012-11-03 21:23:37 +01:00
Michal Schmidt c339d9775d util : fallback to plain ASCII drawing if locale is not UTF-8
When printing cgroup and sysfs hierarchies, avoid using UTF-8 box drawing
characters if the locale is not UTF-8.

https://bugzilla.redhat.com/show_bug.cgi?id=871153
2012-11-02 17:39:52 +01:00
Michal Schmidt 0901758558 util: add is_locale_utf8()
journalctl and vconsole-setup both implement utf8 locale detection.
Let's have a common function for it.
The next patch will add another use.
2012-11-02 17:27:15 +01:00
Cosimo Cecchi 4940c64240 analyze: use GDBus instead of dbus-python 2012-11-02 16:54:28 +01:00
Kay Sievers e2fd5e5ba2 timedatectl: show "DST active: n/a" if no DST data is available 2012-11-02 05:45:02 -10:00
Kay Sievers f18ca9dcde timedatectl: explain everything nobody wants to know about DST 2012-11-02 03:45:07 +01:00
Kay Sievers b7f1542c8b shared: add timer_get_dst() 2012-11-02 00:44:23 +01:00
Kay Sievers 3a4431ef72 udev: break over-long lines 2012-11-02 00:32:10 +01:00
Lennart Poettering 669b04a492 service: drop special HTTP server target, as it is a bad idea anf Fedora specific
This was premarily intended to support the LSB facility $httpd which is
only known by Fedora, and a bad idea since it lacks any real-life
usecase.

Similar, drop support for some other old Fedora-specific facilities.

Also, document the rules for introduction of new facilities, to clarify
the situation for the future.
2012-10-31 02:55:04 +01:00
Lennart Poettering 1fd8d04e38 strv: cleanup error path loops
https://bugzilla.redhat.com/show_bug.cgi?id=858799
2012-10-30 18:30:45 +01:00
Michal Schmidt 8511dd1871 shared: "max" in the string->number conversion is meant to be inclusive 2012-10-30 15:46:49 +01:00
Michal Schmidt f8b69d1dfc shared, core: do not always accept numbers in string lookups
The behaviour of the common name##_from_string conversion is surprising.
It accepts not only the strings from name##_table but also any number
that falls within the range of the table. The order of items in most of
our tables is an internal affair. It should not be visible to the user.

I know of a case where the surprising numeric conversion leads to a crash.

We will allow the direct numeric conversion only for the tables where the
mapping of strings to numeric values has an external meaning. This holds
for the following lookup tables:
 - netlink_family, ioprio_class, ip_tos, sched_policy - their numeric
   values are stable as they are defined by the Linux kernel interface.
 - log_level, log_facility_unshifted - the well-known syslog interface.

We allow the user to use numeric values whose string names systemd does
not know. For instance, the user may want to test a new kernel featuring
a scheduling policy that did not exist when his systemd version was
released. A slightly unpleasant effect of this is that the
name##_to_string conversion cannot return pointers to constant strings
anymore. The strings have to be allocated on demand and freed by the
caller.
2012-10-30 15:41:15 +01:00
Zbigniew Jędrzejewski-Szmek 4f76ae1b4b coredumpctl: add --field/-F option
Useful for completion generation.
2012-10-30 11:26:49 +01:00
Zbigniew Jędrzejewski-Szmek 9a34088094 coredumpctl: add --no-legend option
Useful for completion generation.
2012-10-30 11:26:49 +01:00
Zbigniew Jędrzejewski-Szmek 2fb7a5ce67 coredumpctl: fix program return code 2012-10-30 11:24:00 +01:00
Zbigniew Jędrzejewski-Szmek 57ce4bd4ea coredumpctl: add guard to options table
It is not nice to segfault on unknown options :(
2012-10-30 11:23:59 +01:00
Michal Schmidt 50425d1614 libsystemd-daemon: fix style 2012-10-30 10:30:44 +01:00
Michal Schmidt f3910003bc shared, libsystemd-daemon: check for empty strings in strto*l conversions
strtol() and friends may set EINVAL if no conversion was performed, but
they are not required to do so. In practice they don't. We need to check
for it.

https://bugzilla.redhat.com/show_bug.cgi?id=870577
2012-10-30 10:30:04 +01:00
Auke Kok 0eb59ccfe6 SMACK: Add configuration options. (v3)
This adds SMACK label configuration options to socket units.

SMACK labels should be applied to most objects on disk well before
execution time, but two items remain that are generated dynamically
at run time that require SMACK labels to be set in order to enforce
MAC on all objects.

Files on disk can be labelled using package management.

For device nodes, simple udev rules are sufficient to add SMACK labels
at boot/insertion time.

Sockets can be created at run time and systemd does just that for
several services. In order to protect FIFO's and UNIX domain sockets,
we must instruct systemd to apply SMACK labels at runtime.

This patch adds the following options:

Smack - applicable to FIFO's.
SmackIpIn/SmackIpOut - applicable to sockets.

No external dependencies are required to support SMACK, as setting
the labels is done using fsetxattr(). The labels can be set on a
kernel that does not have SMACK enabled either, so there is no need
to #ifdef any of this code out.

For more information about SMACK, please see Documentation/Smack.txt
in the kernel source code.

v3 of this patch changes the config options to be CamelCased.
2012-10-30 03:40:42 +01:00
Lennart Poettering 978cf3c75f logind: it's OK if a process on an pty requests a session for seat0
After all, if a sudo/su inside an X terminal should get added to the
same session as the X session itself.
2012-10-30 03:40:42 +01:00
Lennart Poettering 7ba6438631 logind: unify all session lock loop 2012-10-30 03:40:42 +01:00
Lee, Chun-Yi f271dd9762 systemd: mount the EFI variable filesystem
Add efivarfs to the mount_table in mount-setup.c, so the EFI variable
filesystem will be mounted when systemd executed.

The EFI variable filesystem will merge in v3.7 or v3.8 linux kernel.

Cc: Kay Sievers <kay@vrfy.org>
Cc: Lennart Poettering <lennart@poettering.net>
Cc: Mantas Mikulėnas <grawity@gmail.com>
Cc: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Cc: Matt Fleming <matt.fleming@intel.com>
Cc: Jeremy Kerr <jeremy.kerr@canonical.com>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
2012-10-30 03:40:42 +01:00
Michal Schmidt fd09c93de9 util: improve overflow checks
commit 49371bb fixed the observed division by zero, but missed another
occurrence of the same bug. It was also not the optimal fix. We can
simply make the divisor a constant by swapping it with the compared
value.
2012-10-29 22:57:24 +01:00
Kay Sievers f36d7992ef hostnamectl: do not choke on set-hostname with no argument
https://bugzilla.redhat.com/show_bug.cgi?id=871172
2012-10-29 20:56:02 +01:00
Dave Reisner 49371bb50e util: avoid divide by zero FPE
In early userspace, if kernel initialization happens extremely quickly,
a call to systemd-timestamp can potentially result in division by zero.
Ensure that the check in timespec_load, which only makes sense if tv_sec
is greater than zero, is guarded by this condition.
2012-10-29 15:53:03 -04:00
Olivier Brunel b61e88162a swap: fix swap behaviour with symlinks
Starting a swap unit pointing to (What) a symlink (e.g. /dev/mapper/swap
or /dev/disk/by-uuid/...) would have said unit marked active, following
the one using the "actual" device (/dev/{dm-1,sda3}), but that new unit
would be seen as inactive.
Since all requests to stop swap units would follow/redirect to it,
and it is seen inactive, nothing would be done (swapoff never called).

This is because this unit would be treated twice in
swap_process_new_swap, the second call to swap_add_one causing it to
eventually be marked inactive.
2012-10-29 09:04:25 +00:00
Zbigniew Jędrzejewski-Szmek 646134dc0d swap: modernize style 2012-10-29 09:03:56 +00:00
Zbigniew Jędrzejewski-Szmek 170ca19e4d swap: use automatic cleanup 2012-10-29 09:01:20 +00:00
Zbigniew Jędrzejewski-Szmek df326b8463 swap: introduce helper variable
Just for readability, no funcational change.
2012-10-29 09:00:56 +00:00
Zbigniew Jędrzejewski-Szmek 92b3623304 login: trivial grammar fix 2012-10-28 22:43:11 +01:00
Zbigniew Jędrzejewski-Szmek ccd413871b systemctl: skip JOBS column if no jobs
Output is very constrained. This change saves 4 columns in the common
case.
2012-10-28 22:43:11 +01:00
Lennart Poettering 7654b2c259 logind: add 'lock' as possible choice for handling hw keys 2012-10-28 12:29:27 +01:00
Kay Sievers 9485d98d77 libudev: hwdb - cleanup list before getting new properties 2012-10-28 04:59:38 +01:00
Kay Sievers 23b7245397 udev: add "udevadm hwdb --test=<modalias>" 2012-10-28 04:41:15 +01:00
Kay Sievers ff944daa01 udev: get rid of SYSCONFDIR 2012-10-28 04:04:22 +01:00
Zbigniew Jędrzejewski-Szmek f2d433e178 Tweak TODO 2012-10-28 02:14:41 +02:00
Michal Sekletar 3dd8ee8fa6 util: fix possible integer overflows 2012-10-28 02:14:41 +02:00
Michal Sekletar 7ca7021a9e localectl: fix memleak, use _cleanup_strv_free_
l might contain zero strings, however there is still memory
allocated for NULL terminator, use _cleanup_strv_free_ instead to
prevent tiny leak in such case.
2012-10-28 02:14:41 +02:00
Michal Sekletar 2f7a4867ba localectl: fix memleak, jump to finish before returning 2012-10-28 02:14:40 +02:00
Michal Sekletar 4a207bb2a5 journal: fix memleak, call set_free before return 2012-10-28 02:14:40 +02:00
Lennart Poettering 6524990fdc logind: support for hybrid sleep (i.e. suspend+hibernate at the same time) 2012-10-28 00:50:35 +02:00
Kay Sievers 2001208c2a libudev: import hwdb and export lookup interface 2012-10-27 23:39:41 +02:00
Kay Sievers 19e6561356 hwclock: do not seal the kernel's time-warp call from inside the initrd 2012-10-27 16:31:10 +02:00
Lennart Poettering e8988fc2a2 util: return the remaining string in startswith() 2012-10-27 01:20:01 +02:00
Lennart Poettering ada45c785f coredumpctl: add 'gdb' verb to start gdb right-away on a collected coredump 2012-10-27 01:19:47 +02:00
Lennart Poettering 684341b073 coredumpctl: show timestamps in list 2012-10-26 20:34:39 +02:00
Lennart Poettering 34741aa3e2 journal: special case the trivial cache chain cache entry 2012-10-26 20:25:36 +02:00
Lennart Poettering 8bc8ab83c8 coredumpctl: optimize journal entry parsing a bit by enumerating only once 2012-10-26 20:25:10 +02:00
Lennart Poettering ccc403587c coredumpctl: initialize global vars 2012-10-26 20:23:28 +02:00
Lennart Poettering 85210bffd8 journal: provide an API that allows client to figure out whether they need to recheck the journal manually for changes in regular intervals
Network file systems generally do not offer inotify() that would work
across the network. We hence cannot rely on inotify() exclusiely in
those case. Provide an API to determine these cases, and suggest doing
manual regular rechecks.

Note that this is not complete yet, as we need to rescan journal dirs on
network file systems explicitly to find new/removed files
2012-10-26 20:07:33 +02:00
Lennart Poettering e9f600f2fb journal: fix parsing of monotonic kernel timestamps 2012-10-26 14:56:41 +02:00
Martin Pitt 221a6c2a26 keymap: Add HP EliteBook 8440p
Thanks to Glen Ditchfield <gjditchfield@acm.org>!

https://launchpad.net/bugs/1071579
2012-10-26 06:31:14 +02:00
Kay Sievers 4af113f997 udev: builtin - do not fail builtin initialization if one of them returns an error 2012-10-26 03:45:25 +02:00
Lennart Poettering a4bcff5ba3 journal: introduce entry array chain cache
When traversing entry array chains for a bisection or for retrieving an
item by index we previously always started at the beginning of the
chain. Since we tend to look at the same chains repeatedly, let's cache
where we have been the last time, and maybe we can skip ahead with this
the next time.

This turns most bisections and index lookups from O(log(n)*log(n)) into
O(log(n)). More importantly however, we seek around on disk much less,
which is good to reduce buffer cache and seek times on rotational disks.
2012-10-26 03:24:03 +02:00
Lennart Poettering 7fb4d896e1 test: extend test-send to send some weirder data 2012-10-26 01:18:41 +02:00
Lennart Poettering 0f91dd8749 journal: properly determine cutoff max date 2012-10-26 01:18:41 +02:00
Michal Sekletar 91b32fa987 sysctl: parse all keys in a config file
https://bugzilla.redhat.com/show_bug.cgi?id=869779
2012-10-26 01:12:22 +02:00
Kay Sievers a9f4815da5 udev: kmod - fix typo 2012-10-26 00:36:32 +02:00
Kay Sievers 5b4d50efe8 udev: kmod, hwdb - do not fail if databases are not available 2012-10-25 22:58:02 +02:00
Kay Sievers 3b0a5f2023 udev: hwdb - exit if no database is available 2012-10-25 22:22:29 +02:00
Kay Sievers 7ee40fc3e9 udev: hwdb validate() return when the database is not opened 2012-10-25 22:08:33 +02:00
Kay Sievers 1c574591db udev: hwdb - remove run_once 2012-10-25 21:44:33 +02:00
Kay Sievers c225f2ffc8 udev: hwdb - properly initialize search structure 2012-10-25 21:44:33 +02:00
Kay Sievers e5f2783e73 udev: set optind = 0, not the usual 1, to reset getopt_long()s internal state 2012-10-25 21:31:38 +02:00
Michal Schmidt 1abc85b8d0 job: avoid recursion into transaction code from job cancelation
I hit an "assert(j->installed)" failure in transaction_apply(). Looking
into the backtrace I saw what happened:
1. The system was booting. var.mount/start was an installed job.
2. I pressed Ctrl+Alt+Del.
3. reboot.target was going to be isolated.
4. transaction_apply() proceeded to install a var.mount/stop job.
5. job_install() canceled the conflicting start job.
6. Depending jobs ended recursively with JOB_DEPENDENCY, among them was
   local-fs.target/start.
7. Its OnFailure action triggered - emergency.target was now going to be
   isolated.
8. We recursed back into transaction_apply() where the half-installed
   var.mount/stop job confused us.

Recursing from job installation back into the transaction code cannot be
a good idea. Avoid the problem by canceling the conflicting job
non-recursively in job_install(). I don't think we'll miss anything by
not recursing here. After all, we are called from transaction_apply().
We will not be installing just this one job, but all jobs from a
transaction. All requirement dependencies will be included in it and
will be installed separately. Every transaction job will get a chance
to cancel its own conflicting installed job.
2012-10-25 03:21:32 +02:00
Michal Schmidt 65eb544e12 job: add comments to JobResult values 2012-10-25 03:21:31 +02:00
Lennart Poettering d99ae53a73 journal: properly serialize fields with multiple values into JSON
This now matches the JSON serialization spec from:

http://www.freedesktop.org/wiki/Software/systemd/json
2012-10-25 01:24:44 +02:00
Kay Sievers cae356ad49 remove Fedora hostname, locale, vconsole legacy file support 2012-10-24 03:51:06 +02:00
Lennart Poettering db87a36e74 journalctl: remove left-over log message 2012-10-24 01:06:31 +02:00
Tom Gundersen a2558205f7 tmpfiles: allow Age to be set to 0
Mostly useful for testing purposes. Setting Age to 1s works just as
well, but it is surprising that using 0s (or just 0) does not work.

Also clarify this in the documentation.
2012-10-23 21:53:20 +02:00
Mantas Mikulėnas 4278aa278c cgls: correctly ellipsize command lines for PIDs >= 1000000 2012-10-23 17:13:20 +02:00
Kay Sievers 796b06c21b udev: add hardware database support 2012-10-23 16:43:32 +02:00
Will Woods bcbd5405b1 mount: make sure m->where is set before unit_add_exec_dependencies()
If you enter unit_add_exec_dependencies with m->where = NULL, you'll
very likely end up aborting somewhere under socket_needs_mount.

(When systemd goes to check to see if the journald socket requires your
mount, it'll do path_startswith(path, m->where)... *kaboom*)

This patch should ensure that:

    a) both branches in mount_add_one() set m->where, and
    b) mount_add_extras() calls unit_add_exec_dependencies() *after*
       setting m->where.
2012-10-23 01:53:02 +02:00
Lennart Poettering 2609659f0d systemctl: refer to systemctl -n, to not overwhelm the admin 2012-10-23 00:12:33 +02:00
Michal Schmidt c4b996bd87 readahead: fix fd validity check
https://bugzilla.redhat.com/show_bug.cgi?id=868603
2012-10-22 22:08:06 +02:00
Kay Sievers f1c0ece144 shared: strbuf - add descriprion 2012-10-22 18:21:12 +02:00
Kay Sievers 3c62146280 shared: move sparse-endian.h from journal 2012-10-22 18:08:48 +02:00
Kay Sievers 4693cfb3bf shared: strbuf - add description 2012-10-22 16:57:49 +02:00
Kay Sievers 915bf0f60f udev: use strbuf to store rules strings 2012-10-22 16:28:04 +02:00
Kay Sievers 955bd501c2 shared: strbuf - add string de-duplication facility 2012-10-22 16:27:00 +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 fe29f9d25b hostnamectl: add more really basic system info to the status output 2012-10-21 03:35:54 +02:00
Lennart Poettering e8c61d7b74 journal: use le64_t instead of uint64_t where this is appropriate 2012-10-21 03:35:54 +02:00
Lennart Poettering 0962e09ec3 journal: link up documentation with the file structure header 2012-10-20 17:01:19 +02:00
Christian Hesse 20f59e42cd shared/install: fix typo in comment 2012-10-19 17:34:38 +02:00
Christian Hesse df77cdf0fc systemctl: fix return code in chroot
If 'systemctl enable' (and friends) is run inside chroot it always
exits with a bad return code. unit_file_enable() returns the number of
symlink rules that were supposed to be created. So resetting r to 0 and
exiting gracefully should be the correct way.
2012-10-19 17:34:02 +02:00
Michael Olbrich f527b6b8e2 make sure __NR_name_to_handle_at is correctly defined
341 is only valid for x86, so don't use it for other architectures.
Add the correct numbers for ARM and PowerPC while at it.
2012-10-19 17:31:33 +02:00
Umut Tezduyar 2a7cccf065 random-seed: fix error message typo
The file node is /dev/urandom, not /dev/random.
2012-10-19 17:31:33 +02:00
Zbigniew Jędrzejewski-Szmek 5de0409e54 journal: add tool to extract coredumps
'systemd-coredumpctl' will list available coredumps:
   PID   UID   GID sig exe
 32452  500  500  11 /home/zbyszek/systemd/build/journalctl
 32666  500  500  11 /usr/lib64/valgrind/memcheck-amd64-linux
...

'systemd-coredumpctl dump PID' will write the coredump
to specified file or stdout.
2012-10-19 15:15:38 +00:00
Martin Pitt accfdb7abf keymap: Tolerate invalid entries in keymaps
Some keymaps apply to a large range of computer models, not all of which have
all of the scan codes in the maps. If a single scan code is invalid, do not
abort but continue with the next entry in the map. Instead just show the error
message for that particular scan code, to help with debugging.
2012-10-19 08:05:58 +02:00
Martin Pitt 3bb9434b69 keymap: Fix parsing of hex scan codes in tables
Commit b1f87c76b1 changed sscanf from %i to %u, as scan codes are unsigned
numbers which can be > 0x7FFFFFFF. However, sscanf doesn't accept hexadecimal
numbers for %u. It works fine with %i, so revert this back.
2012-10-19 08:01:47 +02:00
Martin Pitt 6e303b233b README.keymap.txt: Drop fdi2rules.py documentation
This was removed ages ago.
2012-10-19 07:41:09 +02:00
Lennart Poettering 2087a7aff2 locale: add client tool localectl similar to hostnamectl/timedatectl 2012-10-19 04:55:49 +02:00