2010-08-17 03:33:07 +02:00
|
|
|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
2010-06-15 14:45:15 +02:00
|
|
|
|
2012-07-18 19:07:51 +02:00
|
|
|
#pragma once
|
2010-06-15 14:45:15 +02:00
|
|
|
|
|
|
|
/***
|
|
|
|
This file is part of systemd.
|
|
|
|
|
|
|
|
Copyright 2010 Lennart Poettering
|
|
|
|
|
|
|
|
systemd is free software; you can redistribute it and/or modify it
|
2012-04-12 00:20:58 +02:00
|
|
|
under the terms of the GNU Lesser General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2.1 of the License, or
|
2010-06-15 14:45:15 +02:00
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
systemd is distributed in the hope that it will be useful, but
|
|
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2012-04-12 00:20:58 +02:00
|
|
|
Lesser General Public License for more details.
|
2010-06-15 14:45:15 +02:00
|
|
|
|
2012-04-12 00:20:58 +02:00
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
2010-06-15 14:45:15 +02:00
|
|
|
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
***/
|
|
|
|
|
2015-12-03 21:13:37 +01:00
|
|
|
#include <stdbool.h>
|
2014-06-27 18:12:07 +02:00
|
|
|
#include "macro.h"
|
2015-03-15 02:46:59 +01:00
|
|
|
|
2010-06-15 14:45:15 +02:00
|
|
|
typedef struct LookupPaths {
|
|
|
|
char **unit_path;
|
2010-09-21 05:23:12 +02:00
|
|
|
#ifdef HAVE_SYSV_COMPAT
|
2010-06-15 14:45:15 +02:00
|
|
|
char **sysvinit_path;
|
|
|
|
char **sysvrcnd_path;
|
2010-09-21 05:23:12 +02:00
|
|
|
#endif
|
2010-06-15 14:45:15 +02:00
|
|
|
} LookupPaths;
|
|
|
|
|
2015-05-11 22:51:49 +02:00
|
|
|
typedef enum ManagerRunningAs {
|
|
|
|
MANAGER_SYSTEM,
|
|
|
|
MANAGER_USER,
|
|
|
|
_MANAGER_RUNNING_AS_MAX,
|
|
|
|
_MANAGER_RUNNING_AS_INVALID = -1
|
|
|
|
} ManagerRunningAs;
|
2012-09-18 17:11:12 +02:00
|
|
|
|
2010-11-15 22:12:41 +01:00
|
|
|
int user_config_home(char **config_home);
|
2014-10-02 14:01:00 +02:00
|
|
|
int user_runtime_dir(char **runtime_dir);
|
2010-06-16 01:58:50 +02:00
|
|
|
|
2015-05-11 22:51:49 +02:00
|
|
|
char **generator_paths(ManagerRunningAs running_as);
|
Implement masking and overriding of generators
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
2015-01-09 02:47:25 +01:00
|
|
|
|
2014-04-24 07:44:10 +02:00
|
|
|
int lookup_paths_init(LookupPaths *p,
|
2015-05-11 22:51:49 +02:00
|
|
|
ManagerRunningAs running_as,
|
2014-04-24 07:44:10 +02:00
|
|
|
bool personal,
|
|
|
|
const char *root_dir,
|
|
|
|
const char *generator,
|
|
|
|
const char *generator_early,
|
|
|
|
const char *generator_late);
|
2015-05-11 22:53:54 +02:00
|
|
|
|
|
|
|
#include "install.h"
|
|
|
|
|
2014-12-19 15:08:07 +01:00
|
|
|
int lookup_paths_init_from_scope(LookupPaths *paths,
|
|
|
|
UnitFileScope scope,
|
|
|
|
const char *root_dir);
|
2014-08-21 19:08:30 +02:00
|
|
|
|
2015-05-11 22:53:54 +02:00
|
|
|
void lookup_paths_free(LookupPaths *p);
|
2014-08-21 19:08:30 +02:00
|
|
|
#define _cleanup_lookup_paths_free_ _cleanup_(lookup_paths_free)
|