chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sysv: allow configuration of SysV start priority from new-style service files, too
[elogind.git]
/
service.c
diff --git
a/service.c
b/service.c
index 149a791b05f62a8ca76b3a7c732a90f88c8c75ef..53d5505c2ea16b007607291f7e32faf54b3d8763 100644
(file)
--- a/
service.c
+++ b/
service.c
@@
-370,7
+370,13
@@
static int service_load_sysv_path(Service *s, const char *path) {
if (r == 0)
continue;
if (r == 0)
continue;
- r = unit_add_name(u, m);
+ if (unit_name_to_type(m) == UNIT_SERVICE)
+ r = unit_add_name(u, m);
+ else {
+ if ((r = unit_add_dependency_by_name_inverse(u, UNIT_REQUIRES, m)) >= 0)
+ r = unit_add_dependency_by_name(u, UNIT_BEFORE, m);
+ }
+
free(m);
if (r < 0)
free(m);
if (r < 0)
@@
-475,6
+481,10
@@
static int service_load_sysv_path(Service *s, const char *path) {
if ((r = sysv_exec_commands(s)) < 0)
goto finish;
if ((r = sysv_exec_commands(s)) < 0)
goto finish;
+ if ((r = unit_add_dependency_by_name(u, UNIT_REQUIRES, SPECIAL_SYSINIT_SERVICE)) < 0 ||
+ (r = unit_add_dependency_by_name(u, UNIT_AFTER, SPECIAL_SYSINIT_SERVICE)) < 0)
+ goto finish;
+
r = 1;
finish:
r = 1;
finish:
@@
-504,7
+514,7
@@
static int service_load_sysv_name(Service *s, const char *name) {
r = service_load_sysv_path(s, path);
free(path);
r = service_load_sysv_path(s, path);
free(path);
- if (r
>
= 0)
+ if (r
!
= 0)
return r;
}
return r;
}
@@
-568,7
+578,7
@@
static int service_init(Unit *u) {
return r;
}
return r;
}
- /* Load a classic init script as a fallback, if we couldn
*
t find anything */
+ /* Load a classic init script as a fallback, if we couldn
'
t find anything */
if (r == 0)
if ((r = service_load_sysv(s)) <= 0) {
service_done(u);
if (r == 0)
if ((r = service_load_sysv(s)) <= 0) {
service_done(u);
@@
-606,11
+616,13
@@
static void service_dump(Unit *u, FILE *f, const char *prefix) {
"%sService State: %s\n"
"%sPermissionsStartOnly: %s\n"
"%sRootDirectoryStartOnly: %s\n"
"%sService State: %s\n"
"%sPermissionsStartOnly: %s\n"
"%sRootDirectoryStartOnly: %s\n"
- "%sValidNoProcess: %s\n",
+ "%sValidNoProcess: %s\n"
+ "%sType: %s\n",
prefix, service_state_to_string(s->state),
prefix, yes_no(s->permissions_start_only),
prefix, yes_no(s->root_directory_start_only),
prefix, service_state_to_string(s->state),
prefix, yes_no(s->permissions_start_only),
prefix, yes_no(s->root_directory_start_only),
- prefix, yes_no(s->valid_no_process));
+ prefix, yes_no(s->valid_no_process),
+ prefix, service_type_to_string(s->type));
if (s->pid_file)
fprintf(f,
if (s->pid_file)
fprintf(f,