summaryrefslogtreecommitdiff
path: root/src/core/unit.c
AgeCommit message (Collapse)Author
2013-04-03util: rename write_one_line_file() to write_string_file()Lennart Poettering
You can write much more than just one line with this call (and we frequently do), so let's correct the naming.
2013-04-02Replace s/Dropin/DropIn/Zbigniew Jędrzejewski-Szmek
2013-04-01Introspect and monitor dropin configurationOleksii Shevchuk
2013-03-23unit: never retroactively start requisitesLennart Poettering
Requesites are not supposed to be auto-started afterall, they are just checks, so don't try to be smarter here than appropriate. Based on a patch from Michal Schmidt.
2013-03-22exec: Assigning the empty string to CapabilityBoundSet= should drop all capsLennart Poettering
Previously, it would set all caps, but it should drop them all, anything else makes little sense. Also, document that this works as it does, and what to do in order to assign all caps to the bounding set. https://bugzilla.redhat.com/show_bug.cgi?id=914705
2013-03-13core: single unit_kill implementation for all unit typesMichal Schmidt
There are very few differences in the implementations of the kill method in the unit types that have one. Let's unify them. This does not yet unify unit_kill() with unit_kill_context().
2013-03-02unit: count deserialized job only after it's definitely installedMichal Schmidt
Installation of a deserialized job may fail (though purely in theory), so increase the running job counter only when succeeding.
2013-03-01core: fix running jobs counters after reload/reexecMichal Schmidt
All active units will call unit_notify() during coldplug, so we just make sure we're counting from zero again and get the correct result for n_on_console. For n_running_jobs we likewise reset it to zero and then count the running jobs as we encounter them in deserialization.
2013-03-01unit: fix the race in deserialization.Oleksii Shevchuk
unit_notify is fired in deserelization code (particulary in service_set_state). Units passed in random order, and there is possibility, that unit with StopWhenUnneeded=yes passed before it actual dependecies. In that case unit will be stopped as unneeded, because deps in UNIT_INACTIVE state yet. So, reuse similar logic (unit.c:1421) to avoid this race
2013-02-28core: count active units that may mind our printing to /dev/consoleMichal Schmidt
2013-02-28core/unit: use a temp variable for manager pointer in unit_notify()Michal Schmidt
2013-02-28core: redefine unit_status_printf()Michal Schmidt
Take advantage of the fact that almost all callers want to pass unit description as the last parameter. Those who don't can use the more flexible manager_status_printf().
2013-02-28core: add manager_status_printf()Michal Schmidt
unit_status_printf() checks the state of the manager, not of the unit as such. Move it to manager.c and rename it to manager_status_printf(). Temporarily keep unit_status_printf as a wrapper macro.
2013-02-27unit: rework resource management APILennart Poettering
This introduces a new static list of known attributes and their special semantics. This means that cgroup attribute values can now be automatically translated from user to kernel notation for command line set settings, too. This also adds proper support for multi-line attributes.
2013-02-16unit: don't Require systemd-journald.socket from unitsMichal Schmidt
It is not really necessary to have a hard requirement dependency on systemd-journald.socket in almost every unit. The socket gets pulled into boot via at least two ways: sockets.target -> systemd-journald.socket sysinit.target -> systemd-journald.service -> systemd-journald.socket So just assume something pulled the socket in and drop the automatic requirement dependencies on it. "systemctl stop systemd-journald.socket" will now not take the whole system down with it.
2013-02-14honor SELinux labels, when creating and writing config filesHarald Hoyer
Also split out some fileio functions to fileio.c and provide a SELinux aware pendant in fileio-label.c see https://bugzilla.redhat.com/show_bug.cgi?id=881577
2013-01-26core: unify kill code of mount, service, socket, swap unitsLennart Poettering
2013-01-19unit: fix typoLennart Poettering
2013-01-19unit: optionally allow making cgroup attribute changes persistentLennart Poettering
2013-01-19cgroup: additional validity checks for cgroup attribute namesLennart Poettering
2013-01-18core: log USER_UNIT instead of UNIT if in user sessionMirco Tischler
2013-01-17core: corrects check of strduped controller stringNestor Ovroy
In commit 246aa6d (core: add bus API and systemctl commands for altering cgroup parameters during runtime), when rewriting unit_add_one_default_cgroup to prefered style, the check of strduped b->controller was incorrectly changed to check the containing structure. Correct it.
2013-01-14core: add bus API and systemctl commands for altering cgroup parameters ↵Lennart Poettering
during runtime
2013-01-11unit: allow extension of unit files with .d/*.conf drop-insLennart Poettering
For all unit files foobar.service we will now read foobar.service.d/*.conf, too. This may be used to override certain unit settings without having to edit unit files directly. This makes it really easy to change specific settings for services without having to edit any unit file: mkdir /etc/systemd/system/avahi-daemon.service.d/ echo -e '[Service]\nNice=99' > /etc/systemd/system/avahi-daemon.service.d/nice.conf systemctl daemon-reload
2012-11-23timer: implement calendar time eventsLennart Poettering
2012-11-22manager: introduce watch_init() initializer for watchesLennart Poettering
2012-10-18systemd: use structured logging for unit changesZbigniew Jędrzejewski-Szmek
Information which unit a log entry pertains to enables systemctl status to display more log messages.
2012-10-13log: introduce a macro to format message idZbigniew Jędrzejewski-Szmek
The MESSAGE_ID=... stanza will appear in countless number of places. It is just too long to write it out in full each time. Incidentally, this also fixes a typo of MESSSAGE is three places.
2012-09-18core: move ManagerRunningAs to sharedZbigniew Jędrzejewski-Szmek
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-18unit-printf: before resolving exec context specifiers check whether the ↵Lennart Poettering
object actually has an exec context
2012-09-18unit: split unit_printf() and friends into its own .c fileLennart Poettering
2012-09-18unit: fix %f resolvingLennart Poettering
2012-09-17conf-parser: don't unescape parsed configuration strings by defaultLennart Poettering
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-13man: fix a bunch of typos in docsThomas Hindoe Paaboel Andersen
https://bugs.freedesktop.org/show_bug.cgi?id=54501
2012-09-10unit: don't allow units to be gc'ed that still are referenced via UnitRefLennart Poettering
2012-09-03journal: suppress structured messages if they'd go to the consoleLennart Poettering
2012-09-03journal: generate structured journal messages for a number of eventsLennart Poettering
2012-07-26unit: add missing deps in unit_dependency_tableMichal Schmidt
also reorder the table according to the enum order.
2012-07-26unit: make the table of inverse deps symmetricMichal Schmidt
2012-07-26systemd: added new dependency PartOfMichal Sekletar
This should address TODO item "new dependency type to "group" services in a target". Semantic of new dependency is as follows. Once configured it creates dependency which will cause that all dependent units get stopped if unit they all depend on is stopped or restarted. Usual use case would be configuring PartOf=some.target in template unit file and WantedBy=some.target in [Install] section and enabling desired number of instances. In this case starting one instance won't pull in target but stopping or starting target(in case of WantedBy is properly configured) will cause stop/start of all instances.
2012-07-20units: apply default resource limits to socket/mount/swap processes tooLennart Poettering
2012-07-20core: drop KillMode parameter from KillUnit() bus callLennart Poettering
It made no sense, and since we are documenting the bus calls now and want to include them in our stability promise we really should get it cleaned up sooner, not later.
2012-07-18unit: don't serialize job state, only unit state across switch-rootLennart Poettering
2012-07-16unit: set default working directory to the user's home directory when ↵Lennart Poettering
running in user mode
2012-07-16unit: introduce %s specifier for the user shellLennart Poettering
2012-07-16unit: printf specifiers %u and %h: $USER and $HOME.Auke Kok
These printf specifiers allow us to refer to $HOME and $USER in unit files. These are particularly helpful in instanced units that have "User=" set, and in systemd --user domains. The specifiers will return the pw_name and pw_dir fields if the unit file has a User= field. If the unit file does not have a User= field, the value substituted is either $USER or $HOME from the environment, or, if unset, the values from pw_name or pw_dir. This patch is somewhat after Ran Benita's original patch, which didn't get merged. I've split up the 2 specifiers and extended them to do what is logically expected from these specifiers. Note that expansion is done at `start` time, not after the units are parsed. Using `systemctl show` will just show the specifiers.
2012-07-13unit: rename BindTo= to BindsTo=Lennart Poettering
all other dependencies are in 3rd person. Change BindTo= accordingly to BindsTo=. Of course, the dependency is widely used, hence we parse the old name too for compatibility.
2012-07-13util: rename join() to strjoin()Lennart Poettering
This is to match strappend() and the other string related functions.
2012-07-10unit: Move UnitLoadState definitions from core/unit.c to shared/unit-name.cZbigniew Jędrzejewski-Szmek
This makes it possible to use them from systemctl without linking against the core.
2012-07-10unit-name: remove unit_name_is_valid_no_type() and move unit_name_is_valid() ↵Lennart Poettering
to unit-name.h