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

8369 Commits

Author SHA1 Message Date
Lennart Poettering
6b1dc2bd3c mount: replace PID1 internal fstab parser with generator
Bit by bit we should remove non-unit parsing from PID 1 and move into
generators, to clean up our code base a bit and clearly separate
parsers.
2012-05-22 19:25:17 +02:00
Kay Sievers
745e2fb79a main: only fall back to /bin/sh in case /sbin/init does not exist 2012-05-22 19:17:40 +02:00
Harald Hoyer
898720b7e9 test: introduce a basic testsuite framework
$ cd test
$ sudo make check

will run all tests in the TEST-* subdirectories

$ cd test/TEST-01-BASIC
$ sudo make clean setup run

will run the different stages of the test for debugging purposes
2012-05-22 16:54:54 +02:00
Lennart Poettering
9b958eff3f logind: fix write out of user state file 2012-05-22 16:46:11 +02:00
Harald Hoyer
b46178e5c2 switch-root: do not use close old_root_fd after rm_rf_children()
rm_rf_children() has already closed the fd with closedir().
2012-05-22 16:15:09 +02:00
Lennart Poettering
7925c22a78 util: make sure to fstatat() at most once in rm_rf_children() 2012-05-22 16:14:34 +02:00
Lennart Poettering
49e7f02774 rescue: don't pull in sockets
In rescue mode let's not establish all sockets, so that we don't end up
starting a lot of additional services automatically.

Instead of pulling in basic.target we now only pull in sysinit.target
which pulls in local-fs.target and swap.target. That way rescue mode has
all the really basic setup around, but normal services are not started
and not autostarted either.
2012-05-22 16:12:25 +02:00
Sjoerd Simons
499fb2152f journal: crash when filesystem is low on space
When space is getting too low on a file system rotating the journal file
will fail after the rotation, as opening the new logfile will fail.

Recognize this when logging the error and don't try to dereference a
NULL JournalFile pointer.
2012-05-22 13:22:00 +02:00
Lennart Poettering
bf4df7c3b6 main: properly queue default.target after switched root
This also introduces rd.systemd.unit= to specify the unit to boot into
in the initrd.
2012-05-22 13:22:00 +02:00
Kay Sievers
9a203affa6 build-sys: use libpci's pkgconfig file to find the pci.ids file 2012-05-22 02:35:44 +02:00
Maxim A. Mikityanskiy
0b270320da keymap: support for Lenovo IdeaPad Z570 keyboard 2012-05-22 02:11:21 +02:00
Lennart Poettering
92a39ae198 mount: use the same fstab extension option syntax everywhere
The man page and the actual code differed, and this is now corrected
2012-05-22 02:00:53 +02:00
David Ward
2e9d6c1251 service: fix auto-restart handling in service_start()
Do not bypass the SERVICE_DEAD/SERVICE_FAILED state by manually issuing
a start job while an automatic restart is pending.
2012-05-22 01:57:21 +02:00
David Ward
f0c7b229e1 service: fix auto-restart handling in service_stop()
When service_stop() handles a service in the SERVICE_AUTO_RESTART state,
it calls service_set_state() to transition it to the SERVICE_DEAD state.
However if the service failed, it should transition it to SERVICE_FAILED
instead, which will trigger its OnFailure units. To achieve this, we now
call service_enter_dead() in place of service_set_state(), which will
transition the service to either SERVICE_DEAD or SERVICE_FAILED as is
appropriate.

Also, some misleading comments are adjusted: service_stop() is not only
called on a user request, but also during an automatic restart in order
to handle dependencies.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=45511
2012-05-22 01:55:52 +02:00
David Ward
feae8adb84 service: actually delay auto-restart if another job is pending
https://bugs.freedesktop.org/show_bug.cgi?id=45511
2012-05-22 01:53:30 +02:00
Lennart Poettering
30edf11616 cgtop: change default depth to 3
https://bugs.freedesktop.org/show_bug.cgi?id=49778
2012-05-22 01:48:40 +02:00
Guillermo Vidal
fec2aa2f9e Fixed handling of posix_fallocate() returned value
According to the man pages of posix_fallocate, it returns zero on
success or an error number on failure; however,  errno is not set
on failure. If the kernel or a library other than glibc does not
support the function for example, EOPNOTSUPP will be returned and
the error will not be handled properly with original code.
2012-05-22 01:45:11 +02:00
Shawn Landden
927735238d systemd-analyze: switch to python getopt for argument parsing
this uses gnu style getopt, so you can put the opts at the end: (e.g.)
systemd-analyze blame --user

v4
2012-05-22 01:34:19 +02:00
Lennart Poettering
33ba4c4b0e man: relax wording in journal-fields(7) a bit 2012-05-22 01:12:46 +02:00
Frederic Crozat
c93ff2e913 main: allow system wide limits for services 2012-05-21 21:13:27 +02:00
Michal Schmidt
401cc72da8 journald: one more SYSLOG_IDENTIFIER length fix 2012-05-21 20:21:49 +02:00
Michal Schmidt
fca1b90a0d journald: fix length of "SYSLOG_IDENTIFIER="
Fixes weird messages like:
May 20 22:23:30 jik2 TIFIER=systemd-logind[795]: New session 46 of user gdm.

https://bugzilla.redhat.com/show_bug.cgi?id=823498
2012-05-21 20:03:26 +02:00
Lennart Poettering
8f33b5b8b3 util: rework in_initrd() logic
Checking the device major/minor is not a good idea. Let's replace this
with an explicit flag file, which we model after /etc/os-release and
call /etc/initrd-release.
2012-05-21 20:00:58 +02:00
Lennart Poettering
2660882b52 main: rename a few fix to follow general naming style 2012-05-21 19:48:04 +02:00
Lennart Poettering
416693175b switch-root: move switch_root() call into its own .c file 2012-05-21 19:33:39 +02:00
Harald Hoyer
97a66e9470 main: do_switch_root() do not recursively remove across device boundaries 2012-05-21 18:53:02 +02:00
Harald Hoyer
597f43c784 util: rm_rf_children() add root_dev parameter
if root_dev is set, remove subdirectories only, if the device is the
same as the root_dev. This prevents to remove files across device
boundaries.
2012-05-21 18:52:49 +02:00
Harald Hoyer
d966a7b363 delta/delta.c: initialize bottom for fail state 2012-05-21 18:51:44 +02:00
Harald Hoyer
c3ba62509e core/main.c: handle the initrd timestamp differently, if in the initrd
If systemd is in the initrd/initramfs, set the initrd timestamp and do
not try to read it from the RD_TIMESTAMP environment variable.
2012-05-21 18:51:05 +02:00
Harald Hoyer
e148ac5a6c core/main.c: do_switch_root(): do not remove the old root if not in initrd
Only recursively remove the old root, if we have been in an
initrd/initramfs.
2012-05-21 18:50:29 +02:00
Harald Hoyer
d03bc1b814 core/main.c: add "--switchedroot" parameter
If systemd serializes from a switch_root, it adds "--switchedroot" to
the systemd in the real root.

If "--switchedroot" is found, then we do not skip all the stuff, which
is skipped for normal rexecs.
2012-05-21 18:50:06 +02:00
Harald Hoyer
f38ed06060 manager: only serialize the timestamps for the initramfs if in_initrd() 2012-05-21 18:49:31 +02:00
Harald Hoyer
9be346c94e util.c: add in_initrd()
in_initrd() checks, if the stat() for the device for "/" is 1, which it
is for the initramfs.
2012-05-21 18:47:39 +02:00
Harald Hoyer
f67cc036ba main: corrected do_switch_root()
do_switch_root now mount moves "/dev", "/proc", "/sys", "/run" and
removes the old root recursively.
2012-05-21 18:45:10 +02:00
Nis Martensen
386da8589b delta: fix spelling of overridden 2012-05-21 18:31:43 +02:00
Frederic Crozat
4d768ced49 util: fix typo in newdup 2012-05-21 18:18:49 +02:00
Lennart Poettering
06e2968ea6 update TODO 2012-05-21 18:18:15 +02:00
Auke Kok
940c521034 sd-pam: Drop uid so parent signal arrives at child.
The PAM helper thread needs to capture the death signal from the
parent, but is prohibited from doing so since when the child dies
as normal user, the kernel won't allow it to send a TERM to the
PAM helper thread which is running as root.

This causes the PAM threads to never exit, accumulating after
user sessions exit.

There is however really no need to keep the PAM threads running as
root, so, we can just setresuid() to the same user as defined in the
unit file for the parent thread (User=). This makes the TERM signal
arrive as normal. In case setresuid() fails, we ignore the error, so
we at least fall back to the current behaviour.
2012-05-21 17:57:48 +02:00
Lennart Poettering
5b40d33761 update TODO 2012-05-21 17:55:54 +02:00
Daniel Mack
89834a7c1c journalctl: fix built-in usage output
This brings journalctl's built-in usage output in sync with the man page.
There are no commands to pass, and the help screen should not confuse
users.
2012-05-21 17:30:11 +02:00
Matthew Monaco
2a2aab602e cryptsetup: support discards (TRIM) 2012-05-21 17:28:06 +02:00
Lennart Poettering
b8f8323268 main: try a bit harder to find an init process to execute after reexec/switch-root 2012-05-21 17:26:19 +02:00
Lennart Poettering
3614084261 service: make the fsck pass no configurable 2012-05-21 17:24:26 +02:00
Lennart Poettering
f7f21d33db cryptsetup: a few simplifications 2012-05-21 17:22:40 +02:00
Lennart Poettering
344de60901 hostname-setup: also consider (ńone) an unset hostname 2012-05-21 17:19:58 +02:00
Lennart Poettering
97f25a02ee update TODO 2012-05-21 15:34:33 +02:00
Lennart Poettering
b86fa936ce update TODO 2012-05-21 15:28:07 +02:00
Lennart Poettering
78d54bd42b unit: introduce RequiredBy= setting in [Install], to complement WantedBy= 2012-05-21 15:27:26 +02:00
Lennart Poettering
6ccf7562da login: minor typo fix 2012-05-21 15:22:28 +02:00
Lennart Poettering
49dbfa7b2b units: introduce new Documentation= field and make use of it everywhere
This should help making the boot process a bit easier to explore and
understand for the administrator. The simple idea is that "systemctl
status" now shows a link to documentation alongside the other status and
decriptionary information of a service.

This patch adds the necessary fields to all our shipped units if we have
proper documentation for them.
2012-05-21 15:14:51 +02:00