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

3165 Commits

Author SHA1 Message Date
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