summaryrefslogtreecommitdiff
path: root/src/shared/path-lookup.c
Commit message (Collapse)AuthorAge
* Get rid of some more unused defines and dirsAndy Wingo2017-03-14
|
* Remove SysV compatAndy Wingo2017-03-14
|
* core: rename SystemdRunningAs to ManagerRunningAsLennart Poettering2017-03-14
| | | | | | It's primarily just a property of the Manager object after all, and we try to refer to PID 1 as "manager" instead of "systemd", hence let's to stick to this here too.
* Get rid of some more unused defines and dirsAndy Wingo2015-04-19
|
* Remove SysV compatAndy Wingo2015-04-08
|
* sysv-generator: initialize LookupPaths just onceZbigniew Jędrzejewski-Szmek2015-03-14
| | | | | | | | With debugging on, sysv-generator would print the full set of lookup paths for *every* sysv script. While at it, pass LookupPaths as a pointer in sysv-generator, and constify it everywhere.
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-23
| | | | | | This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
* path-lookup: allow /run to override /etc in generator searchZbigniew Jędrzejewski-Szmek2015-01-11
| | | | | | Generators are different than unit files: they are never automatically generated, so there's no point in allowing /etc to override /run. On the other hand, overriding /etc might be useful in some cases.
* Implement masking and overriding of generatorsZbigniew Jędrzejewski-Szmek2015-01-11
| | | | | | | | | | | | | | | | | | | | | | Sometimes it is necessary to stop a generator from running. Either because of a bug, or for testing, or some other reason. The only way to do that would be to rename or chmod the generator binary, which is inconvenient and does not survive upgrades. Allow masking and overriding generators similarly to units and other configuration files. For the systemd instance, masking would be more common, rather than overriding generators. For the user instances, it may also be useful for users to have generators in $XDG_CONFIG_HOME to augment or override system-wide generators. Directories are searched according to the usual scheme (/usr/lib, /usr/local/lib, /run, /etc), and files with the same name in higher priority directories override files with the same name in lower priority directories. Empty files and links to /dev/null mask a given name. https://bugs.freedesktop.org/show_bug.cgi?id=87230
* path-lookup, systemctl: export lookup_paths_init_from_scope() from ↵Ivan Shapovalov2015-01-05
| | | | shared/install.c and use it
* Fix order and document user unit dirsZbigniew Jędrzejewski-Szmek2014-10-02
| | | | Fixup for 718880ba0d 'add a transient user unit directory'.
* Rename user_runtime to user_runtime_dirZbigniew Jędrzejewski-Szmek2014-10-02
| | | | | This makes this function name similar to user_config_home() and makes it match the name of the environment variable.
* add a transient user unit directorySteven Allen2014-10-02
| | | | | | | | | This patch adds a transient user unit directory under `$XDG_RUNTIME_DIR/systemd/user/` and stores transient user-instance units (such as those created by `systemd-run --user`) under there instead of putting them in $XDG_CONFIG_HOME/systemd/user/. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=67331
* Merge systemd-verify with systemd-analyzeZbigniew Jędrzejewski-Szmek2014-07-21
|
* path-lookup: make SYSTEMD_UNIT_PATH more flexibleZbigniew Jędrzejewski-Szmek2014-07-20
| | | | | It can now contain more than one directory, and can be used to only prepend, not totally override, the normal load path.
* core: remove systemd_running_as lookup functionsZbigniew Jędrzejewski-Szmek2014-07-19
| | | | They are unused and unlikely to ever be.
* path-lookup: don't make ~/.local/share/systemd/user a symlinkTanu Kaskinen2014-07-13
| | | | | | | | | | We already encourage upstreams to keep the default configuration separate from user customizations for software that is installed in the system location. Let's allow that separation also for software that is installed in the home directory. Some discussion: http://thread.gmane.org/gmane.comp.sysutils.systemd.devel/19627
* shared: rename path_strv_canonicalize_absolute functionsMichael Marineau2014-06-20
| | | | | | | Since 12ed81d9 path_strv_canonicalize_absolute leaves the search list relative to the given root directory instead of resolving paths to their true location as the name implies. To better reflect this behavior rename to the less strongly worded path_strv_resolve.
* path-lookup: don't hardcode .configTanu Kaskinen2014-05-16
| | | | If XDG_CONFIG_HOME is set, then we should respect that.
* Make systemctl --root look for files in the proper placesZbigniew Jędrzejewski-Szmek2014-05-15
| | | | | | | | | | | | | | | | | | | | Running systemctl enable/disable/set-default/... with the --root option under strace reveals that it accessed various files and directories in the main fs, and not underneath the specified root. This can lead to correct results only when the layout and configuration in the container are identical, which often is not the case. Fix this by adding the specified root to all file access operations. This patch does not handle some corner cases: symlinks which point outside of the specified root might be interpreted differently than they would be by the kernel if the specified root was the real root. But systemctl does not create such symlinks by itself, and I think this is enough of a corner case not to be worth the additional complexity of reimplementing link chasing in systemd. Also, simplify the code in a few places and remove an hypothetical memory leak on error.
* shared: include root when canonicalizing conf pathsMichael Marineau2014-02-14
| | | | | | | | | | | | | | The conf_files_list family accepts an alternate root path to prefix all directories in the list but path_strv_canonicalize_uniq doesn't use it. This results in the suspicious behavior of resolving directory symlinks based on the contents of / instead of the alternate root. This adds a prefix argument to path_strv_canonicalize which will now prepend the prefix, if given, to every path in the list. To avoid answering what a relative path means when called with a root prefix path_strv_canonicalize is now path_strv_canonicalize_absolute and only considers absolute paths. Fortunately all users of already call path_strv_canonicalize with a list of absolute paths.
* strv: multiple cleanupsSimon Peeters2014-01-05
| | | | | | | | | | - turn strv_merge into strv_extend_strv. appending strv b to the end of strv a instead of creating a new strv - strv_append: remove in favor of strv_extend and strv_push. - strv_remove: write slightly more elegant - strv_remove_prefix: remove unused function - strv_overlap: use strv_contains - strv_printf: STRV_FOREACH handles NULL correctly
* move _cleanup_ attribute in front of the typeHarald Hoyer2013-04-18
| | | | http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html
* path-lookup: downgrade again the messages where we log for unitsLennart Poettering2013-03-01
| | | | | | | | | | | | | This partially reverts 7ad94c716d6403233d04c4d37cb14df958c9b65d. After that commit commands such as "systemctl enable" and friends printed the search path information multiple times in its output, which is ugly. If we want the search paths to be printed at a higher log level, then we should do this in PID 1 only, i.e. split the printing out of the normal path lookup logic and invoke that explicitly from PID 1 but not in the auxiliary tools.
* 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.
* systemd: raise level of message about lookup pathsZbigniew Jędrzejewski-Szmek2013-02-06
| | | | | | | This can be pretty important for the user, and is not trivial to figure out in all cases. Also show failing path in error messages.
* systemd: do not remove empty paths from unit lookup pathZbigniew Jędrzejewski-Szmek2013-02-06
| | | | | | | The ability to start a new unit with 'systemctl start ...' should not depend on whether there are other units in the directory. Previously, an additional 'systemctl daemon-reload' would be necessary to tell systemd to update the list of unit lookup paths.
* core: move ManagerRunningAs to sharedZbigniew Jędrzejewski-Szmek2012-09-18
| | | | | | | 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.
* mkdir: append _label to all mkdir() calls that explicitly set the selinux ↵Kay Sievers2012-05-31
| | | | context
* manager: rework generator logicLennart Poettering2012-05-23
| | | | | | | | | | | | | | | | | | | | Previously generated units were always placed at the end of the search path. With this change there will be three unit dirs instead of one, to place generated entries at the beginning, in the middle and at the end of the search path: beginning: for units that need to override all configuration, regardless of user or vendor. Example use: system-update-generator uses this to temporarily redirect default.target. middle: for units that need to override vendor configuration, but not vendor configuration. Example use: /etc/fstab should override vendor supplied configuration (think /tmp), but should not override native user configuration. end: does not override anything but is available as well. Possible usage might be to convert D-Bus bus service files to native units but allowing vendor supplied native units to win.
* util: split-out path-util.[ch]Kay Sievers2012-05-08
|
* move more common files to shared/ and add them to shared.laKay Sievers2012-04-12