Commit graph

141 commits

Author SHA1 Message Date
Lennart Poettering 5430f7f2bc relicense to LGPLv2.1 (with exceptions)
We finally got the OK from all contributors with non-trivial commits to
relicense systemd from GPL2+ to LGPL2.1+.

Some udev bits continue to be GPL2+ for now, but we are looking into
relicensing them too, to allow free copy/paste of all code within
systemd.

The bits that used to be MIT continue to be MIT.

The big benefit of the relicensing is that closed source code may now
link against libsystemd-login.so and friends.
2012-04-12 00:24:39 +02:00
Lennart Poettering f25626edf4 main: disarm watchdog when preparing for reexecution 2012-04-11 18:40:22 +02:00
Lennart Poettering 9543ad1663 main: unset some bash specific environment variables that might get leaked to us
https://bugzilla.redhat.com/show_bug.cgi?id=811537
2012-04-11 13:20:34 +02:00
Lennart Poettering 71ecc858fa main: drop container/initrd env vars from inherited set
Leave the env vars used in the container/initrd logic set for PID1, but
don't inherit them to any children.
2012-04-11 13:20:34 +02:00
Lennart Poettering 966a5d37c3 main: add URL to cgroups check message 2012-04-11 13:20:33 +02:00
Lennart Poettering e96d6be763 systemd: add hardware watchdog support
This adds minimal hardware watchdog support to PID 1. The idea is that
PID 1 supervises and watchdogs system services, while the hardware
watchdog is used to supervise PID 1.

This adds two hardware watchdog configuration options, for the runtime
watchdog and for a shutdown watchdog. The former is active during normal
operation, the latter only at reboots to ensure that if a clean reboot
times out we reboot nonetheless.

If the runtime watchdog is enabled PID 1 will automatically wake up at
half the configured interval and write to the watchdog daemon.

By default we enable the shutdown watchdog, but leave the runtime
watchdog disabled in order not to break independent hardware watchdog
daemons people might be using.

This is only the most basic hookup. If necessary we can later on hook
up the watchdog ping more closely with services deemed crucial.
2012-04-05 22:15:29 +02:00
Roberto Sassu 8161158639 main: added support for loading IMA custom policies
This is an S/MIME signed message

The new function ima_setup() loads an IMA custom policy from a file in the
default location '/etc/ima/ima-policy', if present, and writes it to the
path 'ima/policy' in the security filesystem. This function is executed
at early stage in order to avoid that some file operations are not measured
by IMA and it is placed after the initialization of SELinux because IMA
needs the latter (or other security modules) to understand LSM-specific
rules. This feature is enabled by default and can be disabled by providing
the option '--disable-ima' to the configure script.

Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
Acked-by: Gianluca Ramunno <ramunno@polito.it>
2012-03-22 00:20:58 +01:00
William Douglas 9e7c53579a systemd: Add systemd.setenv for /proc/cmdline parsing.
Check for systemd.setenv when parsing /proc/cmdline.
ex: systemd.setenv=PATH=/opt/bin
2012-02-08 16:33:55 +01:00
Lennart Poettering 2c6db6fb9b main: use a shorter default $PATH if /usr is merged 2012-02-07 15:56:28 +01:00
Michal Schmidt bacbccb78c manager: tell correctly if the manager is booting
The assumption that the initial job is the job with id==1 is incorrect.
Some jobs may be enqueued before the job that starts the default unit as
in this example:

 -.mount changed dead -> mounted
 Trying to enqueue job quotacheck.service/start/fail
 Installed new job quotacheck.service/start as 1
 Installed new job systemd-stdout-syslog-bridge.socket/start as 2
 Enqueued job quotacheck.service/start as 1
 Trying to enqueue job quotaon.service/start/fail
 Installed new job quotaon.service/start as 5
 Enqueued job quotaon.service/start as 5
 Activating default unit: default.target
 Trying to enqueue job graphical.target/start/replace

This fixes a bug where displaying of boot status messages was turned off
too early.
2012-02-02 13:39:15 +01:00
Lennart Poettering 5d6b158473 exec: include path name of binary we are about to execute when renaming forked off processes
Immediately after forking off a process change the comm name and argv[0]
to "(foobar)" where "foobar" is the basename of the path we are about to
execute.

This should be useful when charting boot progress.
2012-02-01 22:33:15 +01:00
Michal Schmidt 512947d46f main: don't force text mode in console_setup()
When systemd starts, plymouth may be already displaying progress
graphically. Do not switch the console to text mode at that time.
All other users of reset_terminal_fd() do the switch as before.

This avoids a graphical glitch with plymouth, especially visible with
vesafb, but could be also seen as a sub-second blink with radeon.

https://bugzilla.redhat.com/show_bug.cgi?id=785548
2012-01-29 21:55:51 +01:00
Michal Schmidt ac155bb885 unit: remove union Unit
Now that objects of all unit types are allocated the exact amount of
memory they need, the Unit union has lost its purpose. Remove it.

"Unit" is a more natural name for the base unit class than "Meta", so
rename Meta to Unit.

Access to members of the base class gets simplified.
2012-01-16 13:34:42 +01:00
Lennart Poettering 4cfa2c999d core: switch all log targets to go directly to the journal, instead via syslog 2012-01-12 05:09:06 +01:00
Lennart Poettering 509b6efbbe main: fix spelling 2012-01-07 01:26:08 +01:00
Lennart Poettering 706343f492 journal: introduce log target 'journal' for executed processes 2012-01-06 02:48:38 +01:00
Lennart Poettering b52aae1d93 util: move virtualization detection into its own files, and extend return codes 2011-09-23 17:00:33 +02:00
Lennart Poettering 27d340c772 fsck: show progress while fscking at boot 2011-09-01 21:05:06 +02:00
Lennart Poettering de6c78f879 service: change default stdout/stderr to syslog 2011-08-30 22:57:58 +02:00
Lennart Poettering 0c85a4f3ef cgroup: optionally mount a specific cgroup controllers together, and add cpu+cpuacct to the default 2011-08-23 00:37:35 +02:00
Lennart Poettering 7aaa27f219 main: fix reexec 2011-08-01 22:42:19 +02:00
Lennart Poettering f975e971ac load-fragment: speed up parsing by using a perfect hash table with configuration settings built by gperf 2011-08-01 00:43:05 +02:00
Lennart Poettering 07672f492e main: show load profiling in test mode, too 2011-07-31 18:13:59 +02:00
Lennart Poettering 0b3325e79e selinux: use setcon() instead of reexec to apply selinux policy 2011-07-28 23:52:23 +02:00
Lennart Poettering 058dc6f379 main: redirection to telinit is unnecessary if sysv compat is disabled 2011-07-28 23:42:47 +02:00
Lennart Poettering 9d76d730ef main: profile unit file loading 2011-07-28 23:41:57 +02:00
Lennart Poettering 871e580949 selinux: log how much time it takes to load the SELinux policy and database 2011-07-25 21:22:57 +02:00
Kay Sievers ff4daf5a34 fix hwclock_apply_localtime_delta() to properly handle negative TZ offset
Localtime may be a negative number, i.e. GMT-7. Fix based on a
patch from Kelly Anderson <kelly@silka.with-linux.com>.
2011-07-21 20:28:27 +02:00
Kay Sievers 2376ce132b clarify separate-/usr message
Everything should be fine if /usr is mounted from initramfs.
2011-07-11 02:12:42 +02:00
Lennart Poettering a755605296 manager: merge serialization and desrialization counter into one, and increase it when reexecuting
Instead of having individual counters n_serializing and n_deserializing
have a single one n_reloading, which should be sufficient.

Set n_reloading when we are about to go down for reexecution to avoid
cgroup trimming when we free the units for reexecution.
2011-07-06 00:47:42 +02:00
Lennart Poettering eeecf6e607 log: log to syslog unless connected to a tty in user mode 2011-07-01 22:35:34 +02:00
Lennart Poettering 9a0e689634 util: try harder to rename the process 2011-06-30 04:16:10 +02:00
Lennart Poettering 2076cf8831 timedated: sync clock down to RTC where necessary 2011-06-21 19:29:45 +02:00
Michal Vyskocil f8e08a77e7 main: Fix a typo emergency shall->emergency shell 2011-06-20 17:48:58 +02:00
Kay Sievers 7948c4dfbe rtc in localtime: use settimeofday(NULL, tz) instead of hwclock(8)
We check for LOCAL in /etc/adjtime and if needed, ask the kernel to
apply the timezone delta to the system clock.

The very first call of settimeofday() without a time, but a timezone
warps the system clock, so that it properly runs in UTC.
2011-05-24 20:23:07 +02:00
Lennart Poettering 6ea832a207 exec: hangup/reset/deallocate VTs in gettys
Explicitly disconnect all clients from a VT when a getty starts/finishes
(requires TIOCVHANGUP, available in 2.6.29).

Explicitly deallocate getty VTs in order to flush scrollback buffer.

Explicitly reset terminals to a defined state before spawning getty.
2011-05-18 01:07:36 +02:00
Lennart Poettering 6faa11140b status: show status messages unconditionally if plymouth is around 2011-03-30 02:21:48 +02:00
Lennart Poettering 871c44a747 taint: add missing cgroups taint flag 2011-03-30 02:12:46 +02:00
Lennart Poettering 3731f1eaa8 conf-parser: fix remaining parser functions according to new prototype 2011-03-28 23:04:30 +02:00
Kay Sievers 2b583ce657 use /run instead of /dev/.run
Instead of the /dev/.run trick we have currently implemented, we decided
to move the early-boot runtime dir to /run.

An existing /var/run directory is bind-mounted to /run. If /var/run is
already a symlink, no action is taken.

An existing /var/lock directory is bind-mounted to /run/lock.
If /var/lock is already a symlink, no action is taken.

To implement the directory vs. symlink logic, we have a:
  ConditionPathIsDirectory=
now, which is used in the mount units.

Skipped mount unit in case of symlink:
  $ systemctl status var-run.mount
  var-run.mount - Runtime Directory
    Loaded: loaded (/lib/systemd/system/var-run.mount)
    Active: inactive (dead)
            start condition failed at Fri, 25 Mar 2011 04:51:41 +0100; 6min ago
     Where: /var/run
      What: /run
    CGroup: name=systemd:/system/var-run.mount

The systemd rpm needs to make sure to add something like:
  %pre
  mkdir -p -m0755 /run >/dev/null 2>&1 || :
or it needs to be added to filesystem.rpm.

Udev -git already uses /run if that exists, and is writable at bootup.
Otherwise it falls back to the current /dev/.udev.

Dracut and plymouth need to be adopted to switch from /dev/.run to run
too.

Cheers,
Kay
2011-03-28 23:00:00 +02:00
Lennart Poettering f6a6225e41 def: centralize definition of default timeout in one place 2011-03-17 04:02:35 +01:00
Jan Engelhardt bba6cb45a5 main: revert recognition of "b" argument
Commit 099663ff8c added "b" as a
recognized argument, however, B is not a runlevel like S. (B appears
as a pseudo runlevel in openSUSE's init.d scripts only for the sake of
insserv being able to manage /etc/init.d/boot.d like the other dirs).
2011-03-16 03:53:13 +01:00
Lennart Poettering d821e6d69a main: interpret all argv[] arguments unconditionally when run in a container 2011-03-16 03:41:49 +01:00
Lennart Poettering 6ef1b05339 main: parse the whole arv[] as kernel command line 2011-03-16 02:56:30 +01:00
Lennart Poettering 90df7e567f main: log to the console in a container 2011-03-14 15:37:02 +01:00
Lennart Poettering b770165a4f main: don't parse /proc/cmdline in containers 2011-03-14 04:08:12 +01:00
Lennart Poettering 7d640cdf66 units: move the last flag files to /dev/.run 2011-03-11 01:06:53 +01:00
Lennart Poettering 099663ff8c main: properly handle -b boot option 2011-03-11 00:52:31 +01:00
Lennart Poettering fe783b0341 main: refuse system to be started in a chroot 2011-03-09 23:59:27 +01:00
Lennart Poettering b0c8757b05 main: don't check if /usr really is a mount point, since it is fine if it is passed pre-mounted to us from the initrd 2011-03-09 23:59:07 +01:00