summaryrefslogtreecommitdiff
path: root/src/core/load-fragment.c
Commit message (Collapse)AuthorAge
...
* core: replace OnFailureIsolate= setting by a more generic OnFailureJobMode= ↵Lennart Poettering2013-11-26
| | | | setting and make use of it where applicable
* conf-parser: distinguish between multiple sections with the same nameTom Gundersen2013-11-25
| | | | | | | | | | | | | | | | | | | | | | | Pass on the line on which a section was decleared to the parsers, so they can distinguish between multiple sections (if they chose to). Currently no parsers take advantage of this, but a follow-up patch will do that to distinguish [Address] Address=192.168.0.1/24 Label=one [Address] Address=192.168.0.2/24 Label=two from [Address] Address=192.168.0.1/24 Label=one Address=192.168.0.2/24 Label=two
* socket: fix segfaultLennart Poettering2013-11-21
|
* core: convert PID 1 to libsystemd-busLennart Poettering2013-11-20
| | | | | | | | | | | | | | | | | | | | | | This patch converts PID 1 to libsystemd-bus and thus drops the dependency on libdbus. The only remaining code using libdbus is a test case that validates our bus marshalling against libdbus' marshalling, and this dependency can be turned off. This patch also adds a couple of things to libsystem-bus, that are necessary to make the port work: - Synthesizing of "Disconnected" messages when bus connections are severed. - Support for attaching multiple vtables for the same interface on the same path. This patch also fixes the SetDefaultTarget() and GetDefaultTarget() bus calls which used an inappropriate signature. As a side effect we will now generate PropertiesChanged messages which carry property contents, rather than just invalidation information.
* core: some more _cleanup_free_Zbigniew Jędrzejewski-Szmek2013-11-15
|
* clients: various simplificationsLennart Poettering2013-11-06
|
* mount/service: drop FsckPassNo supportTom Gundersen2013-10-19
| | | | | | | | We now treat passno as boleans in the generators, and don't need this any more. fsck itself is able to sequentialize checks on the same local media, so in the common case the ordering is redundant. It is still possible to force an order by using .d fragments, in case that is desired.
* list: make our list macros a bit easier to use by not requring type spec on ↵Lennart Poettering2013-10-14
| | | | | | | each invocation We can determine the list entry type via the typeof() gcc construct, and so we should to make the macros much shorter to use.
* Make sure that we don't dereference NULLZbigniew Jędrzejewski-Szmek2013-10-13
| | | | | | | The code was actually safe, because b should never be null, because if rvalue is empty, a different branch is taken. But we *do* check for NULL in the loop above, so it's better to also check here for symmetry.
* Do not use unitialized variable and remove duplicated lineZbigniew Jędrzejewski-Szmek2013-09-27
|
* core: rework how we match mount units against each otherLennart Poettering2013-09-26
| | | | | | | | | | | | | | | | | | | | | | | Previously to automatically create dependencies between mount units we matched every mount unit agains all others resulting in O(n^2) complexity. On setups with large amounts of mount units this might make things slow. This change replaces the matching code to use a hashtable that is keyed by a path prefix, and points to a set of units that require that path to be around. When a new mount unit is installed it is hence sufficient to simply look up this set of units via its own file system paths to know which units to order after itself. This patch also changes all unit types to only create automatic mount dependencies via the RequiresMountsFor= logic, and this is exposed to the outside to make things more transparent. With this change we still have some O(n) complexities in place when handling mounts, but that's currently unavoidable due to kernel APIs, and still substantially better than O(n^2) as before. https://bugs.freedesktop.org/show_bug.cgi?id=69740
* cgroup: get rid of MemorySoftLimit=Lennart Poettering2013-09-17
| | | | | | | The cgroup attribute memory.soft_limit_in_bytes is unlikely to stay around in the kernel for good, so let's not expose it for now. We can readd something like it later when the kernel guys decided on a final API for this.
* specifier: rework specifier calls to return proper error messageLennart Poettering2013-09-17
| | | | | | Previously the specifier calls could only indicate OOM by returning NULL. With this change they will return negative errno-style error codes like everything else.
* blkio bandwidth: don't clean up all of entries in blockio_device_bandwidths listGao feng2013-09-10
| | | | | if we get BlockIOReadBandwidth="", we should only remove the read-bandwidth-entries in blockio_device_bandwidths list.
* blcokio bandwidth: add missing set of CGroupBlockIODeviceBandwidth's readGao feng2013-08-28
| | | | | | | BlockIOReadBandwidth and BlockIOWriteBandwidth both use config_parse_blockio_bandwidth to set up CGroupBlockIODeviceBandwidth, We should set the read value based on the left values in config files.
* core: update configuration directive list "systemd ↵Lennart Poettering2013-07-19
| | | | --dump-configuration-items" shows
* cgroup: split out per-device BlockIOWeight= setting into BlockIODeviceWeight=Lennart Poettering2013-07-11
| | | | | This way we can nicely map the configuration directive to properties and back, without requiring two different signatures for the same property.
* core: add transient unitsLennart Poettering2013-06-28
| | | | | | | | | | | | | | | | | | Transient units can be created via the bus API. They are configured via the method call parameters rather than on-disk files. They are subject to normal GC. Transient units currently may only be created for services (however, we will extend this), and currently only ExecStart= and the cgroup parameters can be configured (also to be extended). Transient units require a unique name, that previously had no configuration file on disk. A tool systemd-run is added that makes use of this functionality to run arbitrary command lines as transient services: $ systemd-run /bin/ping www.heise.de Will cause systemd to create a new transient service and run ping in it.
* core: general cgroup reworkLennart Poettering2013-06-27
| | | | | | | | | | | | | | | | Replace the very generic cgroup hookup with a much simpler one. With this change only the high-level cgroup settings remain, the ability to set arbitrary cgroup attributes is removed, so is support for adding units to arbitrary cgroup controllers or setting arbitrary paths for them (especially paths that are different for the various controllers). This also introduces a new -.slice root slice, that is the parent of system.slice and friends. This enables easy admin configuration of root-level cgrouo properties. This replaces DeviceDeny= by DevicePolicy=, and implicitly adds in /dev/null, /dev/zero and friends if DeviceAllow= is used (unless this is turned off by DevicePolicy=).
* manager: add DefaultEnvironment optionUmut Tezduyar2013-06-20
| | | | | | | This complements existing functionality of setting variables through 'systemctl set-environment', the kernel command line, and through normal environment variables for systemd in session mode.
* core: add new .slice unit type for partitioning systemsLennart Poettering2013-06-17
| | | | | | | | | | | | In order to prepare for the kernel cgroup rework, let's introduce a new unit type to systemd, the "slice". Slices can be arranged in a tree and are useful to partition resources freely and hierarchally by the user. Each service unit can now be assigned to one of these slices, and later on login users and machines may too. Slices translate pretty directly to the cgroup hierarchy, and the various objects can be assigned to any of the slices in the tree.
* conf-parser: restrict .include usageLennart Poettering2013-04-25
| | | | | Disallow recursive .include, and make it unavailable in anything but unit files.
* Add set_consume which always takes ownershipZbigniew Jędrzejewski-Szmek2013-04-24
| | | | Freeing in error path is the common pattern with set_put().
* unit: rework trigger dependency logicLennart Poettering2013-04-23
| | | | | | | | | | | Instead of having explicit type-specific callbacks that inform the triggering unit when a triggered unit changes state, make this generic so that state changes are forwarded betwee any triggered and triggering unit. Also, get rid of UnitRef references from automount, timer, path units, to the units they trigger and rely exclsuively on UNIT_TRIGGER type dendencies.
* move _cleanup_ attribute in front of the typeHarald Hoyer2013-04-18
| | | | http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html
* Move bus_error to dbus-common and remove bus_error_message_or_strerrorSimon Peeters2013-04-18
| | | | | bus_error and bus_error_message_or_strerror dit almost exactly the same, so use only one of them and place it in dbus-common.
* core/main: use _cleanup_Zbigniew Jędrzejewski-Szmek2013-04-17
|
* Report about syntax errors with metadataZbigniew Jędrzejewski-Szmek2013-04-17
| | | | | | | | | | | | | The information about the unit for which files are being parsed is passed all the way down. This way messages land in the journal with proper UNIT=... or USER_UNIT=... attribution. 'systemctl status' and 'journalctl -u' not displaying those messages has been a source of confusion for users, since the journal entry for a misspelt setting was often logged quite a bit earlier than the failure to start a unit. Based-on-a-patch-by: Oleksii Shevchuk <alxchk@gmail.com>
* util: rename parse_usec() to parse_sec() sinds the default unit is secondsLennart Poettering2013-04-03
| | | | | | | | Internally we store all time values in usec_t, however parse_usec() actually was used mostly to parse values in seconds (unless explicit units were specified to define a different unit). Hence, be clear about this and name the function about what we pass into it, not what we get out of it.
* execute: convert secure bits into mask properlyZbigniew Jędrzejewski-Szmek2013-03-31
| | | | C.f. http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=5975c725dfd6f7d36f493ab1453fbdbd35c1f0e3
* exec: Assigning the empty string to CapabilityBoundSet= should drop all capsLennart Poettering2013-03-22
| | | | | | | | | | 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
* specifier: when resolving specifier strings when loading configuration, ↵Lennart Poettering2013-03-01
| | | | | | don't misunderstand parse failures as OOM http://lists.freedesktop.org/archives/systemd-devel/2013-February/009179.html
* unit: rework resource management APILennart Poettering2013-02-27
| | | | | | | | | 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.
* use strneq instead of strncmpThomas Hindoe Paaboel Andersen2013-02-13
|
* core: properly validate environment data from Environment= lines in unit filesLennart Poettering2013-02-11
|
* execute: Fix seccomp support on x32Jonathan Callen2013-01-19
| | | | | | | | In the x32 ABI, syscall numbers start at 0x40000000. Mask that bit on x32 for lookups in the syscall_names array and syscall_filter and ensure that syscall.h is parsed correctly. [zj: added SYSCALL_TO_INDEX, INDEX_TO_SYSCALL macros.]
* units: for all unit settings that take lists, allow the empty string for ↵Lennart Poettering2013-01-17
| | | | | | resetting the lists https://bugzilla.redhat.com/show_bug.cgi?id=756787
* load-fragment: fix bad memory accessLennart Poettering2013-01-15
|
* load-fragment: replace specifiers in path unit's Unit= settingLennart Poettering2013-01-15
|
* core: add bus API and systemctl commands for altering cgroup parameters ↵Lennart Poettering2013-01-14
| | | | during runtime
* timer: implement calendar time eventsLennart Poettering2012-11-23
|
* core/load-fragment: fix (potential) bad memory accessZbigniew Jędrzejewski-Szmek2012-11-19
| | | | | | | strncmp() could be used with size bigger then the size of the string, because MAX was used instead of MIN. If failing, print just the offending mount flag.
* core/load-fragment: be more precise in error messagesZbigniew Jędrzejewski-Szmek2012-11-19
| | | | | | | | | Whenever a message fails, mention the offending word, instead of just giving the whole line. If one bad word causes just this word to be rejected, print only the word. If one bad word causes the whole line to be rejected, print the whole line too. https://bugs.freedesktop.org/show_bug.cgi?id=56874
* sched: Only setting CPUSchedulingPriority=rr doesn't workHolger Hans Peter Freyther2012-11-15
| | | | | | | | | | | | | | | | | | | A service that only sets the scheduling policy to round-robin fails to be started. This is because the cpu_sched_priority is initialized to 0 and is not adjusted when the policy is changed. Clamp the cpu_sched_priority when the scheduler policy is set. Use the current policy to validate the new priority. Change the manual page to state that the given range only applies to the real-time scheduling policies. Add a testcase that verifies this change: $ make test-sched-prio; ./test-sched-prio [test/sched_idle_bad.service:6] CPU scheduling priority is out of range, ignoring: 1 [test/sched_rr_bad.service:7] CPU scheduling priority is out of range, ignoring: 0 [test/sched_rr_bad.service:8] CPU scheduling priority is out of range, ignoring: 100
* core: lift restriction on order of - and @ in ExecStartZbigniew Jędrzejewski-Szmek2012-11-15
|
* core: interpret \; token in ExecStart as escaped ;Oleksii Shevchuk2012-11-15
| | | | | | | Some commands (like 'find') take a semicolon as separate arg. With current parser implementation there is no way to pass one. Patch adds token \;
* shared, core: do not always accept numbers in string lookupsMichal Schmidt2012-10-30
| | | | | | | | | | | | | | | | | | | | | | | | The behaviour of the common name##_from_string conversion is surprising. It accepts not only the strings from name##_table but also any number that falls within the range of the table. The order of items in most of our tables is an internal affair. It should not be visible to the user. I know of a case where the surprising numeric conversion leads to a crash. We will allow the direct numeric conversion only for the tables where the mapping of strings to numeric values has an external meaning. This holds for the following lookup tables: - netlink_family, ioprio_class, ip_tos, sched_policy - their numeric values are stable as they are defined by the Linux kernel interface. - log_level, log_facility_unshifted - the well-known syslog interface. We allow the user to use numeric values whose string names systemd does not know. For instance, the user may want to test a new kernel featuring a scheduling policy that did not exist when his systemd version was released. A slightly unpleasant effect of this is that the name##_to_string conversion cannot return pointers to constant strings anymore. The strings have to be allocated on demand and freed by the caller.
* man: document behaviour of ListenStream= with only a port number in regards ↵Lennart Poettering2012-10-03
| | | | to IPv4/IPv6
* path: support specifier resolvin in .path unitsLennart Poettering2012-09-19
|
* unit: split unit_printf() and friends into its own .c fileLennart Poettering2012-09-18
|