Commit Graph

3528 Commits

Author SHA1 Message Date
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
Zbigniew Jędrzejewski-Szmek ad94ad63e3 systemctl: do not print header if no units listed 2012-10-04 11:01:10 +00:00
Сковорода Никита Андреевич 2f1bb51336 man: handle-sleep-key is invalid, replace it with handle-suspend-key and handle-hibernate-key in systemd-inhibit help and man. 2012-10-03 19:15:02 -04:00
Lennart Poettering 5198dabcce man: document behaviour of ListenStream= with only a port number in regards to IPv4/IPv6 2012-10-03 14:18:55 -04:00
Lennart Poettering 0b507b17a7 dbus: add some more safety checks before accepting data from bus clients 2012-10-03 13:29:20 -04:00
Lennart Poettering 07c289875f journal-send: simplification 2012-10-03 11:55:38 -04:00
Lennart Poettering 1dfa7e79a6 journald: only accept fds from certain directories 2012-10-03 11:55:38 -04:00
Lennart Poettering a9e51d5752 selinux: properly free dbus error 2012-10-03 11:55:38 -04:00
Colin Walters 0b6018f3d9 build-sys: fix !HAVE_SELINUX case 2012-10-03 16:00:33 +02:00
Tom Gundersen 8d789b905d vconsole: default to the kernel compiled-in keymap
No longer override the default kernel keymap if nothing is specified in
    vconsole.conf.

    The default should be to do nothing (i.e., use what is already in the
    kernel) unless the distro/admin has explicitly requested it.
2012-10-03 15:57:40 +02:00
Tom Gundersen f51356b462 vconsole: default to the kernel compiled-in font
No longer override the default kernel font if nothing is specified in
vconsole.conf.

The default kernel font[0] provides ISO-8859-1 and box characters. Users
of Arabic, Cyrilic or Hebrew must set a different font manually as these
character sets were provided by the old default font [1], but are not
any longer.

Rationale:

 * it is counter-intuitive that an empty vconsole.conf file is different
   from adding FONT="";
 * the version of the default font shipped with Arch (which is the
   upstream one) behaves very badly during early boot[2] (which should
   admittedly be fixed in the font itself);
 * the kernel already supplies a default font, it seems reasonable to
   use that unless anything else is specified;
 * This also avoids a needless slow call to setfont; and
 * We don't want to work around problems in the kernel (in case the
   compiled-in font is not acceptable for whatever reason).

[0]: <https://dev.archlinux.org/~tomegun/kernel.bdf>
[1]: <https://dev.archlinux.org/~tomegun/latarcyrheb.bdf>
[2]: <http://i.imgur.com/J2tM4.jpg>
2012-10-03 15:42:19 +02:00
Lennart Poettering ffc227c956 selinux: remove anything PID1-specific from selinux-access.[ch] so that we can reuse it in logind 2012-10-02 17:56:54 -04:00
Lennart Poettering c1165f822c audit: turn the audit fd into a static variable
As audit is pretty much just a special kind of logging we should treat
it similar, and manage the audit fd in a static variable.

This simplifies the audit fd sharing with the SELinux access checking
code quite a bit.
2012-10-02 17:40:09 -04:00
Lennart Poettering cad45ba11e selinux: rework selinux access check logic
a) Instead of parsing the bus messages inside of selinux-access.c
simply pass everything pre-parsed in the functions

b) implement the access checking with a macro that resolves to nothing
on non-selinux builds

c) split out the selinux checks into their own sources
selinux-util.[ch]

d) this unifies the job creation code behind the D-Bus calls
Manager.StartUnit() and Unit.Start().
2012-10-02 17:07:00 -04:00
Lukas Nykryn fadd79d2d8 journald: assert target instead of page
page is a local, yet unitialized, variable.
2012-10-02 14:56:39 +02:00
Zbigniew Jędrzejewski-Szmek 5b585b5380 shared: fail mkdir_p if the target exists and is not a directory
This makes mkdir_p actually behave like mkdir -p.
2012-10-02 14:56:26 +02:00
Zbigniew Jędrzejewski-Szmek 27407a01c6 nspawn: use automatic cleanup and provide debug info
The documentation for --link-journal is also reworded.
2012-10-02 14:56:26 +02:00
Zbigniew Jędrzejewski-Szmek b2e6df73aa trivial: fix typo 2012-10-02 14:56:18 +02:00
Lennart Poettering a8573ccc35 pam: check environ[] for XDG_SEAT as fallback
This is useful for systems such as kmscon which want to invoke classic
/sbin/login but use it on multiple seats.
2012-10-01 14:50:05 -04:00
Daniel J Walsh d67227c8b9 selinux: fix various problems 2012-09-28 16:59:28 +02:00
Lennart Poettering 760c85c0bd journald: rework auto-rotation logic 2012-09-28 15:42:34 +02:00
Lennart Poettering 80d1c5988b journald: close sd_journal context after flushing to /var 2012-09-28 15:41:20 +02:00
Dave Reisner 1845fdd967 tmpfiles: restore previous behavior for F/f
d4e9eb91ea changed the behavior for the F and f actions, wrongly sending
them to glob_item(). Restore the old behavior and shortcut straight to
write_one_file().
2012-09-27 20:53:05 -04:00
Lennart Poettering bf5542f891 journal: add missing browse.html file 2012-09-28 00:59:10 +02:00
Lennart Poettering 7b17a7d72f journal: add minimal journal gateway daemon based on GNU libmicrohttpd
This minimal HTTP server can serve journal data via HTTP. Its primary
purpose is synchronization of journal data across the network. It serves
journal data in three formats:

       text/plain: the text format known from /var/log/messages
       application/json: the journal entries formatted as JSON
       application/vnd.fdo.journal: the binary export format of the journal

The HTTP server also serves a small HTML5 app that makes use of the JSON
serialization to present the journal data to the user.

Examples:

This downloads the journal in text format:

 # systemctl start systemd-journal-gatewayd.service
 # wget http://localhost:19531/entries

Same for JSON:

 # curl -H"Accept: application/json" http://localhost:19531/entries

Access via web browser:

 $ firefox http://localhost:19531/
2012-09-28 00:55:24 +02:00
Lennart Poettering be3ea5eaf2 sd-journal: properly parse cursor strings 2012-09-28 00:55:24 +02:00
Lennart Poettering 08ace05beb logs-show: various cleanups
Among other cleanups this introduces a threshold for the size of binary
blobs we serialize as integer arrays in the JSON output. THis can be
disabled via --all.
2012-09-28 00:55:24 +02:00
Lennart Poettering 8f14c8327b journalctl: add --cursor switch 2012-09-28 00:55:24 +02:00
Robert Milasan 2cf598fe02 udev: collect - use snprintf() 2012-09-27 15:51:58 +02:00
Lennart Poettering 31c460208d selinux: use standard D-Bus error id for access denied 2012-09-24 23:56:35 +02:00
Lennart Poettering cecd32f648 macro: increase VA_FORMAT_ADVANCE type array and hit assert when it is reached 2012-09-24 23:42:29 +02:00
Lennart Poettering 72f1d5a288 journal: also use new VA_FORMAT_ADVANCE() macro in sd_journal_send() 2012-09-24 23:42:03 +02:00
Lennart Poettering 963ddb917d log: fix repeated invocation of vsnprintf()/vaprintf() in log_struct()
https://bugs.freedesktop.org/show_bug.cgi?id=55213
2012-09-24 23:26:46 +02:00
Lennart Poettering 2a7b539a82 journald: always pass first entry timestamp back from journal_file_verify() 2012-09-24 15:02:43 +02:00
Mirco Tischler 73726ac898 journalctl: print correct timespan in verify
The old code used a timestamp to print a timespan for unsealed journalfiles,
incorrectly showing things like 2230 days of unsealed entries. Print the timespan
between the first and last entry instead.
2012-09-24 14:56:52 +02:00
Lennart Poettering 9086e840ff util: don't export parsed_columns 2012-09-24 14:43:07 +02:00
Mirco Tischler f1889c9119 journal: set seal even for readonly journalfiles
journalctl needs to know wether the file has been sealed to
be able to do verification.
2012-09-24 14:41:38 +02: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 dd144c63e2 mount: simplify device node conditions a bit 2012-09-24 12:48:46 +02:00
Lennart Poettering 63a8b2f947 mount: only run fsck for actual device nodes 2012-09-24 12:39:13 +02:00
Lennart Poettering a07fdfa376 main: don't try to mout cpuset with cpu+cpuacct anymore
Turns out cpuset needs explicit initialization before we could make use
of it. Thus mounting cpuset with cpu/cpuacct would make it impossible to
just create a group in "cpu" and start it.
2012-09-24 11:35:51 +02:00
Lennart Poettering 2a2507e60d journal: add missing test file 2012-09-24 10:18:10 +02:00
Lukas Nykryn 9c513fe009 udev: free fd before return in accelerometer.c 2012-09-23 14:24:44 +02:00
Lukas Nykryn ab261e1226 udev: free fd before return in scsi_serial.c 2012-09-23 14:24:43 +02:00
Václav Pavlín 0820a4f0f6 udev: free rule structure on error 2012-09-23 14:24:43 +02:00
Václav Pavlín cb32f0141e udev: check return value of write 2012-09-23 14:24:43 +02:00
Václav Pavlín 6bb2f0a08a udev: check return value of symlink 2012-09-23 14:24:43 +02:00
Václav Pavlín 029f4f21fc libudev: check return value of rename 2012-09-23 14:24:43 +02:00
Václav Pavlín 8dc8ef598d udev: check malloc return in collect/collect.c
Returns from no memory checks updated with log_oom call
2012-09-23 14:24:43 +02:00
Lennart Poettering e2c8b07dcb journal: bring mmap cache prototype in sync 2012-09-22 00:16:13 +02:00
Lennart Poettering e18021f7da journal: always keep marked mmap windows around 2012-09-21 23:37:06 +02:00
Eelco Dolstra 848af05524 missing: Fix compilation error due to wrong __NR_name_to_handle_at definition
"__NR_name_to_handle" should read "__NR_name_to_handle_at".  This
fixes a compilation error on systems with older kernel headers.
2012-09-21 22:51:48 +02:00
Lennart Poettering c2893c4b34 journald: log how big the journal files may grow 2012-09-21 22:50:26 +02:00
Lennart Poettering 1705594f59 journalctl: make the argument to -n optional 2012-09-21 22:33:02 +02:00
Lennart Poettering f801968466 journal: completely rework the mmap cache as I too dumb to actually understand it
Instead of doing hand optimized fd bisect arrays just use plain old
hashmaps. Now I can understand my own code again. Yay!

As a side effect this should fix some bad memory accesses caused by
accesses after mmap(), introduced in 189.
2012-09-21 20:52:23 +02:00
Lennart Poettering aaeef05886 multi-seat-x: drop a lot of unnecessary code 2012-09-21 17:03:40 +02:00
Lennart Poettering 0187f62bb5 sysctl: always return the last error we encountered 2012-09-21 17:03:40 +02:00
Lennart Poettering 77e63fafa5 nspawn: document why we don't check resolv.conf mount errors 2012-09-21 16:55:56 +02:00
Lennart Poettering d40361453b nspawn: we can't overmount /etc/localtime anymore since it's usually a symlink now
Create the right symlink if possible for /etc/localtime
2012-09-21 16:54:54 +02:00
Lennart Poettering 4eeebf70aa hwclock: add missing OOM check 2012-09-21 16:29:09 +02:00
Lennart Poettering 8e7705e52a pam: document that we don't do error checking when parsing vtnr 2012-09-21 16:17:26 +02:00
Lennart Poettering 0559d3a58a journal: don't allow journal_file_open() to be called with ret being NULL 2012-09-21 16:16:39 +02:00
Lukas Nykryn 5d5e98eb8c login: missing break for getopt ARG_NO_ASK_PASSWORD in loginctl 2012-09-21 16:12:55 +02:00
Lukas Nykryn 089d4a08d0 sysctl: fix error code handling
After  if (r <= 0) r can't  be 0 so
if (k < 0 && r == 0) never happens.
2012-09-21 16:12:47 +02:00
Václav Pavlín d42c44fb6d modules-load: initalize files to null 2012-09-21 16:11:07 +02:00
Václav Pavlín f2cc3753ce locale: make sure that l is freed 2012-09-21 16:10:34 +02:00
Václav Pavlín ca4f2b6d6d login: check return value of session_get_idle_hint 2012-09-21 16:08:54 +02:00
Václav Pavlín 5a165aa6b9 logind: check return value, log warning on error 2012-09-21 16:04:48 +02:00
Václav Pavlín 2f29c419b0 cgtop: missing '-'
Return codes in systemd are negated and
if (r < 0)  if (r == ENOENT)
        was never true.
2012-09-21 16:04:25 +02:00
Dave Airlie e57d4fa35e multi-seat-x: drop framebuffer specific stuff, as we have a DRM driver now 2012-09-21 15:53:10 +02:00
Lennart Poettering ec29187225 Revert "multi-seat: drop multi-seat-x wrapper, as upstream X can handle multi-seat graphics on its own now"
This reverts commit 636d30a089.

Turns out we will need the multi-seat wrapper a bit longer, however
without the fb-specific bits in it.
2012-09-21 15:51:04 +02:00
Lennart Poettering 8e7fd6ade4 logind: split up HandleSleepKey= into HandleSuspendKey= and HandleHibernateKey=
The kernel and X11 distuingish these two, and Thinkpad keys have both,
hence we really should distinguish them too.
2012-09-21 15:44:14 +02:00
Lennart Poettering 636d30a089 multi-seat: drop multi-seat-x wrapper, as upstream X can handle multi-seat graphics on its own now 2012-09-21 12:46:22 +02:00
Lukas Nykryn 7f1736f736 core: call va_end in all cases 2012-09-21 12:08:26 +02:00
Lukas Nykryn e98055de98 shared: call va_end in all cases 2012-09-21 12:07:41 +02:00
Lennart Poettering 409133be63 logind: allow users to override their own suspend/sleep inhibitors 2012-09-21 11:57:48 +02:00
Lennart Poettering 462ff40e65 timedated: /etc/sysconfig/clock is dead on Fedora, remove it 2012-09-20 20:51:18 +02:00
Lennart Poettering a98d5d6472 fix typos 2012-09-20 19:12:23 +02: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 505b6a61c2 journald: don't accept arbitrarily sized journal data fields
https://bugzilla.redhat.com/show_bug.cgi?id=858746
2012-09-19 22:51:28 +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 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
Lennart Poettering 93e4c84bb3 path: support specifier resolvin in .path units 2012-09-19 20:09:59 +02:00
Kay Sievers cd8651982b libudev: remove dead code 2012-09-19 19:36:35 +02:00
Lennart Poettering c68df23956 timedated: unregister the right bus service
https://bugzilla.redhat.com/show_bug.cgi?id=858771
2012-09-19 19:09:22 +02:00
Lennart Poettering 65b5116220 logind: if a lid-switch lock was taken while the lid was closed, recheck lid status when the lock is released 2012-09-19 15:42:29 +02:00
Lennart Poettering f981b9c5be logind: properly parse handle-lid-switch inhibitor 2012-09-19 15:29:24 +02:00
Lennart Poettering 12a1309e11 man: document new inhibitor types 2012-09-19 15:28:55 +02:00
Lennart Poettering beaafb2ea6 logind: rework power key/suspend key/lid switch handling
http://lists.freedesktop.org/archives/systemd-devel/2012-September/006604.html
https://bugzilla.gnome.org/show_bug.cgi?id=680689

This changes the meaning of the
HandlePowerKey=/HandleSleepKey=/HandleLidSwitch= setting of logind.conf
2012-09-19 13:10:10 +02:00
Lennart Poettering 468b21de7c journal: when comparing two entries from separate files make sure we reposition the mmap window
The mmap cache doesn't guarantee that we can look at two files at the
same time. Hence make sure to look at the entries to compare one
after the other, instead of at the same time when comparing them, and
reposition the window in between.
2012-09-19 09:58:34 +02:00
Lennart Poettering a99124d92f mount: reword directory empty warning a bit 2012-09-19 09:58:34 +02:00
Zbigniew Jędrzejewski-Szmek 49111a708e systemctl: warn about triggering units only at the end
Instead of checking each unit separately, check once at the end. This
should avoid spurious warnings about a service being triggerable by
other stuff.
2012-09-19 08:27:34 +02:00
Zbigniew Jędrzejewski-Szmek d39b034af6 systemctl: properly report success
Systemctl would always return 1, because it treated uninteresting dbus
messages ("job added") as errors. Just ignore everything apart from
interesting ("job removed") messages.
2012-09-19 08:27:34 +02:00
Zbigniew Jędrzejewski-Szmek 46eddbb597 systemctl: use automatic cleanup once more
Semantics are slightly different, because before unit_name_mangle
returning NULL was ignored, and now it is reported as oom. But
unit_name_mangle only returns NULL on oom.
2012-09-19 08:25:51 +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 e872b43c7e automount: also whine if an automount directory is not empty 2012-09-18 18:59:01 +02:00
Lennart Poettering 257f1d8ec4 mount: notify the user if we over-mount a non-empty directory
https://bugzilla.redhat.com/show_bug.cgi?id=858266
2012-09-18 18:52:33 +02:00
Lennart Poettering c481f78be7 mount: don't mount securityfs in a container 2012-09-18 12:13:02 +02:00
Lennart Poettering 6569cae18e unit-printf: add specifiers for the host name, machine id, boot id 2012-09-18 11:53:47 +02:00
Lennart Poettering 3ef63c3174 unit-printf: before resolving exec context specifiers check whether the object actually has an exec context 2012-09-18 11:40:01 +02:00
Lennart Poettering 41f9172f42 unit: split unit_printf() and friends into its own .c file 2012-09-18 11:27:56 +02:00
Lennart Poettering 9900625116 unit: fix %f resolving 2012-09-18 11:18:37 +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 1850161f29 target: imply default ordering for PartsOf deps as well 2012-09-18 11:01:34 +02:00
Lennart Poettering b7848021c3 execute: apply PAM logic only to main process if PermissionsStartOnly is set
https://bugs.freedesktop.org/show_bug.cgi?id=54176
2012-09-18 10:54:23 +02:00
Lennart Poettering 5f29d24dec selinux: rework method tail, make it into a nulstr array 2012-09-18 02:19:54 +02:00
Lennart Poettering c309067483 selinux: use existing library calls for audit data 2012-09-18 01:55:49 +02:00
Lennart Poettering aba15a0391 selinux: prefer source path over fragment path 2012-09-18 01:55:24 +02:00
Lennart Poettering 901c3d0d85 util: introduce get_process_gid() 2012-09-18 01:53:15 +02:00
Daniel J Walsh e2417e4143 selinux: add bus service access control
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This patch adds the ability to look at the calling process that is trying to
do dbus calls into systemd, then it checks with the SELinux policy to see if
the calling process is allowed to do the activity.

The basic idea is we want to allow NetworkManager_t to be able to start and
stop ntpd.service, but not necessarly mysqld.service.

Similarly we want to allow a root admin webadm_t that can only manage the
apache environment.  systemctl enable httpd.service, systemctl disable
iptables.service bad.

To make this code cleaner, we really need to refactor the dbus-manager.c code.
 This has just become a huge if-then-else blob, which makes doing the correct
check difficult.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBJBi8ACgkQrlYvE4MpobOzTwCdEUikbvRWUCwOb83KlVF0Nuy5
lRAAnjZZNuc19Z+aNxm3k3nwD4p/JYco
=yops
-----END PGP SIGNATURE-----
2012-09-18 01:21:17 +02:00
Lennart Poettering b14eda963c logind: split up inhibit acquire policy 2012-09-18 01:16:23 +02:00
Lennart Poettering 178cc7700c journald: log when we fail to forward messages to syslog
https://bugzilla.redhat.com/show_bug.cgi?id=847207
2012-09-17 23:59:26 +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 d4d882e5ce logind: make VT reservation logic compatible with containers 2012-09-17 19:11:48 +02:00
Lennart Poettering c999977392 main: newer kernels return EINVAL if we invoke reboot() in a container lacking perms, deal with it 2012-09-17 19:05:33 +02:00
Lennart Poettering 669bec5d17 util: various cleanups for printing boot status 2012-09-17 19:05:32 +02:00
Lennart Poettering 19876c9b3d utmp: read the right timestamp 2012-09-17 17:48:19 +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
Lennart Poettering 4096d6f587 main: bump up RLIMIT_NOFILE for systemd itself
For setups with many listening sockets the default kernel resource limit
of 1024 fds is not enough. Bump this up to 64K to avoid any limitations
in this regard. We are careful to pass on the kernel default to daemons
however, since normally resource limits are a good to enforce,
especially since select() can't handle fds > 1023.
2012-09-17 16:35:59 +02:00
Lennart Poettering b58b344afd journald: properly update perms on freshly rotate user journals 2012-09-17 15:53:42 +02:00
Lennart Poettering bfba3256a0 service: don't hit an assert if a service unit changes type and we get a spurious event from before 2012-09-17 14:56:44 +02:00
Kay Sievers 0bb91b5010 udev: add btrfs support
All "btrfs" file systems will be registered with the kernel when they
show up.

Incomplete multi-device volumes will set SYSTEMD_READY=0, to prevent
access until the volume is complete and fully registered.
2012-09-17 13:54:03 +02:00
Lennart Poettering 98a77df5fe logind: make sure there's always a getty available on TTY6
Previously, if X allocated all 6 TTYs (for multi-session for example) no
getty would be available anymore to guarantee console-based logins.

With the new ReserveVT= switch in logind.conf we can now choose one VT
(6 by default) that will always be subject to autovt-style activation,
i.e. we'll always have a getty on TTY6, and X will never take possession
of it.
2012-09-17 12:39:16 +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
Dave Reisner 54693d9bfa tmpfiles: use write(2) for the 'w' action
This resolves problems with filesystems which do not implement the
aio_write file operation. In this case, the kernel will fall back using
a loop writing technique for each pointer in a received iovec. The
result is strange errors in dmesg such as:

[   31.855871] elevator: type  not found
[   31.856262] elevator: switch to
[   31.856262]  failed

It does not make sense to implement a synchronous aio_write method for
sysfs as this isn't a real filesystem where a reasonable use case for
using writev exists, nor is there an expectation that tmpfiles will be
used to write more data than can be reasonably written in a single write
syscall.

In addition, some sysfs attrs are currently buggy and will NOT reject
the second write with the newline, causing the sysfs value to be zeroed
out. This of course should be fixed in the kernel regardless of any
wrongdoing in userspace, but this simple change makes us immune to such
a bug.

This change means that we do not write a trailing newline by default, as
the expected use case of 'w' is for sysfs and procfs. In exchange, honor
C-style backslash escapes so that if the newline is really needed, the
user can add it.
2012-09-16 17:18:04 +02:00
Dave Reisner c65a0b1466 socket: prevent signed integer overflow
src/core/socket.c:588:25: error: overflow in implicit constant conversion
src/core/socket.c:589:17: error: overflow in implicit constant conversion
2012-09-16 16:55:46 +02:00
Zbigniew Jędrzejewski-Szmek 89154bd4ac nspawn: fix memleak introduced with automatic cleanup
6b2d0e8 introduced a memleak instead of fixing one.
Fix both.
2012-09-16 16:33:20 +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 ed8b7a3ee5 nspawn: _cleanup_free_ more 2012-09-16 16:20:09 +02:00
Zbigniew Jędrzejewski-Szmek 6b2d0e85dc nspawn: use automatic cleanup
This one actually clears up a (totally harmless) memleak.
2012-09-16 16:20:09 +02:00
Zbigniew Jędrzejewski-Szmek ede89845a4 nspawn: mount tmpfs on /dev/shm
Most things seem to function fine without /dev/shm, but it is expected
to be there (quoting linux/Documentation/filesystems/tmpfs.txt:
glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for POSIX
shared memory (shm_open, shm_unlink)).

Since /tmp/ is already mounted as tmpfs, it would be enough to mkdir
/tmp/shm and chmod it. Mounting it separately has the advantage that
it can be easily remounted to change the quota.
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
Zbigniew Jędrzejewski-Szmek 4a271908f1 logind: redefine idleness to start at last activity
Before, after the timeout, a session would be timestamped as idle
since 'last activity' + 'idle timeout'. Now, it is timestamped as idle
since 'last activity'.

Before, after all sessions were idle, the seat would be marked with as
idle with the timestamp of the oldest idle session. Now it is
marked with the timestamp of the youngest idle session.

Both changes seem to me to be closer to natural understanding of
idleness: the time since last activity counts.
2012-09-16 11:34:53 +02:00
Lennart Poettering e19a21a879 timedated: make /etc/timezone a Debian-only thing 2012-09-14 20:20:29 +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
Shawn Landden 92c4ef2d35 timedated: gather timezone from /etc/localtime sym target
/etc/localtime -> /usr/share/zoneinfo/...

or

/etc/localtime -> ../usr/share/zoneinfo/...

(note, ../usr is not the same if /etc is a symlink, as this isn't
using canonicalize_file_name())

keep other method for now, consider dropping later.

Supporting relative links here are problematic as timezones in
/usr/share/zoneinfo are often themselves symlinks (and symlinks to
symlinks), so this implamentation only supports absolute symlinks
"/usr/share/zoneinfo/" and relative symlinks starting with
"../usr/share/zoneinfo/"

>From TODO (kay sievers):
* kill /etc/timezone handling entirely? What does it provide?
  - /etc/localtime carries the same information already:
      $ ls -l /etc/localtime; cat /etc/timezone
      lrwxrwxrwx 1 root root 33 Jul 27 09:55 /etc/localtime -> /usr/share/zoneinfo/Europe/Berlin
      Europe/Berlin
  - systemd enforces /usr to be available at bootup, so we can
    enforce the use of the symlink
2012-09-14 19:27:44 +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 a33fdebb30 systemctl: minor coding style fixes 2012-09-13 22:42:22 +02:00
Václav Pavlín 37370d0cbe install: append .service when enable/disable... is called
https://bugzilla.redhat.com/show_bug.cgi?id=856975
2012-09-13 22:35:18 +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 a1d41e17a5 rpm: expose preset dir as rpm macro and in systemd.pc 2012-09-13 22:17:46 +02:00
Auke Kok 095b2d7ab9 load-fragment: Expand specifiers in conditions.
Add specifier expansion to Path and String conditions.

Specifier expansion for conditions will help create instance
and user session units by allowing us to template conditions
based on the instance or user session parameters.

An example would be a system-wide user session service file
that conditionally runs based on whether a user has the
service configured through a configuration file in ~/.config/.
2012-09-13 21:54:34 +02:00
Eelco Dolstra 0675cc4a02 daemon: Fix broken links to sd-daemon.c 2012-09-13 20:08:54 +02:00
Thomas Hindoe Paaboel Andersen c53158818d man: fix a bunch of typos in docs
https://bugs.freedesktop.org/show_bug.cgi?id=54501
2012-09-13 19:34:24 +02:00
Lennart Poettering ff89a42a86 python: make gcc shut up 2012-09-13 19:34:09 +02:00
Lennart Poettering 7ceba24134 manager: fix the build 2012-09-13 19:29:46 +02:00
Lennart Poettering 915b375388 manager: extend performance measurement interface to include firmware/loader times
This only adds the fields to the D-Bus interfaces but doesn't fill them
in with anything useful yet. Gummiboot exposes the necessary bits of
information to use however and as soon as I get my fingers on a proper
UEFI laptop I'll hook up the remaining bits.

Since we want to stabilize the D-Bus interface soon and include it in
the stability promise we should get the last fixes in, hence this change
now.
2012-09-13 18:54:32 +02:00
Lennart Poettering e50d504865 journal: fix 128bit IDs of unit reload entries 2012-09-13 18:22:17 +02:00
Colin Walters 55f2dca329 update-utmp: Don't error out on runlevel updates if utmp doesn't exist
Other parts of the code handle utmp not existing, so let's be
consistent.  At the moment my GNOME-OSTree builds don't have utmp.
2012-09-13 17:17:32 +02:00
Lennart Poettering b588975fb0 journal: never assert directly on data read from the journal 2012-09-13 17:10:46 +02:00
Lennart Poettering 5996c7c295 journald: don't reposition window if we don't have to 2012-09-13 17:06:04 +02:00
Lennart Poettering c4164442de python: fix error handling, and allocate argument array on the stack 2012-09-13 04:25:59 +02:00
Lennart Poettering 0aee68ad02 python: reindent to follow coding style 2012-09-13 04:16:10 +02:00
Lennart Poettering 6b91ae13f2 python: change license to LGPL 2.1
The original license has been MIT for this code, but David Strauss (its
original author) agreed to relicense it to LGPL 2.1 for inclusion in
systemd.
2012-09-13 04:06:11 +02:00
Lennart Poettering 8d7e170a52 python: integrate David Strauss' python-systemd package 2012-09-13 04:01:18 +02:00
Dave Reisner 3612fbc1e4 tmpfiles: plug file descriptor leak.
Introduced in d4e9eb91.
2012-09-13 00:10:35 +02:00
Lennart Poettering a8b10efaec readahead: use 20K instead of 16K as temporary request nr bump 2012-09-13 00:10:35 +02:00
Lennart Poettering cf5a343211 journalctl: print QR code only if we are running on an UTF-8 system 2012-09-12 09:23:38 +02:00
Lennart Poettering bb3241614a systemctl: direct the user to list-unit-files from the list-units output 2012-09-12 08:56:57 +02:00
Dave Reisner d4e9eb91ea tmpfiles: support globbing for w option
Break out the write logic into a separate function and simply use it as
a callback to glob_item.

This allows users to consolidate writes to sysfs with multiple similar
pathnames, e.g.

  w /sys/class/block/sd[a-z]/queue/read_ahead_kb - - - - 1024
2012-09-12 08:46:03 +02:00
Lennart Poettering 1b2ac6b311 test: extend unit-name test a bit 2012-09-12 08:31:08 +02:00
Lennart Poettering d18dff430b login: reshuffle meaning of require_active parameter 2012-09-12 08:30:35 +02:00
Colin Guthrie 78ab361c8f logind: Avoid unnecesary rewrite of user file when switching sessions of the same user. 2012-09-12 08:20:01 +02:00
Colin Guthrie 23bd3b6263 logind: Ensure the user, seat and session files are updated when the session is closing. 2012-09-12 08:19:59 +02:00
Colin Guthrie 2dc8f41a2b logind: Add a two new variables to the user session tracking file.
This counts 'online sessions' in addition to 'active sessions' and 'sessions'.

In this context, an 'online session' covers all session in the 'active' state
in addition to the explicit 'online' state.

This provides an easy machanism to determin all relevant sessions easily
(i.e. those that are not 'closing') and adds new semantics to the sd-login.c
APIs sd_uid_get_sessions() and sd_uid_get_seats() where the require_active
argument can be supplied as a value 2 which only lists sessions which are
'online'.

This functionality should allow client applications to avoid deadlocks where
they only exit when all sessions are complete, such as a the problem where
PulseAudio will not exit until all sessions are gone, but in itself prevents
the session from exiting.
2012-09-12 08:19:54 +02:00
Colin Guthrie 47acb2f15f logind: Properly list the ACTIVE_SEATS in the user session tracking file.
Prevsiouly the first active seat for a user would never be listed and
any subsequent seats would be concatenated on without any spaces.
2012-09-12 08:19:43 +02:00
Colin Guthrie c9caad8021 logind: If all user sessions are in closing state, set the overall status to closing.
PulseAudio for example will keep a client connection open provided
at least one session exists. However, if all sessions are currently
in the process of closing, we should flag that as the overall state
appropriately to better reflect what is happening.

Although this does better reflect the status for any given user, it does
not actually solve the overall problem of PulseAudio still finding some
sessions active and thus not exiting and therefore actually preventing
the session from closing. Future commits will extend sd-login to cope
with this situation.
2012-09-12 08:19:40 +02:00
Colin Guthrie f904bdf2e9 pam: Add session class to the debug log. 2012-09-12 08:19:23 +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
Lennart Poettering 49a32d43de journal: don't set seal flag if we don't have gcrypt built-in 2012-09-11 03:03:36 +02:00
Michael Olbrich 48b617399d journal: don't try to compress without XZ
otherwise the header contains the HEADER_INCOMPATIBLE_COMPRESSED
flag even though the data is not compressed and reading the journal
fails.
2012-09-11 03:01:14 +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 742a862bb8 condition: add ConditionFileNotEmpty=
https://bugs.freedesktop.org/show_bug.cgi?id=54448
2012-09-11 01:29:46 +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 c17a8454f7 journald: don't do debug logging by default 2012-09-10 13:18:39 +02:00
Lennart Poettering 272410e179 journald: don't complain if fss key does not exist 2012-09-10 13:18:22 +02:00
Lennart Poettering 2f6f1bc30c selinux: close stdin/stdout/stderr before loading selinux policy
Let's make sure libselinux doesn't spew to stderr
2012-09-10 13:14:56 +02:00
Lennart Poettering 7762e02b17 journald: detect invalid header pointers correctly 2012-09-10 11:58:00 +02:00
Lennart Poettering 9d576438a1 unit: don't allow units to be gc'ed that still are referenced via UnitRef 2012-09-10 10:12:10 +02:00
Lennart Poettering 77030bd65f inhibit: close all fds when invoking inhibited tool 2012-09-10 09:45:55 +02:00
Lennart Poettering 3137e0bd52 dbus: minor coding style fixes 2012-09-10 09:38:49 +02:00
Matthias Clasen 680258b112 Make systemd-inhibit --list work
The code in the print_inhibitors function had an unintended
unconditional early exit, causing it to never print any
inhibitors.
2012-09-10 09:32:50 +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 182b858fc2 journald: make splitting up of journal files per-user configurable 2012-09-07 23:40:00 +02:00
Lennart Poettering a1a03e3075 journal: add call to determine current journal file disk usage 2012-09-07 23:20:28 +02:00
Lennart Poettering ac59a798f2 main: fix syntax of net_prio cgroup controller 2012-09-07 22:22:15 +02:00
Lennart Poettering 2b43f939a4 journald: avoid logging to kmsg in the normal paths 2012-09-06 00:32:51 -07:00
Lennart Poettering f687b27382 localed: system-setup-keyboard is no more on fedora 2012-09-05 23:54:09 -07:00
Lennart Poettering cb7ed9dfca tmpfiles: don't attempt creation of device nodes when we run in a container 2012-09-05 23:42:05 -07:00
Lennart Poettering dcc9ba80e1 systemctl: properly build flags for show_journal_by_unit() 2012-09-05 17:05:04 -07:00
Lennart Poettering cd931c0a46 journalctl: show "Reboot" markers in output only when showing local-only entries 2012-09-05 16:52:46 -07:00
Lennart Poettering 9e8a535faa journalctl: replace --local by --merge, i.e. don't interleave remote journals by default 2012-09-05 16:49:00 -07:00
Lennart Poettering d87be9b0af nspawn: handle poweroff/reboot nicely in containers 2012-09-05 16:23:41 -07:00
Lennart Poettering cb7ec5645e shutdown: in containers, invoke reboot(2), too. Then fallback to exit() if CAP_SYS_BOOT is missing
The kernel's PID namespaces support reboot(2) just fine, so let's make
use of it if possible.
2012-09-05 15:55:40 -07:00
Lennart Poettering 57371e5829 shutdown: remove explicit sync() invocations
The kernel implicitly does sync() anyway, hence there is no need to do
that in userspace explicitly. This makes the "-n" switch to halt(8) a
noop.
2012-09-05 15:32:57 -07:00
Lennart Poettering 3eabccc46c nspawn: don't provide /dev/rtc0 in the container
Since RTCs are hardware devices and are very much shared resources we
should avoid to provide them in each container.
2012-09-05 15:27:07 -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 04bc4a3f47 nspawn: generate a new randomized boot ID for each container 2012-09-05 14:39:16 -07:00
Lennart Poettering 9c1c7f712d nspawn: if a file system comes pre-mounted, still do the read-only remounts 2012-09-05 14:16:41 -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 014a9c777b nspawn: skip mounts if already mounted 2012-09-04 16:33:13 -07:00
Lennart Poettering e65aec12ae nspawn: mount a clean instance of sysfs 2012-09-04 16:32:43 -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 be5412d854 main: jointly mount more controllers
After talking to the cgroup kernel folks at LPC we came to the
conclusion that it is probably a good idea to mount all CPU related
resp. all network related cgroup controllers together, both because they
are good defaults for admins and because this might prepare
for eventual kernel cleanups where the ability to mount them separately
is removed.
2012-09-03 18:59:05 -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 268ba0ef60 readahead: a bit of reformatting 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 c0387ebfb6 swap: don't try to shutdown swaps on shutdown in a container 2012-09-03 18:59:05 -07:00
Lennart Poettering a5c3034fa7 swap: refuse start/stop of swaps in container 2012-09-03 18:59:05 -07:00
Lennart Poettering 024f268d63 shutdown: don't attempt read-only mounts in a container 2012-09-03 18:59:04 -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
Yin Kangkai 70f09301d5 journal: add HAVE_XZ check to avoid build failure
Without this, build fail with --disable-xz or xz not installed.
2012-08-25 02:01:12 +02:00
Allin Cottrell 4871690d9e journald: add missing includes 2012-08-24 01:46:38 +02:00
Lukas Nykryn f284860764 sd-journal: return null when mmap_cache_new fails 2012-08-23 13:53:30 +02:00
Lukas Nykryn 9f89986d2b hashmap: hashmap_contains does not need hashmap_entry 2012-08-23 13:53:30 +02:00
Lukas Nykryn 403a56bf81 readahead-analyze: don't call fclose on null 2012-08-23 13:53:30 +02:00
Lukas Nykryn 032f81645b core: free word later in parse_proc_cmdline 2012-08-23 13:53:30 +02:00
Lukas Nykryn a34faf579d login: check return of parse_pid and parse_uid 2012-08-23 13:53:30 +02:00
Lukas Nykryn b5fb37899d load-fragment: initialize bool invert before use 2012-08-23 13:31:32 +02:00
Lennart Poettering 8d1b002a2e service: introduce a proper service result if the start limit is hit 2012-08-22 05:02:33 +02:00
Lennart Poettering 99add6fd0b journalctl: complain if unprivileged users attempt to access the journal and persistant logging is off 2012-08-22 04:45:17 +02:00
Lennart Poettering d2bd7630d7 journal: the ratelimiter is part of journald 2012-08-22 03:43:45 +02:00
Lennart Poettering 0153028ae3 journald: split off native protocol support into its own .c file 2012-08-22 03:42:23 +02:00
Lennart Poettering 3b7124a8db journald: split console transport stuff into its own file 2012-08-22 03:36:29 +02:00
Lennart Poettering a45b9fca6b journald: move stream protocol into its own .c file 2012-08-22 03:32:41 +02:00
Lennart Poettering 5809560d85 journal: move syslog specific calls out of util.c 2012-08-22 03:24:46 +02:00
Lennart Poettering 35e2e347d3 journald: splitt of syslog protocol support into its own file 2012-08-22 03:21:03 +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 671e021c92 journald: write tags also to user journal files 2012-08-22 02:53:51 +02:00
Lennart Poettering bdfb9e7f7c journald: augment journal entries from the kernel with data from udev 2012-08-22 02:49:17 +02:00
Lennart Poettering c0d6e764d1 unit: add new ConditionHost= condition type 2012-08-22 01:51:53 +02:00
Lennart Poettering ddfa5101a2 main: fix PR_SET_CHILD_SUBREAPER warning version 2012-08-21 23:07:21 +02:00
Lennart Poettering c0ca7aeec9 journalctl: be more friendly when informing about seal verification 2012-08-21 23:03:20 +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 4fc9982cb0 nspawn: add /dev FD symlinks in container setup
This creates /dev/fd, /dev/stdin, /dev/stdout, /dev/stderr, and
/dev/core as symlinks to /proc on container creation. Except for
/dev/core, these are needed for shells like bash to be fully functional.
2012-08-21 17:19:38 +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 8b8ffe6828 core: fix error checking for PR_SET_CHILD_SUBREAPER 2012-08-21 16:48:02 +02:00
Lennart Poettering cedb42bb69 journalctl: add a bit of color to the output 2012-08-21 15:53:48 +02:00
Lennart Poettering 24a598f889 journal: properly handle EPIPE from /dev/kmsg 2012-08-21 15:39:34 +02:00
Lennart Poettering fcde238921 journal: be more careful when keeping around mmaps we still need 2012-08-21 15:39:34 +02:00
Lennart Poettering 369f058921 verify: optimize entry search a bit by using bisection 2012-08-21 15:32:51 +02:00
Lennart Poettering a228a22fda journalctl: really include .journal~ files in listing 2012-08-21 02:13:21 +02:00
Lennart Poettering 72fbdd3349 journal: initialize libgcrypt explicitly, before using HMAC 2012-08-21 01:44:38 +02:00
Lennart Poettering 89fef99014 journal: automatically evolve FSS key even when nothing is logged 2012-08-21 01:29:17 +02:00
Lennart Poettering c05276f23e journalctl: reword things a bit 2012-08-21 01:02:08 +02:00
Lennart Poettering adac1c93ab journal: rearrange QR code output a bit to fi to 80x25 terminals 2012-08-20 22:22:05 +02:00
Lennart Poettering eb53b74f7e journald: add new Seal= configuration option 2012-08-20 22:13:22 +02:00
Lennart Poettering 197c0da225 journalctl: explain QR code use 2012-08-20 22:11:55 +02:00
Lennart Poettering 92221ed7cb journal: include machine ID in QR code 2012-08-20 22:11:38 +02:00
Lennart Poettering f6a971bc0b journalctl: output FSS key as QR code on generating 2012-08-20 22:02:19 +02:00
Lennart Poettering 3e4b9b506d journal: add missing endianess conversion 2012-08-20 19:21:19 +02:00
Lennart Poettering feb12d3ed2 journal: make libgcrypt dependency optional 2012-08-20 16:51:46 +02:00
Lennart Poettering 8088cbd3cf journal: use a macro to check for file header flags 2012-08-20 16:11:42 +02:00
Lennart Poettering f7fab8a5ae journal: fix tag ordering check 2012-08-20 15:59:33 +02:00
Lennart Poettering a2e99cdf94 journal: fix bisection algorithm 2012-08-19 15:16:32 +02:00
Lennart Poettering fc89a13992 journal: validate timestamps as well 2012-08-19 15:16:11 +02:00
Lennart Poettering 84168d8068 mmap: resize arrays dynamically 2012-08-18 01:46:20 +02:00
Lennart Poettering fb9a24b6b1 journal: even more simple static object tests 2012-08-18 01:45:39 +02:00
Lennart Poettering 97147f8c1f journal: refuse verification of files with unknown flags 2012-08-18 00:41:06 +02:00
Lennart Poettering b72631e59c jounral: write bit fiddling test
This test goes through every single bit in a journal file, toggles it,
and checks if this change is detected by the verification.
2012-08-18 00:40:03 +02:00
Lennart Poettering c586dbf110 journal: fix verification without key 2012-08-18 00:38:57 +02:00
Lennart Poettering db11ac1ab5 journald: add additional simple static tests to verifier 2012-08-18 00:37:21 +02:00
Lennart Poettering a010801297 journal: be fine with opening rotated/corrupted journal files 2012-08-17 22:10:36 +02:00
Lennart Poettering f982e6f761 journal: set secure deletion flags for FSS file 2012-08-17 22:10:11 +02:00
Lennart Poettering 6c7be122ac journal: after verification output validated time range 2012-08-17 03:30:22 +02:00
Lennart Poettering 356fe3e6c6 journal: reword verification messages a bit 2012-08-17 03:01:07 +02:00
Lennart Poettering 7b5fd91c54 journal: ensure that entries and tags are properly ordered 2012-08-17 03:00:09 +02:00
Lennart Poettering 3223f44f23 journal: show new header fields in header dump 2012-08-17 02:29:20 +02:00
Lennart Poettering e627440b41 journal: don't write tag objects if nothing has been written since the last time 2012-08-17 01:19:32 +02:00
Lennart Poettering 31094aae09 man: add man pages for new FSS stuff 2012-08-17 01:09:43 +02:00
Lennart Poettering baed47c3c2 journal: rework terminology
Let's clean up our terminology a bit. New terminology:

FSS = Forward Secure Sealing
FSPRG = Forward Secure Pseudo-Random Generator

FSS is the combination of FSPRG and a HMAC.

Sealing = process of adding authentication tags to the journal.
Verification = process of checking authentication tags to the journal.

Sealing Key = The key used for adding authentication tags to the journal.
Verification Key = The key used for checking authentication tags of the journal.
Key pair = The pair of Sealing Key and Verification Key

Internally, the Sealing Key is the combination of the FSPRG State plus
change interval/start time.

Internally, the Verification Key is the combination of the FSPRG Seed
plus change interval/start time.
2012-08-17 00:45:18 +02:00
Lennart Poettering 14d10188de journal: add FSPRG journal authentication 2012-08-16 23:58:14 +02:00
Lennart Poettering a8e5f51484 journal: fix tag sequence number verification 2012-08-16 21:22:11 +02:00
Lennart Poettering 56e81f7ca8 journalctl: immeidately terminate on invalid seed 2012-08-16 21:00:47 +02:00
Lennart Poettering b7c9ae91d1 journal: parse fsprg seed 2012-08-16 21:00:47 +02:00
Lennart Poettering 2dee23ebe0 journal: count number of entry arrays in header 2012-08-16 21:00:47 +02:00
Kay Sievers 45b51b6b71 keymap: fix map name reference 2012-08-16 21:00:06 +02:00
Zbigniew Jędrzejewski-Szmek 2737027897 journal: rename 'mmap' to 'mmap_cache' to appease gcc
warning: declaration of 'mmap' shadows a global declaration [-Wshadow]
2012-08-16 19:44:51 +02:00
Lennart Poettering 1137e6c73b journal: fix variable initialization 2012-08-16 17:39:00 +02:00
Lennart Poettering 2a7273ef92 journal: fix unitialized var 2012-08-16 17:22:58 +02:00
Lennart Poettering f5028bfaf0 journal: journal-send.h doesn't actually exist 2012-08-16 17:19:47 +02:00
Lennart Poettering 86adf873be journal: verify structural consistency 2012-08-16 17:10:58 +02:00
Lennart Poettering f9fffc31cd journal: add color to verification progress bar 2012-08-16 17:10:57 +02:00
Lennart Poettering fd5dc3204d journal: verify compressed objects 2012-08-16 17:10:57 +02:00
Lennart Poettering 4da416aa20 journalctl: add --verify-seed= switch to specify seed value 2012-08-16 17:10:57 +02:00