summaryrefslogtreecommitdiff
path: root/src/core/main.c
Commit message (Collapse)AuthorAge
...
* core: only set the kernel's timezone when the RTC runs in local timeKay Sievers2014-07-27
| | | | | | | | | | | | | | | | | | | We can not reliably manage any notion of local time. Every daylight saving time change or time zone change by traveling will make the time jump, and the local time might jump backwards which creates unsolvable problems with file timestamps. We will no longer tell the kernel our local time zone and leave everything set to UTC. This will effectively turn FAT timestamps into UTC timestamps. If and only if the machine is configured to read the RTC in local time mode, the kernel's time zone will be configured, but systemd-timesysnc will disable the kernel's system time to RTC syncing. In this mode, the RTC will not be managed, and external tools like Windows bootups are expected to manage the RTC's time. https://bugs.freedesktop.org/show_bug.cgi?id=81538
* test-engine: fix access to unit load pathZbigniew Jędrzejewski-Szmek2014-07-20
| | | | | | | | Also add a bit of debugging output to help diagnose problems, add missing units, and simplify cppflags. Move test-engine to normal tests from manual tests, it should now work without destroying the system.
* systemd: use pager for --test and --helpZbigniew Jędrzejewski-Szmek2014-07-20
|
* Let config_parse open file where applicableZbigniew Jędrzejewski-Szmek2014-07-16
| | | | | | | | Special care is needed so that we get an error message if the file failed to parse, but not when it is missing. To avoid duplicating the same error check in every caller, add an additional 'warn' boolean to tell config_parse whether a message should be issued. This makes things both shorter and more robust wrt. to error reporting.
* Constify ConfigTableItem tablesZbigniew Jędrzejewski-Szmek2014-07-15
|
* firstboot: get rid of firstboot generator again, introduce ↵Lennart Poettering2014-07-07
| | | | | | | | ConditionFirstBoot= instead As Zbigniew pointed out a new ConditionFirstBoot= appears like the nicer way to hook in systemd-firstboot.service on first boots (those with /etc unpopulated), so let's do this, and get rid of the generator again.
* firstboot: add new component to query basic system settings on first boot, ↵Lennart Poettering2014-07-07
| | | | | | | | | | | | | | | | | | | | or when creating OS images offline A new tool "systemd-firstboot" can be used either interactively on boot, where it will query basic locale, timezone, hostname, root password information and set it. Or it can be used non-interactively from the command line when prepareing disk images for booting. When used non-inertactively the tool can either copy settings from the host, or take settings on the command line. $ systemd-firstboot --root=/path/to/my/new/root --copy-locale --copy-root-password --hostname=waldi The tool will be automatically invoked (interactively) now on first boot if /etc is found unpopulated. This also creates the infrastructure for generators to be notified via an environment variable whether they are running on the first boot, or not.
* main: explain our /etc empty check a bit in a commentLennart Poettering2014-07-07
|
* main: change check whether /etc is unpopulated to look for /etc/machine-idLennart Poettering2014-07-04
| | | | | | | | | | Previously, we checked whether /etc was completely empty. This makes it difficult though for container managers such as nspawn to install a small number of files (such as /etc/timezone), and have the system otherwise populate its own tree. Hence, change this by looking for /etc/machine-id, which should be a good sign whether /etc is populated or not.
* main: uid_to_name() might fail due to OOM, protect against thatLennart Poettering2014-06-27
|
* core: use correct format string for UIDsMichał Bartoszkiewicz2014-06-26
|
* core: clean-up signal reset logic when reexecLennart Poettering2014-06-20
| | | | | | There's no need to save the old sigmask, if we are going to die. Let's simplify this. Also, reset all the signal handlers, so that we don't leave SIG_IGN set for some of them across reexec.
* main: don't show help text anymore when we detect an unknown kernel cmdline ↵Lennart Poettering2014-06-19
| | | | | | | | | | | | value starting with "systemd." As generators and other components started to maintain their own kernel command line options this help text needed more and more exceptions and wasn't complete anyway. Fixing that would leak more information about specific generators into PID 1, which we should avoid. Given that kernel cmdline handling traditionally doesn't generate errors or show help texts, let's just remove the logic for it for systemd too.
* main: honour rd.systemd.unit= only in the initrd, not the hostLennart Poettering2014-06-19
|
* core: populate unit file set with preset data if we boot with empty /etcLennart Poettering2014-06-17
|
* machine-id-setup: allow passing NULL as function argument, for simplicityLennart Poettering2014-06-17
|
* kmod: conditionalize kmod setup on CAP_SYS_MODULE, not whether we run in a ↵Lennart Poettering2014-06-17
| | | | | | | container It's generally preferrable to conditionalize on the actual ability to do something then the context we run in.
* log: don't downgrade log level in non-PID 1 if "quiet" is passed on kernel ↵Lennart Poettering2014-06-17
| | | | | | cmdline "debug" should apply to all tools, but "quiet" only to PID1.
* Reset signal-mask on re-exec to init=..Ruediger Oertel2014-06-16
| | | | | | | | | Process 1 (aka init) needs to be started with an empty signal mask. That includes the process 1 that's started after the initrd is finished. When the initrd is using systemd (as it does with dracut based initrds) then it is systemd that calls the real init. Normally this is systemd again, except when the user uses for instance "init=/bin/bash" on the kernel command line.
* core: don't complain at early boot if /etc/mtab is not the right symlinkLennart Poettering2014-06-13
| | | | | When we boot up with an empty /etc it's ok if the symlink doesn't exist. We will create it later with tmpfiles.
* os-release: define /usr/lib/os-release as fallback for /etc/os-releaseLennart Poettering2014-06-13
| | | | | | | | | | | | | | | | The file should have been in /usr/lib/ in the first place, since it describes the OS container in /usr (and not the configuration in /etc), hence, let's support os-release files in /usr/lib as fallback if no version in /etc exists, following the usual override logic. A prior commit already enabled tmpfiles to create /etc/os-release as a symlink to /usr/lib/os-release should it be missing, thus providing nice compatibility with applications only checking in /etc. While it's probably a good idea if all apps check both locations via a fallback logic, it is only necessary in the early boot process, as long as the /etc/os-release symlink has not been restored, in case we boot with an empty /etc.
* virt: rework container detection logicLennart Poettering2014-05-28
| | | | | | | | | | | | Instead of accessing /proc/1/environ directly, trying to read the $container variable from it, let's make PID 1 save the contents of that variable to /run/systemd/container. This allows us to detect containers without the need for CAP_SYS_PTRACE, which allows us to drop it from a number of daemons and from the file capabilities of systemd-detect-virt. Also, don't consider chroot a container technology anymore. After all, we don't consider file system namespaces container technology anymore, and hence chroot() should be considered a container even less.
* shared: rename hwclock.[ch] to clock-util.[ch]Kay Sievers2014-05-24
|
* cgroups: simplify CPUQuota= logicLennart Poettering2014-05-22
| | | | | | | | | Only accept cpu quota values in percentages, get rid of period definition. It's not clear whether the CFS period controllable per-cgroup even has a future in the kernel, hence let's simplify all this, hardcode the period to 100ms and only accept percentage based quota values.
* core: require cgroups filesystem to be availableKay Sievers2014-05-05
| | | | | We should no longer pretend that we can run in any sensible way without the kernel supporting us with cgroups functionality.
* core: expose CFS CPU time quota as high-level unit propertiesLennart Poettering2014-04-25
|
* reduce the amount of messages logged to /dev/kmsg when "debug" is specifiedKay Sievers2014-04-06
|
* core: add a setting to globally control the default for timer unit accuracyLennart Poettering2014-03-24
|
* util: replace close_nointr_nofail() by a more useful safe_close()Lennart Poettering2014-03-18
| | | | | | | | | | | | | | | safe_close() automatically becomes a NOP when a negative fd is passed, and returns -1 unconditionally. This makes it easy to write lines like this: fd = safe_close(fd); Which will close an fd if it is open, and reset the fd variable correctly. By making use of this new scheme we can drop a > 200 lines of code that was required to test for non-negative fds or to reset the closed fd variable afterwards.
* machine-id: add --root option to operate on an alternate fs treeGreg KH2014-03-14
| | | | | | | | | This makes it possible to initialize the /etc/machine-id file on an arbitrary filesystem hierarchy. This helps systems that wish to run this at image creation time in a subdirectory, or from initramfs before pivot-root is called. [tomegun: converted to using _cleanup_free_ macros]
* fix off by one error in array index assertionDave Reisner2014-03-08
| | | | | | | | | | | | | Since the index is already post-incremented when the array is appended to, this assertion can be wrongly reached when the array is at capacity (with the NULL terminator). The bug is reproducible on shutdown with the following settings in /etc/systemd/system.conf: LogTarget=journal-or-kmsg LogColor=yes LogLocation=yes Reported by Thermi on IRC.
* gpt-auto-generator: automatically find the root disk of the systemLennart Poettering2014-03-07
| | | | | | | | | | | | | | | When run in an initrd and no root= argument is set (or is set to root=gpt-auto) we will automatically look for the root partition on the same disk the EFI ESP is located on. Since we look for swap, /home and /srv on the disk the root partition is located on, we hence have a fully discoverable chain: Firmware discovers the EFI ESP partition → the initrd discovers the root partition → the host OS discovers swap, /home, and /srv. Note that this requires an EFI boot loader that sets the LoaderDevicePartUUID EFI variable, such as Gummiboot.
* util: move more intellegince into parse_proc_cmdline()Lennart Poettering2014-03-06
| | | | | Already split variable assignments before invoking the callback. And drop "rd." settings if we are not in an initrd.
* missing: if RLIMIT_RTTIME is not defined by the libc, then we need a new ↵Lennart Poettering2014-03-05
| | | | define for the max number of rlimits, too
* core: move ShowStatus type into the coreLennart Poettering2014-03-03
| | | | | Let's make the scope of the show-status stuff a bit smaller, and make it private to the core, rather than shared API in shared/.
* execute: no need to include seccomp.h from execute.hLennart Poettering2014-03-03
|
* core: add global settings for enabling CPUAccounting=, MemoryAccounting=, ↵Lennart Poettering2014-02-24
| | | | BlockIOAccounting= for all units at once
* smack: set loaded_policy in smack_setup()Łukasz Stelmach2014-02-24
| | | | With loaded_policy set to true mount_setup() relabels /dev properly.
* hostnamectl: should the sanitized arch, not the native uname() oneLennart Poettering2014-02-21
|
* main: make gcc shut upLennart Poettering2014-02-17
|
* core: fixate show_status earlier, so that we actually print the welcome messageLennart Poettering2014-02-17
| | | | | | Previously, we'd fixed show_state only after printing the welcome message which had the effect that the welcome message was almost always suppressed.
* main: don't set no_new_privs when using SystemCallArchitectures= system-wideLennart Poettering2014-02-17
| | | | After all, we want to allow userspace to get new privs...
* Pass log config from systemd to systemd-shutdownZbigniew Jędrzejewski-Szmek2014-02-17
| | | | | | | If PID 1 debug logging is enabled, it is nice to keep those settings when switching to systemd-shutdown binary, independently of whether this was done through /proc/cmdline options, or through runtime manipulations.
* Some modernizationsZbigniew Jędrzejewski-Szmek2014-02-17
|
* Extract looping over /proc/cmdline into a shared functionZbigniew Jędrzejewski-Szmek2014-02-17
| | | | | | | In cryptsetup-generator automatic cleanup had to be replaced with manual cleanup, and the code gets a bit longer. But existing code had the issue that it returned negative values from main(), which was wrong, so should be reworked anyway.
* seccomp: fix build again if libseccomp is missingLennart Poettering2014-02-13
|
* core: add a system-wide SystemCallArchitectures= settingLennart Poettering2014-02-13
| | | | | | This is useful to prohibit execution of non-native processes on systems, for example 32bit binaries on 64bit systems, this lowering the attack service on incorrect syscall and ioctl 32→64bit mappings.
* manager: add systemd.show_status=auto modeZbigniew Jędrzejewski-Szmek2014-01-27
| | | | | | | | | | | | | When set to auto, status will shown when the first ephemeral message is shown (a job has been running for five seconds). Then until the boot or shutdown ends, status messages will be shown. No indication about the switch is done: I think it should be clear for the user that first the cylon eye and the ephemeral messages appear, and afterwards messages are displayed. The initial arming of the event source was still wrong, but now should really be fixed.
* Improve messages about user mode a bitZbigniew Jędrzejewski-Szmek2014-01-08
|
* Remove unused variablesZbigniew Jędrzejewski-Szmek2014-01-05
|