summaryrefslogtreecommitdiff
path: root/src/core
AgeCommit message (Collapse)Author
2014-06-27main: uid_to_name() might fail due to OOM, protect against thatLennart Poettering
2014-06-26timer: name the stamp file consistentlyMichał Bartoszkiewicz
The stamp file for systemd --user timers was named stamp-foo.timer if XDG_DATA_HOME was unset, but foo.timer otherwise.
2014-06-26core/transaction: fix cycle break attempts outside transactionUoti Urpala
Patch fixes some incorrect-looking code in transaction.c. It could fix cases where Debian users with bad package configurations had systemd go into an infinite loop printing messages about breaking an ordering cycle, though I have not reproduced that problem myself. transaction_verify_order_one() considers jobs/units outside current transaction when checking whether ordering dependencies cause cycles. It would also incorrectly try to break cycles at these jobs; this cannot work, as the break action is to remove the job from the transaction, which is a no-op if the job isn't part of the transaction to begin with. The unit_matters_to_anchor() test also looks like it would not work correctly for non-transaction jobs. Add a check to verify that the unit is part of the transaction before considering a job a candidate for deletion. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=752259
2014-06-26core: Don't require cgroups xattr supportTom Hirst
Failure to mount cgroups with xattr should not be fatal
2014-06-26core: use correct format string for UIDsMichał Bartoszkiewicz
2014-06-26shutdown: rework messages during shutdownZbigniew Jędrzejewski-Szmek
When running in 'quiet' mode, the only message printed from shutdown binary would be 'Cannot finalize remaining file systems and devices, giving up.', the only log line at error level before switch back to initramfs. This is misleading, because in initramfs everything will be cleaned up properly. Avoid printing anything at error level before the attempt to switch back to initramfs. Rework the messages to contain a bit more information what is still remaining, to help people diagnose shutdown issues.
2014-06-24use more _cleanup_ macroRonny Chevalier
2014-06-24switch-root: create essential base directories at system bootupKay Sievers
This allows us to bootup a rootfs with a /usr directory only.
2014-06-24nspawn: create essential base directories at system bootupKay Sievers
This allows us to bootup a rootfs with a /usr directory only.
2014-06-23core: You can not put the cached result of use_smack fct, as we are not sure ↵Ronan Le Martret
the "/sys" is mounted. So we should mount "sys" before "/proc" https://bugs.freedesktop.org/show_bug.cgi?id=77646
2014-06-23core: make sure Environment fields passed in for transient units are ↵Hristo Venev
properly written to unit files https://bugs.freedesktop.org/show_bug.cgi?id=76744
2014-06-22core/snapshot: log info when snapshots are created and removedZbigniew Jędrzejewski-Szmek
Snapshot mechanism is not used very much, but snapshot creation/destruction should be at least as verbose as normal unit starting/stopping.
2014-06-22core/transaction: avoid misleading error message when unit not foundZbigniew Jędrzejewski-Szmek
There's no point in telling the user to look at the logs when an attempt to load the unit file failed with ENOENT. https://bugzilla.redhat.com/show_bug.cgi?id=996133
2014-06-22core/transaction: reindent and split very long linesZbigniew Jędrzejewski-Szmek
2014-06-20core: clean-up signal reset logic when reexecLennart Poettering
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.
2014-06-19main: don't show help text anymore when we detect an unknown kernel cmdline ↵Lennart Poettering
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.
2014-06-19main: honour rd.systemd.unit= only in the initrd, not the hostLennart Poettering
2014-06-18socket: check return from exec_spawnThomas Hindoe Paaboel Andersen
2014-06-18namespace: properly label device nodes we createLennart Poettering
https://bugzilla.redhat.com/show_bug.cgi?id=1081429
2014-06-17core: populate unit file set with preset data if we boot with empty /etcLennart Poettering
2014-06-17machine-id-setup: allow passing NULL as function argument, for simplicityLennart Poettering
2014-06-17kmod: conditionalize kmod setup on CAP_SYS_MODULE, not whether we run in a ↵Lennart Poettering
container It's generally preferrable to conditionalize on the actual ability to do something then the context we run in.
2014-06-17log: don't downgrade log level in non-PID 1 if "quiet" is passed on kernel ↵Lennart Poettering
cmdline "debug" should apply to all tools, but "quiet" only to PID1.
2014-06-17install: introduce new DefaultInstance= field for [Install] sectionsLennart Poettering
The DefaultInstance= name is used when enabling template units when only specifying the template name, but no instance. Add DefaultInstance=tty1 to getty@.service, so that when the template itself is enabled an instance for tty1 is created. This is useful so that we "systemctl preset-all" can work properly, because we can operate on getty@.service after finding it, and the right instance is created.
2014-06-17install: beef up preset logic to limit to only enable or only disable, and ↵Lennart Poettering
do all-unit preset operations The new "systemctl preset-all" command may now be used to put all installed units back into the enable/disable state the vendor/admin encoded in preset files. Also, introduce "systemctl --preset-mode=enable-only" and "systemctl --preset-mode=disable-only" to only apply the enable or only the disable operations of a "systemctl preset" or "systemctl preset-all" operation. "systemctl preset-all" implements this RFE: https://bugzilla.redhat.com/show_bug.cgi?id=630174
2014-06-16Reset signal-mask on re-exec to init=..Ruediger Oertel
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.
2014-06-16mount: add new SloppyOptions= setting for mount units, mapping to mount(8)'s ↵Lennart Poettering
"-s" switch
2014-06-16mount: tell /bin/mount to never touch /etc/mtabLennart Poettering
/etc/mtab should die die die. It's sad enough util-linux still contains support for it, but we don't have to partake in that charade, so let's turn this off. This is in-line with the fact that since years we already have been "tainting" systemd if we detect /etc/mtab not being a symlink... Of course, util-linux is currently broken, and still touches /etc/mtab, weven if we pass "--no-mtab" to it: https://bugzilla.redhat.com/show_bug.cgi?id=1109367 But hey, let's hope that gets fixed quickly, even if total removal of /etc/mtab support from util-linux might not happen so quickly...
2014-06-13core: don't complain at early boot if /etc/mtab is not the right symlinkLennart Poettering
When we boot up with an empty /etc it's ok if the symlink doesn't exist. We will create it later with tmpfiles.
2014-06-13os-release: define /usr/lib/os-release as fallback for /etc/os-releaseLennart Poettering
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.
2014-06-13rpm: add RPM macros to apply sysusers, sysctl, and binfmt drop-insLennart Poettering
With this in place RPMs can make sure that whatever they drop in is immeidately applied, and not delayed until next reboot. This also moves systemd-sysusers back to /usr/bin, since hardcoding the path to /usr/lib in the macros would mean compatibility breaks in future, should we turn sysusers into a command that is actually OK for people to call directly. And given that that is quite likely to happen (since it is useful to prepare images with its --root= switch), let's just prepare for it.
2014-06-13rpm: don't hardcode the binary paths in the macros, rely on $PATHLennart Poettering
this gives us a little bit more freedom to move things around later on, as we don't hardcode the systemd paths in old RPMs that shall work with new systemds.
2014-06-13core: fix invalid free() in killall()Andreas Henriksson
static int killall(....) in ./src/core/killall.c tries to get "s" initialized by calling get_process_comm(...) which calls read_one_line_file(...) which if it fails will mean it is left uninitialized. It is then used in argument to strna(s) call where it is dereferenced(!), in addition to nothing else initializing it before the scope it is in finishes.
2014-06-13core: add new ConditionNeedsUpdate= unit conditionLennart Poettering
This new condition allows checking whether /etc or /var are out-of-date relative to /usr. This is the counterpart for the update flag managed by systemd-update-done.service. Services that want to be started once after /usr got updated should use: [Unit] ConditionNeedsUpdate=/etc Before=systemd-update-done.service This makes sure that they are only run if /etc is out-of-date relative to /usr. And that it will be executed after systemd-update-done.service which is responsible for marking /etc up-to-date relative to the current /usr. ConditionNeedsUpdate= will also checks whether /etc is actually writable, and not trigger if it isn't, since no update is possible then.
2014-06-13condition: minor modernizationsLennart Poettering
2014-06-10machine-id-setup: fix array size of parametersLennart Poettering
Not that it really would have any effect on the generated code, but let's not confuse people...
2014-06-07Fix spelling mistake, proces -> processColin Ian King
2014-06-07Remove sysv parser from service.cThomas Hindoe Paaboel Andersen
Parsing sysv files was moved to the sysv-generator in the previous commit. This patch removes the sysv parsing from serivce.c. Note that this patch drops the following now unused sysv-specific info from service dump: "SysV Init Script has LSB Header: (yes/no)" "SysVEnabled: (yes/no)" "SysVRunLevels: (levels)"
2014-06-07core: allow transient mount unitsTom Gundersen
For now only What=, Options=, Type= are supported, and Where= is deduced from the unit name.
2014-06-06fix warningsThomas Hindoe Paaboel Andersen
Prevent use of uninitialized variable and removed a now unused cleanup function for freeaddrinfo
2014-06-06namespace: cover /boot with ProtectSystem= againLennart Poettering
Now that we properly exclude autofs mounts from ProtectSystem= we can include it in the effect of ProtectSystem= again.
2014-06-06namespace: beef up read-only bind mount logicLennart Poettering
Instead of blindly creating another bind mount for read-only mounts, check if there's already one we can use, and if so, use it. Also, recursively mark all submounts read-only too. Also, ignore autofs mounts when remounting read-only unless they are already triggered.
2014-06-05namespace: also include /root in ProtectHome=Lennart Poettering
/root can't really be autofs, and is also a home, directory, so cover it with ProtectHome=.
2014-06-05namespace: when setting up an inaccessible mount point, unmounting ↵Lennart Poettering
everything below This has the benefit of not triggering any autofs mount points unnecessarily.
2014-06-05umount: modernizationsLennart Poettering
2014-06-05core: introduce new Restart=on-abnormal settingLennart Poettering
Restart=on-abnormal is similar to Restart=on-failure, but avoids restarts on unclean exit codes (but still doing restarts on all obviously unclean exits, such as timeouts, signals, coredumps, watchdog timeouts). Also see: https://fedorahosted.org/fpc/ticket/191
2014-06-05kdbus: when uploading bus name policy, resolve users/groups out-of-processLennart Poettering
It's not safe invoking NSS from PID 1, hence fork off worker processes that upload the policy into the kernel for busnames.
2014-06-05core: don't include /boot in effect of ProtectSystem=Lennart Poettering
This would otherwise unconditionally trigger any /boot autofs mount, which we probably should avoid. ProtectSystem= will now only cover /usr and (optionally) /etc, both of which cannot be autofs anyway. ProtectHome will continue to cover /run/user and /home. The former cannot be autofs either. /home could be, however is frequently enough used (unlikey /boot) so that it isn't too problematic to simply trigger it unconditionally via ProtectHome=.
2014-06-05socket: add SocketUser= and SocketGroup= for chown()ing sockets in the file ↵Lennart Poettering
system This is relatively complex, as we cannot invoke NSS from PID 1, and thus need to fork a helper process temporarily.
2014-06-04core: make sure we properly parse ProtectHome= and ProtectSystem=Lennart Poettering