1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-08 11:27:32 +03:00
Commit Graph

3899 Commits

Author SHA1 Message Date
Thomas Hindoe Paaboel Andersen
b43d1d01ea util: introduce strcaseeq/strncaseeq 2013-02-13 00:56:13 +01:00
Thomas Hindoe Paaboel Andersen
641906e936 use strneq instead of strncmp 2013-02-13 00:56:13 +01:00
Auke Kok
8d61671016 Merge branch 'master' of ssh://git.freedesktop.org/git/systemd/systemd into work 2013-02-12 15:28:00 -08:00
Lennart Poettering
726c6b6b3d efi: add missing #include 2013-02-13 00:18:29 +01:00
Oleksii Shevchuk
4a9fd066f0 manager: pass environment over daemon-reexec
Fixes this bug:
alxchk > systemctl --user set-environment A=B
alxchk > systemctl --user show-environment | grep ^A=
A=B
alxchk > systemctl --user daemon-reexec
alxchk > systemctl --user show-environment | grep ^A=
alxchk >
2013-02-13 00:17:17 +01:00
Auke Kok
cd3bccaaf7 systemd-bootchart: relicense to LGPLv2.1+
When we merged systemd-bootchart we omitted relicensing this
to LGPL. Now that code is being used for other purposes we
need to make sure the code is shareable within systemd
without further problems.

The original committers and contributors of bootchart before it
was merged all have agreed with the relicensing.
2013-02-12 15:14:15 -08:00
Lennart Poettering
9cde64ff26 efi: various cleanups 2013-02-13 00:12:58 +01:00
Aleksander Morgado
a96215285a missing: define MS_REC and MS_SHARED if not defined already 2013-02-13 00:12:58 +01:00
Kay Sievers
38d70045d1 udev: use unique names for temporary files created in /dev
On Tue, Feb 12, 2013 at 2:18 PM, Robert Milasan <rmilasan@suse.com> wrote:
> Under some circumstances udev mixed with multipath fails:
>
> udevd-work[1376]:
> symlink(../../sdk, /dev/disk/by-id/scsi-36005076305ffc0670000000000002842.udev-tmp)
> failed: File exists udevd-work[1432]:
> rename(/dev/disk/by-id/scsi-36005076305ffc0850000000000000a88.udev-tmp, /dev/disk/by-id/scsi-36005076305ffc0850000000000000a88)
> failed: No such file or directory
>
> This is non-fatal, but there is no point of created the symlink or
> renaming the symlink if it already exists.
>
> Reference: https://bugzilla.novell.com/show_bug.cgi?id=791503

It looke like this now:
  stat("/dev/disk/by-id", {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
  symlink("../../sda", "/dev/disk/by-id/ata-INTEL...N.tmp-b8:0") = 0
  rename("/dev/disk/by-id/ata-INTEL...N.tmp-b8:0", "/dev/disk/by-id/ata-INTEL...N") = 0
2013-02-12 16:08:14 +01:00
Harald Hoyer
a0ec302b93 cdrom_id: add data track count for bad virtual drive implementations
/# /lib/udev/cdrom_id --debug /dev/sr0
probing: '/dev/sr0'
INQUIRY: [AMI     ][Virtual CDROM   ][1.00]
GET CONFIGURATION failed with SK=5h/ASC=20h/ACQ=00h
drive is pre-MMC2 and does not support 46h get configuration command
trying to work around the problem
READ DISC INFORMATION failed with SK=5h/ASC=20h/ACQ=00h
no current profile, but disc is present; assuming CD-ROM
READ TOC: len: 12, start track: 1, end track: 1
last track 1 starts at block 0
READ DISC INFORMATION failed with SK=5h/ASC=20h/ACQ=00h
ID_CDROM=1
ID_CDROM_MEDIA=1
ID_CDROM_MEDIA_CD=1

What is missing here is ID_CDROM_MEDIA_TRACK_COUNT_DATA to trigger
blkid in /lib/udev/rules.d/60-persistent-storage.rules

KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*",
	ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*",
	ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", \
		  IMPORT{builtin}="blkid --noraid"
2013-02-12 15:27:30 +01:00
Lennart Poettering
82c1d8f4eb localectl: fix --help text
https://bugs.freedesktop.org/show_bug.cgi?id=60595
2013-02-12 00:34:41 +01:00
Lennart Poettering
96088db02b journalctl: allow both "-n 55" and "-n55" on the command line, as equivalent syntaxes
https://bugs.freedesktop.org/show_bug.cgi?id=60596
2013-02-12 00:31:13 +01:00
Lennart Poettering
8b55b8c4e7 manager: clean environment before passing it on to others 2013-02-11 23:54:30 +01:00
Lennart Poettering
fabe5c0e5f binfmt,tmpfiles,modules-load,sysctl: rework the various early-boot services that work on .d/ directories
This unifies much of the logic behind them:

- All four will now ofllow the rule that the earlier file and earlier
  assignment in the .d/ directories wins. Before, sysctl was the only
  outlier, where the later setting always won.

- All four now support getopt() and --help on the command line.

- All four can now handle specification of configuration file names on
  the command line to apply. The tools will automatically find them, and
  apply them. Previously only tmpfiles could do that. This is useful for
  %post scripts in RPMs and suchlike.

- This fixes various error path issues in conf_files_list()
2013-02-11 23:54:30 +01:00
Lennart Poettering
853b8397ac core: properly validate environment data from Environment= lines in unit files 2013-02-11 23:54:30 +01:00
Lennart Poettering
123b964a53 manager: validate environment parameters for SetEnvironment(), UnsetEnvironment() bus calls 2013-02-11 23:54:30 +01:00
Kay Sievers
abb381b3b3 bootctl: print partition uuids as /dev/disk/by-partuuid/... 2013-02-11 23:20:02 +01:00
Lennart Poettering
0c4025d142 core: don't accept invalid environment assignments from the kernel cmdline 2013-02-11 23:17:32 +01:00
Thomas Hindoe Paaboel Andersen
8354c34e14 tests: more tests
tests for:
 parse_boolean
 env_name_is_valid

Also convert assert to assert_se to make sure they are run even with
optimization. (see commit 9b5d6bd909)
2013-02-11 22:22:40 +01:00
Adel Gadllah
eb6d233862 logind: Allow active sessions to always shutdown by default
Currently local user are being asked for an admin  password when another
user is logged into the system. This does not make sense as the user has
the power to shut down the system anyway regardless if he/she knows the
password or not (by pulling the plug, battery or whatever).

So only require the admin authentification for remote sessions.

https://bugzilla.gnome.org/show_bug.cgi?id=693385
2013-02-11 21:04:25 +01:00
Kay Sievers
7b4d7cc082 bootctl: add boot loader and firmware interface tool 2013-02-11 19:35:52 +01:00
Lennart Poettering
ff47c895c8 efi: fix returned length of efi_get_variable() 2013-02-11 06:21:20 +01:00
Lennart Poettering
dfbacb6fe5 util: rework load_env_file()
Inner library calls should not invoke log_oom(), that's something for
main programs, not library calls.

Don't read through uninitialized memory if a file ends in a continuation
line.

Add comments for the non-obvious bits.

Don't choke on comment lines that are continuation lines.

Simplify some things.
2013-02-11 05:36:54 +01:00
Lennart Poettering
91a6489d99 path-util: fix memory leak 2013-02-11 05:10:23 +01:00
Lennart Poettering
f74e605fc0 util: introduce FOREACH_LINE for iterating through files 2013-02-11 05:09:29 +01:00
Lennart Poettering
9b5d6bd909 test-env-replace: better user assert_se() everywhere
For test tools it's better to use assert_se() rather than assert(),
since the former is not optimized away, even if -DNDEBUG is used. That
means the test program now retains its usefulness even if -DNDEBUG is
used.

This also adds in some OOM checks, to be extra anal...
2013-02-11 03:55:07 +01:00
Lennart Poettering
4d1a690438 env: considerably beef up environment cleaning logic
Now, actually check if the environment variable names and values used
are valid, before accepting them. With this in place are at some places
more rigid than POSIX, and less rigid at others. For example, this code
allows lower-case environment variables (which POSIX suggests not to
use), but it will not allow non-UTF8 variable values.

All in all this should be a good middle ground of what to allow and what
not to allow as environment variables.

(This also splits out all environment related calls into env-util.[ch])
2013-02-11 03:54:50 +01:00
Thomas Hindoe Paaboel Andersen
c62c294fd5 tests: add tests of strxcpyx
also fix a bad indentation in test-strbug.c
2013-02-10 23:06:16 +01:00
Lennart Poettering
a25d4d0e3c vconsole-setup: don't set the kbd mode to unicode if is is currently in raw/off mode
Let's not confuse X11
2013-02-09 02:40:57 +01:00
Lennart Poettering
c65eb83653 shutdown: issue a sync() as soon as shutdown.target is queued 2013-02-09 02:20:42 +01:00
Thomas Hindoe Paaboel Andersen
97b5f60818 tests: add test of strbuf 2013-02-09 01:40:52 +01:00
Lennart Poettering
2d96536dd7 logind: rename "seat-master" tag to "master-of-seat"
We currently enforce that seats are to be named in the form of
"seatXXX", i.e. need to begin with the 4 characters "seat". Thus,
"seat-master" would qualify as a seat name. As seat names are frequently
used as tags on devices, the "seat-master" tag might hence confuse
logind if the user decides to name a seat "seat-master".

Hence, avoid any ambuigity: let's rename the "seat-master" tag to
"master-of-seat".
2013-02-09 01:25:55 +01:00
Kay Sievers
3e49f2ecb5 udev: udevadm hwdb - add --root=
https://bugs.freedesktop.org/show_bug.cgi?id=60398
2013-02-08 12:00:05 +01:00
Kay Sievers
e02caf30ac shared: conf-files - use root parameter and convert to auto-cleanup 2013-02-08 11:52:10 +01:00
Kay Sievers
7850b3b837 shared: conf-files - add root parameter 2013-02-08 10:23:04 +01:00
Zbigniew Jędrzejewski-Szmek
0b9cc004a4 systemd: fix uninitialized memory access in selinux
==6129== Syscall param socketcall.getsockopt(optlen) points to uninitialised byte(s)
==6129== at 0x312D0F325A: getsockopt (syscall-template.S:81)
==6129== by 0x4615E6: get_audit_data (selinux-access.c:268)
==6129== by 0x461A81: selinux_access_check (selinux-access.c:394)
==6129== by 0x453B23: bus_manager_message_handler (dbus-manager.c:1395)
==6129== by 0x313581D9C4: _dbus_object_tree_dispatch_and_unlock (dbus-object-tree.c:862)
==6129== by 0x313580FC1F: dbus_connection_dispatch (dbus-connection.c:4672)
==6129== by 0x44CD4C: bus_dispatch (dbus.c:528)
==6129== by 0x41292F: manager_loop (manager.c:1573)
==6129== by 0x40CD8E: main (main.c:1735)
==6129== Address 0x7fefff2c0 is on thread 1's stack
2013-02-07 21:13:19 -05:00
Thomas Hindoe Paaboel Andersen
940bd4738b tests: add more tests
Adds tests of:
 strv_env_delete
 strv_env_unset
 strv_env_set
2013-02-08 00:25:37 +01:00
Kay Sievers
beb23689e3 udev: remove HWDB_BIN 2013-02-07 21:54:49 +01:00
Thomas Hindoe Paaboel Andersen
1f28b2deb4 test-env-replace: assert results instead of printing them
Also code cleanup and split into functions in preparation for more tests
to come.
2013-02-07 21:14:36 +01:00
Mirco Tischler
b7f7c68570 coredump: make use of the cleanup macros 2013-02-07 01:02:34 -05:00
Mirco Tischler
a4b88c1ecb logs-show: show messages for all unit types in systemctl status
I can't find a reason why we shouldn't try to output messages for other
unit types than .service, .socket, .mount and .swap as well. It's probably
a leftover from before we started logging UNIT= from inside PID 1.
2013-02-07 01:02:34 -05:00
Mirco Tischler
f904546894 journal: log user units for coredumps and show them in systemctl status 2013-02-07 01:02:34 -05:00
Eelco Dolstra
d2f1f23ad2 nss-myhostname: copy first result to preallocated buffer
Fixes a segfault in nscd when using nss-myhostname.

Nscd expects that an NSS module's gethostbyname4_r function returns
its first result in the pre-allocated gaih_addrtuple denoted by **pat.
(See nscd/aicache.c in the Glibc sources.)  However, nss-myhostname
doesn't fill in **pat but allocates the first result in ‘buffer’, then
sets *pat.  So nscd crashes (e.g. when running ‘getent ahosts
my-machine’).

Hard to tell if this is a bug in nscd, since there doesn't seem to be
a proper API spec for gethostbyname4_r.  But in any case, this patch
fixes the crash by copying the first result to **pat.
2013-02-07 01:02:33 -05:00
Zbigniew Jędrzejewski-Szmek
7ad94c716d systemd: raise level of message about lookup paths
This can be pretty important for the user, and is not trivial
to figure out in all cases.

Also show failing path in error messages.
2013-02-06 23:16:17 -05:00
Zbigniew Jędrzejewski-Szmek
0783951b93 shared: remove now unused function 2013-02-06 23:16:17 -05:00
Zbigniew Jędrzejewski-Szmek
874310b7b6 systemd: do not remove empty paths from unit lookup path
The ability to start a new unit with 'systemctl start ...' should not
depend on whether there are other units in the directory. Previously,
an additional 'systemctl daemon-reload' would be necessary to tell
systemd to update the list of unit lookup paths.
2013-02-06 23:16:16 -05:00
Zbigniew Jędrzejewski-Szmek
c5e33bf834 tests: skip tests if manager cannot be created
When running without a user session, tests fail.
2013-02-06 19:29:33 -05:00
Thomas Hindoe Paaboel Andersen
10ddd913f0 tests: move strv_parse_nulstr to test-strv, and actually test it
The test was originally added with this commit message:
"ask-password: supported plymouth cached passwords"
2013-02-07 00:38:16 +01:00
Thomas Hindoe Paaboel Andersen
7c2d80944a strv: add strv_print
Clearer, and spares the temp variable.
2013-02-07 00:38:09 +01:00
Zbigniew Jędrzejewski-Szmek
fa3cd7394c tests: run manager in session mode
False positives pop up otherwise.

FAIL: test-unit-name (exit: 134)
================================

Failed to open /dev/tty0: Permission denied
Failed to create root cgroup hierarchy: Permission denied
Assertion 'manager_new(SYSTEMD_SYSTEM, &m) == 0' failed at src/test/test-unit-name.c:125, function test_unit_printf(). Aborting.
2013-02-06 17:06:26 -05:00
Thomas Hindoe Paaboel Andersen
539ad707db test: add a few tests and tidy up
adds test of:
strv_find
strv_find_prefix
strv_overlap
strv_sort
streq_ptr
first_word

Splits tests of util.c into own file to avoid clutter as we add more.

Removed a few prints and uses _cleanup_free_ to make the tests more focused.
2013-02-06 21:15:23 +01:00
Michal Schmidt
18cf1a1be5 cryptsetup: accept both "read-only" and "readonly" spellings
Mukund Sivaraman pointed out that cryptsetup(5) mentions the "read-only"
option, while the code understands "readonly".

We could just fix the manpage, but for consistency in naming of
multi-word options it would be prettier to have "read-only". So let's
accept both spellings.

BZ: https://bugzilla.redhat.com/show_bug.cgi?id=903463
2013-01-31 19:57:56 +01:00
Daniel Buch
682cfdff69 test-strv.c: test strv_join added 2013-01-30 23:37:39 -05:00
Daniel Buch
3a7719d303 test-strv.c: Split tests into seperate functions
test-strv.c: Leaves main clean for additional tests
2013-01-30 23:37:39 -05:00
Mauro Dreissig
883127fd84 systemctl: Fix wrong assertion test 2013-01-30 23:37:39 -05:00
Zbigniew Jędrzejewski-Szmek
1682ff6011 tests: add test for unit name printing 2013-01-29 19:01:41 -05:00
Zbigniew Jędrzejewski-Szmek
3251c0d239 tests: compress unit name tests and add more asserts 2013-01-29 19:01:41 -05:00
Zbigniew Jędrzejewski-Szmek
7742f7e999 tests: add test for install_full_printf() 2013-01-29 19:01:41 -05:00
Zbigniew Jędrzejewski-Szmek
3f0b2f0f45 install: allow %u an and %U specifiers in WantedBy/RequiredBy/Alias 2013-01-29 19:01:41 -05:00
Zbigniew Jędrzejewski-Szmek
7584d236ea install: allow specifiers in WantedBy/RequiredBy/Alias
This allows one templated unit to refer to another templated unit
at installation time.

Examples:

> grep WantedBy ~/.config/systemd/user/mpop@.timer
WantedBy=services@%i.target

> srv disable mpop@iit.timer
rm '/home/alxchk/.config/systemd/user/services@iit.target.wants/mpop@iit.timer'
> srv enable mpop@iit.timer
ln -s '/home/alxchk/.config/systemd/user/mpop@.timer' '/home/alxchk/.config/systemd/user/services@iit.target.wants/mpop@iit.timer'

Based-on-patch-by: Oleksii Shevchuk <alxchk@gmail.com>
2013-01-29 19:01:41 -05:00
Zbigniew Jędrzejewski-Szmek
0591220f33 core: fix %U when no User= used
When the username was not explicitly specified, both %U and %u would
print the username. Make %U always print UID.
2013-01-29 19:01:41 -05:00
Zbigniew Jędrzejewski-Szmek
d848b9cbfa Move generic specifier functions to shared
No functional change. This makes it possible to use them in install.c.
2013-01-29 19:01:41 -05:00
Zbigniew Jędrzejewski-Szmek
d9e5e694ea install: automatic cleanup using local cleanup functions 2013-01-29 19:01:41 -05:00
Zbigniew Jędrzejewski-Szmek
ea55addcb7 install: use automatic cleanup in find_symlinks_fd() 2013-01-29 19:01:41 -05:00
Zbigniew Jędrzejewski-Szmek
e3ded78be7 shared: introduce _cleanup_set_free_free_ 2013-01-29 19:01:41 -05:00
Zbigniew Jędrzejewski-Szmek
67e04a486b journalctl: allow --lines=0 i.e. only new
Makes it easier to watch just for new entries. Once scenario
is where the user starts 'journalctl -qfn0' to watch for changes
during some operation.
2013-01-28 22:38:55 -05:00
Martin Pitt
4dbcb1b3ba keymap: Add HP HDX 9494NR
Add touchpad and www keys.

https://bugzilla.redhat.com/show_bug.cgi?id=757928
2013-01-28 07:41:36 +01:00
Ayan George
c437b20d6e keymap: Add support for the brower hotkey on the HP ProBook
https://bugs.launchpad.net/bugs/1105191
2013-01-28 07:30:01 +01:00
Zbigniew Jędrzejewski-Szmek
c485437f50 logind: add MESSAGE_IDs to interesting events 2013-01-27 23:47:18 -05:00
Kay Sievers
22582bb2cb udev: set default rules permissions only at "add" events 2013-01-27 21:46:36 +01:00
Lennart Poettering
cd2086fe65 core: unify kill code of mount, service, socket, swap units 2013-01-26 05:53:30 +01:00
Michal Schmidt
f2956e80c9 nspawn: assume stdout is always writable if it does not support epoll
stdout can be redirected to a regular file. Regular files don't support epoll.
nspawn failed with: "Failed to register fds in epoll: Operation not permitted".

If stdout does not support epoll, assume it's always writable.
2013-01-26 00:16:13 +01:00
Michal Schmidt
e45460d666 job: fix merging with --ignore-dependencies
This fixes a bug where a job with --ignore-dependencies would wait for
other jobs because it merged into a previously queued job.
2013-01-25 22:29:56 +01:00
Michal Sekletar
78a92a5a23 tmpfiles: introduce type X
Type X will exclude path itself from clean-up. However, if the path is a
directory systemd-tmpfiles will clean-up its content.

In contrast to type x, where path is ignored completely, type X needs some
Age parameter. In order to determine Age parameter, we will look for config
entries of type d or D and pick the best match.  Best match is either
exact match or longest prefix match.
2013-01-25 10:38:46 -05:00
Zbigniew Jędrzejewski-Szmek
e985665d2d Add _cleanup_pclose_ and fix mismatching pipe close opened by popen()
Based-on-patch-by: Thomas Jarosch <thomas.jarosch@intra2net.com>

cppcheck reported:
[src/bootchart/svg.c:791]: (error) Mismatching allocation and deallocation: f
2013-01-25 10:38:42 -05:00
Lennart Poettering
314b4b0a68 logind: rework delay inhibition logic
- Don't allow any locks to be taken while we are in the process of
  executing the specific operation, so that apps are not surprised if a
  suspend/shutdown happens while they rely on their inhibitor.

- Get rid of the Resumed signal, it was a bad idea, and redundant due to
  PrepareForSleep(false), see below.

- Always send out PrepareFor{Shutdown,Sleep} signals, instead of only if
  a delay lock is taken.

- Move PrepareForSleep(false) after we come back from the suspend, so
  that apps can use this as "Resumed" notification. This also has the
  benefit that apps know when to take a new lock.
2013-01-25 06:30:23 +01:00
Lennart Poettering
5d1fb81b2c loginctl: don't show [UACCESS] info in device tree
As the tree doesn't really necessarily show all device node devices and
only those are marked for uaccess it's kinda pointless showing this at
all, since it would give a pretty incomplete impression of the uaccess
information.
2013-01-25 04:48:34 +01:00
Lennart Poettering
035dba6f82 selinux: we don't need that many debug messages by default 2013-01-25 03:05:08 +01:00
Colin Walters
6fd55349ab selinux-access: Delete debugging message logged as an error
I don't see why this should be logged at all, so let's delete it.
2013-01-25 03:03:19 +01:00
Umut Tezduyar
aa7cb20983 core: Set source for mountinfo .mount units 2013-01-24 19:36:47 -05:00
Michael Olbrich
90527fbb2c service: make sure the watchdog timer is not restarted while stopping
A watchdog notification may be handled after the watchdog timer was stopped
while stopping the service. As a result the timer is restarted and the
service may be restarted as well.
The watchdog timestamp is initially set during startup in
service_enter_start_post() and cleared when the timer is stopped. Therefore
it can be used as an indication if the timer should be reset.
2013-01-24 19:36:47 -05:00
Michael Olbrich
6d594baa3f service: really stop watchdog timer when stopping
For services without ExecStop= the state SERVICE_STOP is never entered. as
a result the watchdog timer is not stopped and the service is restarted (if
it is configuered to restart).
Stopping the watchdog timer for SERVICE_STOP_SIGTERM as well fixes this.
2013-01-24 19:36:47 -05:00
Kay Sievers
e9cea16db6 efi: fix Usec vs. USec 2013-01-24 10:33:52 +01:00
Lennart Poettering
d239d84aa3 loginctl: show seat master and uaccess devices in seat-status output 2013-01-24 05:47:37 +01:00
Lennart Poettering
b61600291e logind: add UnlockSessions() clal to complement LockSessions() 2013-01-24 05:29:37 +01:00
Lennart Poettering
ee17c9281d logind: send Resumed() signal after we come back from suspend/hibernate/hybrid-sleep
This allows clients to get asynchronous notifications for user-requested
suspend/hibernate cycles. Kernel-triggered automatic suspending is not
covered.
2013-01-24 05:15:36 +01:00
Lennart Poettering
af9792ac7f logind: only allow one shutdown/sleep action to be queued at the same time
This should make sure that closing the lid while shutting down won't
suspend the machine but will simply cause the shutdown to complete.
2013-01-24 04:56:44 +01:00
Zbigniew Jędrzejewski-Szmek
c3e31c7ba1 Replace autoconf int max test with simple define 2013-01-22 23:20:15 -05:00
Kay Sievers
5dbe9f5398 efi: read microseconds from boot loader info instead of "ticks" magic 2013-01-23 02:16:11 +01:00
Eelco Dolstra
2813720202 Fix some typos 2013-01-22 10:03:16 -05:00
Lennart Poettering
4beaf24f41 efi: set a nice description string in the ESP units 2013-01-21 01:27:32 +01:00
Lennart Poettering
1da350f18e efi: properly create symlink dir 2013-01-21 01:12:51 +01:00
Lennart Poettering
382e77287c build-sys: add makefile to bootchart 2013-01-21 01:04:16 +01:00
Lennart Poettering
f4ce2b3e5c efi: add efi boot generator that automatically mounts the ESP to /boot 2013-01-21 01:04:16 +01:00
Lennart Poettering
34e5a31ec5 util: move is_efiboot() to efivars.c 2013-01-21 01:04:16 +01:00
Kay Sievers
e1af7092a8 shutdown: loop - convert to enumerate match 2013-01-20 16:18:00 +01:00
Jonathan Callen
843fc7f7f2 execute: Fix seccomp support on x32
In the x32 ABI, syscall numbers start at 0x40000000.  Mask that bit on
x32 for lookups in the syscall_names array and syscall_filter and ensure
that syscall.h is parsed correctly.

[zj: added SYSCALL_TO_INDEX, INDEX_TO_SYSCALL macros.]
2013-01-19 12:03:06 -05:00
Kay Sievers
25da63b9da udev: net_id - add link to the wiki page 2013-01-19 16:01:26 +01:00
Lennart Poettering
2e3d069236 core: if the bootloader supports it, determine firmware and boot loader delay
This allows us to print simple performance data of all parts of the boot now:

- firmware
- boot loader
- kernel
- initrd
- userspace

This only works for bootloaders which support passing TSC data via EFI
variables. As of now that's only gummiboot.
2013-01-19 04:22:09 +01:00
Lennart Poettering
6d3a739048 unit: fix typo 2013-01-19 01:18:01 +01:00
Lennart Poettering
71645acac2 unit: optionally allow making cgroup attribute changes persistent 2013-01-19 01:02:30 +01:00
Lennart Poettering
e884315e3d cgroup: additional validity checks for cgroup attribute names 2013-01-19 01:02:30 +01:00
Zbigniew Jędrzejewski-Szmek
d6a195a3c3 build-sys: add autoconf macro to pick macro for x32 compatibility 2013-01-18 17:04:50 -05:00
Lennart Poettering
88d04e31ce nspawn: add audit caps to default set to keep
Due to the brokeness of much of the userspace audit code we cannot
really start too many systems without the audit caps set. To make nspawn
easier to use just add the audit caps by default.

To boot up containers successfully the kernel's auditing needs to be
turned off still (use "audit=0" on the kernel command line), but at
least no manual caps have to be passed anymore.

In the long run auditing will be fixed for containers and ve virtualized
properly at which time it should be safe to enable these caps anyway.
2013-01-18 18:23:20 +01:00
Zbigniew Jędrzejewski-Szmek
96cde13ace core/cgroup-util: simplify functions and add tests 2013-01-18 11:14:00 -05:00
Zbigniew Jędrzejewski-Szmek
3f98659cce core/group-util: merge two functions 2013-01-18 11:14:00 -05:00
Mirco Tischler
cc86e6b86e systemctl: print the user session journal for user session units. 2013-01-18 11:14:00 -05:00
Mirco Tischler
1a6c43e946 logs-show: add show_journal_by_user_unit
Print the journal for a user session unit. For now this filters by
_SYSTEMD_USER_UNIT and USER_UNIT and additionally _UID.
2013-01-18 11:14:00 -05:00
Mirco Tischler
bbc9006e6b core: log USER_UNIT instead of UNIT if in user session 2013-01-18 11:14:00 -05:00
Mirco Tischler
ef1673d169 journal: log _SYSTEMD_USER_UNIT for user session units 2013-01-18 11:14:00 -05:00
Zbigniew Jędrzejewski-Szmek
b989350563 util: modernization and test for load_env_file 2013-01-18 11:06:53 -05:00
Michal Vyskocil
565d91fdf1 util: continuation support for load_env_file
Variable definitions can be written on more than one line - if each ends
with a backslash, then is concatenated with a previous one. Only
backslash and unix end of line (\n) are treated as a continuation.

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

[zj: squashed two patches together; cleaned up grammar; removed
     comment about ignoring trailing backslash -- it is not ignored.]

Document continuation support in systemd.exec
2013-01-18 11:06:15 -05:00
Zbigniew Jędrzejewski-Szmek
c3a7cfb7de journal-gatewayd,man: document new HTTPS options 2013-01-18 01:41:01 -05:00
Zbigniew Jędrzejewski-Szmek
a93035cee3 journal-gatewayd: return nice error on unsupported methods
Returns "HTTP/1.0 406 Not Acceptable" instead of silently
closing the connection.
2013-01-18 01:16:30 -05:00
Zbigniew Jędrzejewski-Szmek
8530a1436a journal-gatewayd: allow pipelining
The request must not be answered immediately (at first call to
response_handler()), but on the second. This is also important
for authentication, which cannot be performed on the first call.

Before:

% wget -O/dev/null -S https://localhost:19531/
--2012-11-28 18:29:43--  https://localhost:19531/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:19531... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 301 Moved Permanently
  Connection: close
  Content-Length: 87
  Location: /browse
  Content-Type: text/html
  Date: Wed, 28 Nov 2012 17:29:44 GMT
Location: /browse [following]
--2012-11-28 18:29:43--  https://localhost:19531/browse
Connecting to localhost (localhost)|127.0.0.1|:19531... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 200 OK
  Connection: close
  Content-Length: 23260
  Content-Type: text/html
  Date: Wed, 28 Nov 2012 17:29:44 GMT
Length: 23260 (23K) [text/html]

After:

% wget --no-check-certificate -O/dev/null -S https://localhost:19531/
--2012-11-28 18:30:05--  https://localhost:19531/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:19531... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 301 Moved Permanently
  Content-Length: 87
  Location: /browse
  Content-Type: text/html
  Date: Wed, 28 Nov 2012 17:30:05 GMT
Location: /browse [following]
--2012-11-28 18:30:05--  https://localhost:19531/browse
Reusing existing connection to localhost:19531.
HTTP request sent, awaiting response...
  HTTP/1.1 200 OK
  Content-Length: 23260
  Content-Type: text/html
  Date: Wed, 28 Nov 2012 17:30:06 GMT
Length: 23260 (23K) [text/html]
2013-01-18 01:15:54 -05:00
Zbigniew Jędrzejewski-Szmek
9775033d26 journal-gatewayd: always log oom() in addition to returning error 2013-01-18 01:15:54 -05:00
Zbigniew Jędrzejewski-Szmek
e429981ba4 share/log: skip file/line/func info if empty
The new microhttpd logger doesn't know this information. It is
better to log nothing than fake values.
2013-01-18 01:15:54 -05:00
Zbigniew Jędrzejewski-Szmek
41a79f1062 share/log: unify two code paths
Explicit zeroing is replaced with initialization to {0}.

No functional change.
2013-01-18 01:15:54 -05:00
Zbigniew Jędrzejewski-Szmek
e64690a857 journal-gatewayd: redirect microhttpd messages to journal
A prefix ("microhttpd: ") is added to the log lines to make it easy to
distinguish the source.
2013-01-18 01:15:54 -05:00
Zbigniew Jędrzejewski-Szmek
858634ff0e journal-gatewayd: SSL support
For now the certificates are passed around as options to the
program. This might not be the most convenient under "production",
but makes for fairly easy testing.
2013-01-18 01:15:54 -05:00
Zbigniew Jędrzejewski-Szmek
c54ff8e358 journal-gatewayd: unify two code paths
In preparation for adding more options, split out the option
handling code.
2013-01-18 01:15:54 -05:00
Lennart Poettering
d2a3097582 systemctl: add new "get-cgroup-attr" to query current cgroup attribute value
Also adds a pair of bus calls for this to the daemon.
2013-01-18 01:44:41 +01:00
Lennart Poettering
d54110d11d systemctl: it's probably a good idea not to alter return parameters if we fail
We generally follow the rule not to touch return values unless we
succeed, so for the sake of uniformity do the same here.
2013-01-18 00:53:09 +01:00
Lennart Poettering
52a2ab41e0 systemctl: no need to check this explicitly, we already checked it a few lines up anyway, so let's just assert 2013-01-18 00:52:45 +01:00
Lennart Poettering
540e7dbe9e systemctl: we can make this faster and shorten it a bit with strv_extend()
Now that strv_extend() is not so slow anymore, we can make use of it, to
shorten our code a bit.
2013-01-18 00:51:48 +01:00
Lennart Poettering
82dde599ed strv: make strv_extend() smarter 2013-01-18 00:47:19 +01:00
Lennart Poettering
e31165b262 systemctl: make list-dependencies default to default.target 2013-01-18 00:36:12 +01:00
Lennart Poettering
e608b38a87 systemctl: we can use nulstr_contains() for this lookup
It's a bit easier to read...
2013-01-18 00:29:51 +01:00
Lukas Nykryn
55c0b89c57 systemctl add command list-dependencies
systemctl list-dependencies lists all unit's dependecies and
recursively expands all subsidiary target units into a tree.

Primary purpose for this command is to show all units which are
enabled in specified target.
2013-01-17 21:34:11 +01:00
Lennart Poettering
86ed7ec58b util: fix bad memory access 2013-01-17 17:38:13 +01:00
Nestor Ovroy
8755586eba core: corrects check of strduped controller string
In commit 246aa6d (core: add bus API and systemctl commands for altering
cgroup parameters during runtime), when rewriting unit_add_one_default_cgroup
to prefered style, the check of strduped b->controller was incorrectly
changed to check the containing structure. Correct it.
2013-01-17 09:31:50 -05:00
Lennart Poettering
464876c9c4 service: properly signal permanent failure of a service to its socket
This makes sure that a service is not indefinitely restarted in a tight
loop if it fails before it is able to process its socket.

This corrects the breakage introduced with
8d1b002a2e. Shame on me.
2013-01-17 04:54:34 +01:00
Kay Sievers
f4ddacbd4d udev: net_id - suppress bcma core == 0 2013-01-17 03:30:07 +01:00
Lennart Poettering
74051b9b58 units: for all unit settings that take lists, allow the empty string for resetting the lists
https://bugzilla.redhat.com/show_bug.cgi?id=756787
2013-01-17 02:50:05 +01:00
Lennart Poettering
4b20075e2f dbus: add Unit's PartOf and ConsistsOf deps to introspection XML 2013-01-17 02:50:05 +01:00
Kay Sievers
984c4348ff udev: net_id - handle "bcma" buses 2013-01-17 02:10:58 +01:00
Kay Sievers
59d86149b0 udev: path_id - clarify comment about the kernel ATA naming problem 2013-01-17 00:00:02 +01:00
Lennart Poettering
5d4caf5654 service: ignore dependencies on $syslog and $local_fs in LSB scripts
We no longer allow early-boot init scripts, however in late boot the
syslog socket and local mounts are established anyway, so let's simplify
our dep graph a bit.

If $syslog doesn't resolve to syslog.target anymore there's no reason to
keep syslog.target around anymore. Let's remove it.

Note that many 3rd party service unit files order themselves after
syslog.target. These will be dangling dependencies now, which should be
unproblematic, however.
2013-01-16 21:34:09 +01:00
Lukas Nykryn
9bdbc2e2ec systemctl,loginctl,cgls: do not ellipsize cgroup members when --full is specified
New file output.h with output flags and modes.

--full parameter also for cgls and loginctl.

Include 'all' parameter in flags (show_cgroup_by_path, show_cgroup,
show_cgroup_and_extra, show_cgroup_and_extra_by_spec).

get_process_cmdline with max_length == 0 will not ellipsize output.

Replace LINE_MAX with 0 in some calls of get_process_cmdline.

[zj: Default to --full when under pager for clgs.
     Drop '-f' since it wasn't documented and didn't actually work.
     Reindent a bit.
]
2013-01-16 12:11:47 -05:00
Zbigniew Jędrzejewski-Szmek
2e72983463 logs-show: automatic cleanup 2013-01-16 12:10:03 -05:00
Kay Sievers
bdffb521d0 shutdown: ignore loop devices without a backing file 2013-01-16 04:35:54 +01:00
Kay Sievers
3f141375cb service: sysv - remove distribution specific targets
Systemd should not introduce any new facilities. Distributions which still
need to support their non-standard/legacy facilities should add them as
patches to their packaging.

The following facilities are no longer recognized:
  $x-display-manager
  $mail-transfer-agent
  $mail-transport-agent
  $mail-transfer-agent
  $smtp
  $null

This target is no longer available:
  mail-transfer-agent.target
2013-01-16 04:26:49 +01:00
Lennart Poettering
0c08f5cde7 shutdown: in the final umount loop don't use MNT_FORCE
MNT_FORCE is honoured by NFS and FUSE and allows unmounting of the FS
even if consumers still use it. For our brute-force loop we rely on
EBUSY being reported as long as a file system is still used by a
loopback device or suchlike. Hence, drop MNT_FORCE to make EBUSY
reliable.
2013-01-16 04:03:57 +01:00
Dave Reisner
ec76596cab systemctl: fix assertion hit by incorrect comparison 2013-01-15 18:49:31 -05:00
Lennart Poettering
cd7409576d load-fragment: fix bad memory access 2013-01-15 21:45:37 +01:00
Lennart Poettering
858c33bf60 load-fragment: replace specifiers in path unit's Unit= setting 2013-01-15 21:37:17 +01:00
Michał Bartoszkiewicz
7d0c710d72 core: do not make sockets dependent on lo
/sys/subsystem/net/devices/lo is never considered active, so sockets
with BindToDevice=lo would never be activated.
2013-01-15 21:00:11 +01:00
David Herrmann
244692cbfb journalctl: quit on I/O error
This makes journalctl quit on ferror() conditions on stdout. It fixes an
annoying bug if you pipe its output through 'less' and press 'q'. Without
this fix journalctl will continue reading all journal data until EOF which
can take quite some time. For instance on my machine:

    david-nb ~ # time journalctl | wc -l
    327240

    real    1m13.039s
    user    1m0.217s
    sys     0m10.467s

However, expected behavior is journalctl to quit when its pager closed the
output pipe.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-15 20:59:10 +01:00
Michal Sekletar
0762eaa327 logind: remove unused variable 2013-01-15 20:50:33 +01:00
Michal Sekletar
38c888a404 core: use correct argument of type JobResult 2013-01-15 20:50:33 +01:00