Commit Graph

3528 Commits

Author SHA1 Message Date
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
Lennart Poettering 31e767f73a systemctl: modernization 2012-10-19 04:53: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 857a493d55 set: introduce strv_sort() 2012-10-19 04:53:45 +02:00
Lennart Poettering 9590dfe771 set: introduce set_get_strv() 2012-10-19 04:52:14 +02:00
Lennart Poettering 7591abd480 timedatectl,hostnamectl: rework --help text 2012-10-19 04:51:53 +02:00
Lennart Poettering 6d9082172c journald.conf: remove MinSize= settings
There's no point in making this configurable, so let's drop it in order
to simplify configuration a bit.
2012-10-19 00:56:42 +02:00
Lennart Poettering aae9a96d4b systemctl: remove --follow option
Given that "journalctl -u" exists now there's no need to duplicate this
functionality in systemctl, so let's drop this, especially given that it
always felt a bit awkward to overload "-f" to both --force and --follow,
and to have continues output with a status header for this.

        systemctl status -f avahi-daemon

now becomes:

        journalctl -fu avahi-daemon

Which is shorter and a lot less redundant.
2012-10-19 00:12: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 f89a3b6f5b journalctl: unify ellipsation handling between journalctl and systemctl 2012-10-18 23:35:44 +02:00
Lennart Poettering cd4b13e0bf journalctl: don't ellipsize unless on a tty 2012-10-18 23:35:44 +02:00
Lennart Poettering fd6e887537 journalctl: honour -n if -F is used 2012-10-18 23:35:44 +02:00
Lennart Poettering b5cff06b48 journal: fix symbol versioning file 2012-10-18 22:38:56 +02:00
Lennart Poettering bdc02927f7 journal: typo fix 2012-10-18 22:36:50 +02:00
Lennart Poettering 1cd8a002ff journal: implement filtering in browse.html 2012-10-18 22:34:42 +02:00
Lennart Poettering 082d0180f9 journal: add high-level match option to filter by current boot id 2012-10-18 22:34:42 +02:00
Lennart Poettering 240a5fe83e journal: add ability to list unique fields to gatewayd 2012-10-18 22:34:42 +02:00
Lennart Poettering d5c4ed623b journal: validate field name in sd_journal_query_unique() 2012-10-18 22:34:42 +02:00
Zbigniew Jędrzejewski-Szmek 23635a8547 systemd: use structured logging for unit changes
Information which unit a log entry pertains to enables systemctl
status to display more log messages.
2012-10-18 21:33:52 +02:00
Zbigniew Jędrzejewski-Szmek b66871dad9 core/execute: use cleanup_strv_free 2012-10-18 21:33:52 +02:00
Zbigniew Jędrzejewski-Szmek 115646c789 libsystemd-journal: export sd_journal_restart_unique 2012-10-18 19:18:20 +00:00
Lennart Poettering 0598fd4a95 journal: suggest rotation when fields are not indexed 2012-10-18 04:12:25 +02:00
Lennart Poettering 15804cebfd journalctl: move access check before the first access to the journal files 2012-10-18 03:35:58 +02:00
Lennart Poettering 15119c1602 journalctl: implement quering field values with new -F switch
Example:

        journalctl -F _SYSTEMD_UNIT

will list all units that ever logged to the journal.
2012-10-18 03:35:58 +02:00
Lennart Poettering 3c1668da62 journal: add ability to list values a specified field can take in all entries of the journal
The new 'unique' API allows listing all unique field values that a field
specified by a field name can take in all entries of the journal. This
allows answering queries such as "What units logged to the journal?",
"What hosts have logged into the journal?", "Which boot IDs have logged
into the journal?".

Ultimately this allows implementation of tools similar to lastlog based
on journal data.

Note that listing these field values will not work for journal files
created with older journald, as the field values are not indexed in
older files.
2012-10-18 03:35:18 +02:00
Lennart Poettering 600b704eb0 manager: connect SIGRTMIN+24 to terminating --user instances 2012-10-18 01:19:35 +02:00
Lennart Poettering 97ae63e2a9 service: when invoking service processes in --user mode set MANAGERPID to PID of systemd 2012-10-18 01:18:50 +02:00
Lennart Poettering c978343015 timedatectl: rename --fix-system to --adjust-system-clock
Quite long to read but hopefully less misleading.
2012-10-17 22:52:21 +02:00
Dave Reisner f75cb30bf9 timedatectl: ensure n_zones is initialized 2012-10-17 15:44:59 -04:00
Lennart Poettering 599659860c timedatectl: properly initialize struct before decoding bus messages 2012-10-17 21:25:43 +02:00
Lennart Poettering 01539d6ef9 hostnamed: allow UTF8 chars in pretty hostname again 2012-10-17 21:25:42 +02:00
Lennart Poettering 4fa25d62bd journal: fix potential integer overflow 2012-10-17 21:25:42 +02:00
Lennart Poettering dbc4fbae58 hostname: add new hostnamectl tool as text client for hostnamed 2012-10-17 21:25:42 +02:00
Lennart Poettering c846716a5a loginctl: show pager also for status command 2012-10-17 21:25:42 +02:00
Lennart Poettering 6d0274f115 timedatectl: introduce new command line client for timedated
Much like logind has a client in loginctl, and journald in journalctl
introduce timedatectl, to change the system time (incl. RTC), timezones
and related settings.
2012-10-17 21:25:42 +02:00
Eelco Dolstra 22349cee29 Properly handle device aliases used as dependencies
If a device unit has aliases defined in udev rules, and there are
other units that depend on that alias, as in

  BindTo=sys-subsystem-net-devices-eth0.device

then systemd will fail the start the alias, and any dependent units
will time out.  See

  https://bugs.freedesktop.org/show_bug.cgi?id=52580

This is because unit_add_name() in device_add_escaped_name() will
return EEXIST.

The solution taken here is to call device_update_unit() on the alias
name.  Thus if a unit with the alias name already exists, we reuse it;
otherwise a new unit is created.  Creating multiple units for a single
device is perhaps suboptimal, but it's consistent with the treatment
of udev symlinks in device_process_new_device().
2012-10-17 09:54:53 -04:00
Lennart Poettering 5e6870eab5 journalctl: properly track rotated journals in follow mode 2012-10-16 23:00:04 +02:00
Lennart Poettering 44a5fa34d9 sd-journal: fix bad memory access 2012-10-16 22:59:28 +02:00
Lennart Poettering fb0951b02e journal: implement time-based rotation/vacuuming
This also enables time-based rotation (but not vacuuming) after 1month,
so that not more one month of journal is lost at a time per vacuuming.
2012-10-16 22:58:07 +02:00
Lennart Poettering 1f2da9ec51 journal: sort data items of entries by offset
This should slightly optimize disk access patterns on rotating disks for
simple readers.
2012-10-16 21:40:48 +02:00
Lennart Poettering b87705cdd2 mount: don't try to initialize extra deps for mount units before initializing their basic fields
Under some circumstances this could lead to a segfault since we we
half-initialized a mount unit, then tried to hook it into the network of
things and while doing that recursively ended up looking at our
half-initialized mount unit again assuming it was fully initialized.
2012-10-16 19:50:26 +02:00
Lennart Poettering 7708588119 logind: only release logind session from the PAM module if the same module instance actually created it 2012-10-16 19:21:21 +02:00
Lennart Poettering 183de6d7d9 id128: introduce new SD_ID128_CONST_STR() macro 2012-10-16 17:02:51 +02:00
Lennart Poettering 706911fba8 journal: don't export MESSAGE_ID() macro
If it is exported it would need to be prefixed, but since we need it
exclusively internally so far, simply move it to an internal header.
2012-10-16 16:26:41 +02:00
Michael Stapelberg 37e2941d14 service: Heuristically determine whether SysV scripts support reload
This commit checks for a usage line which contains [{|]reload[|}"] (to
not errnously match force-reload).

Heuristics like this suck, but it solves a real problem and there
appears to be no better way...
2012-10-16 16:18:41 +02:00
Colin Guthrie a2ab7ee612 journal: Set the last_unused pointer correctly when attaching an unused window
It seems the previous code was copy/pasted from context_detach_window()
but not updated.
2012-10-16 16:14:46 +02:00
Colin Guthrie 89de694724 journal: Properly track the number of allocated windows.
Checks were already in place to make sure that the number of
windows was limited to 64, but the count was never incremented
or decremented.
2012-10-16 16:13:33 +02:00
Lukas Nykryn 696c245a23 systemctl: append .service when unit does not have valid suffix
systemctl status a and systemctl status a.service lead to same output but
systemctl status a.b and systemctl status a.b.service do not.
2012-10-16 16:07:37 +02:00
Lennart Poettering c3f60ec54d journalctl: add --unit=/-u to match by unit name
This applies unit_name_mangle() to the specified unit names and hence
can handle weird characters nicely and will add unit suffixes as
necessary.
2012-10-16 02:59:27 +02:00
Thomas Bächler fd59a381e3 core/swap.c: Do not add Before=swap.target to swap units.
The fstab generator adds Before=swap.target by default, and when creating
a custom .swap unit, you can also add Before=swap.target to the unit.

However, it is impossible to not have this ordering dependency right now.
Virtually all existing setups likely use the fstab generator, so this
change is unlikely to break anything.
2012-10-16 02:20:55 +02:00
Thomas Bächler 6bae23a038 core: Refuse to run a user instance when the system hasn't been booted with systemd.
Running as a user instance won't work at all if systemd isn't running as system
manager, so refuse to start in that case.
2012-10-16 02:17:46 +02:00
Daniel J Walsh 080ffcb4a1 selinux: selabel_lookup_raw can return ENOENT and be a non failure mode. 2012-10-16 01:58:42 +02:00
Daniel J Walsh a33c48d83c SELinux patch still broken, in that we are not checking the correct source context.
This patch does the dbus calls correctly.
2012-10-16 01:57:16 +02:00
Mantas Mikulėnas 2abba39d75 core: allow Type=oneshot services to have ExecReload
Use cases:

 * iptables.service – atomically reload rules without having to flush
   them beforehand (which may leave the system insecure if reload fails)

 * rpc-nfsd.service – reexport filesystems after /etc/exports update
   without completely stopping and restarting nfsd

(In both cases, the actual service is provided by a kernel module and
does not have any associated user-space processes, thus Type=oneshot.)
2012-10-16 01:36:18 +02:00
Michael Olbrich 9388e99e20 build-sys: check for name_to_handle_at declaration instead of its definition
AC_CHECK_FUNCS may be successful, even though name_to_handle_at and
'struct file_handle'  are not available.
2012-10-16 01:30:29 +02:00
Lennart Poettering 9048b11f8b journalctl: harmonise in-stream comments
From now on, always use ANSI-SQL-style comments in log streams, i.e.
prefix with --. We also suffix things with this, just to be nice...
2012-10-16 01:09:09 +02:00
Lennart Poettering b1c806231b util: properly handle -1 timespec/timeval 2012-10-16 01:04:32 +02:00
Zbigniew Jędrzejewski-Szmek edfb521a21 journalctl: skip informational messages in export/json modes 2012-10-15 18:17:49 +02:00
Lukas Nykryn 44386fc156 systemctl: don't mangle name when it is a path
systemctl enable, disable, ... can also accept full path and in this case
we don't need to alter it.

https://bugzilla.redhat.com/show_bug.cgi?id=866346
2012-10-15 16:34:23 +02:00
Zbigniew Jędrzejewski-Szmek c3eba2ab4e journalctl: make --follow really work 2012-10-14 15:29:38 +00:00
Zbigniew Jędrzejewski-Szmek e3ed66c52e journalctl: make --follow work again
Stopped working after cfbc22ab 'journalctl: implement --since= and
--until for filtering by time'.
2012-10-13 21:37:42 +02:00
Zbigniew Jędrzejewski-Szmek 0ab5c3ed87 journal-verify: get rid of an unused variable
When compiling without gcrypt, gcc emits an annoying warning.
2012-10-13 21:37:11 +02:00
Zbigniew Jędrzejewski-Szmek b1bafc00d5 journald: add missing include
./src/journal/journald.h:123:114: warning: ‘struct ucred’ declared inside parameter list [enabled by default]
2012-10-13 16:09:09 +00:00
Zbigniew Jędrzejewski-Szmek 6374a73b00 journal-gatewayd: rename variables to avoid -Wshadow warning 2012-10-13 14:54:56 +02:00
Zbigniew Jędrzejewski-Szmek e88baee88f journald: properly update message size after stripping the identifier
Valgrind says:
==29176== Conditional jump or move depends on uninitialised value(s)
==29176==    at 0x412A85: cunescape_length_with_prefix (util.c:1565)
==29176==    by 0x40B351: dev_kmsg_record (journald-kmsg.c:301)
==29176==    by 0x40B653: server_read_dev_kmsg (journald-kmsg.c:347)
==29176==    by 0x40B701: server_flush_dev_kmsg (journald-kmsg.c:365)
==29176==    by 0x409DE7: main (journald.c:1535)
2012-10-13 14:40:32 +02:00
Zbigniew Jędrzejewski-Szmek 1b4bb4fdac journal: fix build in VALGRIND compatibility mode 2012-10-13 14:40:32 +02:00
Zbigniew Jędrzejewski-Szmek 1ca6783f5e log: introduce a macro to format message id
The MESSAGE_ID=... stanza will appear in countless number of places.
It is just too long to write it out in full each time.

Incidentally, this also fixes a typo of MESSSAGE is three places.
2012-10-13 14:26:30 +02:00
Sebastian Ott 4ecc131848 udev: path_id - add scm support
Add support for scm block devices. Introduced here:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=f30664e2

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
2012-10-11 22:26:54 +02:00
Lennart Poettering cfbc22abd0 journalctl: implement --since= and --until for filtering by time 2012-10-11 16:43:37 +02:00
Lennart Poettering 48383c2511 journal: support epxorting the journal in a format suitable for text/event-stream 2012-10-11 02:37:10 +02:00
Lennart Poettering 33316dbf20 journal: take scroll events in the entire white box in browse.html 2012-10-11 01:57:36 +02:00
Lennart Poettering 33162605bb journal: make buttons bigger in browse.html 2012-10-11 01:52:35 +02:00
Lennart Poettering 04909b0f2c journal: use localstorage instead of cookies in browse.html and store where the current position 2012-10-11 00:38:20 +02:00
Lennart Poettering 74bee4e336 journal: move buttons to the center in browse.html 2012-10-11 00:04:54 +02:00
Kay Sievers 19f8efacc5 journal: add mousewheel scrolling to browse.html 2012-10-10 23:59:29 +02:00
Lennart Poettering 6d5f2f5803 journal: add keyboard navigation to browse.html 2012-10-10 23:49:21 +02:00
Lennart Poettering 6c69cd8626 journal: properly HTML escape more output in browse.html 2012-10-10 23:14:32 +02:00
Mantas Mikulėnas 522795e077 journal: properly escape HTML entities in browse.html 2012-10-10 23:00:59 +02:00
Lennart Poettering c6511e859c journal: when browsing the journal via browse.html allow clicking on entries to show their details 2012-10-10 22:41:03 +02:00
Lennart Poettering 934a316cbf journal: drop path name from cursor strings
we had this mostly for debugging purposes and it was ignored when
parsing anyway, so let's get rid of it
2012-10-10 22:41:02 +02:00
Martin Pitt b1f87c76b1 keymap: Fix scan codes > 0x7FFFFFFF
According to Linux drivers/input/evdev.c, scan codes are unsigned, not int nor
uint32_t.

Thanks to Dejan Tosovic <dejan@post.com> for reporting this!
2012-10-10 18:56:01 +02:00
Lennart Poettering 1dac8b797c gatewayd: beef up browse.html a bit 2012-10-10 02:41:27 +02:00
Lennart Poettering 77ad3b93de journal: fix seeking backwards in gateway daemon 2012-10-10 01:57:06 +02:00
Lennart Poettering a3eb665e0c journal: update comments a bit 2012-10-10 01:37:38 +02:00
Lennart Poettering ad9eafab9f journalctl: properly parse --cursor= long getopt in addition to short -c 2012-10-10 01:35:24 +02:00
Lennart Poettering a87247dd5d journal: make sure sd_journal_seek_cursor() seeks to the specified entry if it exists, not one after it 2012-10-10 01:34:27 +02:00
Lennart Poettering 96ede2601f detect-virt: install with fs caps by default to allow unprivileged access 2012-10-09 22:25:32 +02:00
Lennart Poettering 7a69007a24 journal: implement follow mode for HTTP GET in gatewayd 2012-10-09 01:31:27 +02:00
Lennart Poettering 98206c9319 journal: add matching support to gatewayd 2012-10-09 01:17:29 +02:00
Lennart Poettering 083f4da2a8 logind: expose missing signals in Session bus objects 2012-10-09 00:49:53 +02:00
Kay Sievers 07845c142b udev: support multiple entries for ENV{SYSTEMD_ALIAS} and ENV{SYSTEM_WANTS} 2012-10-09 00:16:50 +02:00
Kay Sievers 8a1733871f udev: remove SYMLINK "unique" option 2012-10-08 21:54:39 +02:00
Kay Sievers 04eaa66837 udev: fix test 2012-10-08 20:52:57 +02:00
Martin Mikkelsen 011afa76fb shared: fix broken string_is_safe 2012-10-08 14:35:46 +02:00
Lukas Nykryn b3c2cf3d8e dbus-manager: check return of unit_dbus_path
Reply of dbus_message_new_method_return was check twice and
path from unit_dbus_path was not.
2012-10-08 14:35:46 +02:00
Kay Sievers ea6039a309 udev: allow firmware requests to bypass the dependency tracking
The removal of the TIMEOUT= handling in udevd put firmware requests into the
devpath parent/child dependency tracking. Drivers which block in module_init()
asking userspace for firmware ran into a 30 sec device timeout.

The whole firmware loading willl hopefully move into the kernel and
the fragile-since-day-one fake async driver-core device dance involving
udev can be retired:
  http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=abb139e75c2cdbb955e840d6331cb5863e409d0e
2012-10-07 18:22:14 +02:00
Dave Reisner 1a3f40f912 sysctl: avoiding exiting with error on -EEXIST
If the final key in any sysctl.d file is a duplicate, systemd-sysctl
will exit with an error (and no explaination why). Ignore this, as
duplicate keys are to be expected when overriding settings in the
directory hierarchy.
2012-10-06 16:41:30 -04:00
Lennart Poettering dfae3488f7 dbus: expose Virtualization ID on PID1's bus interface
This allows unprivileged clients to check for the used virtualization
even when lacking the privileges that some of the virtualization tests
require.

https://bugzilla.gnome.org/show_bug.cgi?id=684801
2012-10-04 14:09:25 -04:00
Zbigniew Jędrzejewski-Szmek 57f7ae4f68 systemctl: colorize number of units listed 2012-10-04 11:12:23 +00:00