diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-04-06 02:40:10 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-04-06 02:40:10 +0200 |
commit | a9a1e00af1059a6b8c3e089238870fbf2608c087 (patch) | |
tree | 020aabd54012cfee14fac9d050c74e50d1f7d546 | |
parent | 593fbdd21e52c8c0ac249c5b6163761005af8463 (diff) |
sysv: allow configuration of SysV start priority from new-style service files, too
-rw-r--r-- | load-fragment.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/load-fragment.c b/load-fragment.c index bf17111482..2eb8279f40 100644 --- a/load-fragment.c +++ b/load-fragment.c @@ -974,6 +974,32 @@ static int config_parse_cgroup( return 0; } +static int config_parse_sysv_priority( + const char *filename, + unsigned line, + const char *section, + const char *lvalue, + const char *rvalue, + void *data, + void *userdata) { + + int *priority = data; + int r, i; + + assert(filename); + assert(lvalue); + assert(rvalue); + assert(data); + + if ((r = safe_atoi(rvalue, &i)) < 0 || i < 0) { + log_error("[%s:%u] Failed to parse SysV start priority: %s", filename, line, rvalue); + return r; + } + + *priority = (int) i; + return 0; +} + #define FOLLOW_MAX 8 static int open_follow(char **filename, FILE **_f, Set *names, char **_id) { @@ -1129,6 +1155,7 @@ static int load_from_path(Unit *u, const char *path) { { "PermissionsStartOnly", config_parse_bool, &u->service.permissions_start_only, "Service" }, { "RootDirectoryStartOnly", config_parse_bool, &u->service.root_directory_start_only, "Service" }, { "ValidNoProcess", config_parse_bool, &u->service.valid_no_process, "Service" }, + { "SysVStartPriority", config_parse_sysv_priority, &u->service.sysv_start_priority, "Service" }, EXEC_CONTEXT_CONFIG_ITEMS(u->service.exec_context, "Service"), { "ListenStream", config_parse_listen, &u->socket, "Socket" }, |