fprintf(f, "Before=%s\n", before);
if (!isempty(after))
fprintf(f, "After=%s\n", after);
fprintf(f, "Before=%s\n", before);
if (!isempty(after))
fprintf(f, "After=%s\n", after);
r = add_symlink(s->name, *p);
if (r < 0)
log_error_unit(s->name, "Failed to create 'Wants' symlink to %s: %s", *p, strerror(-r));
r = add_symlink(s->name, *p);
if (r < 0)
log_error_unit(s->name, "Failed to create 'Wants' symlink to %s: %s", *p, strerror(-r));
} else if (state == LSB || state == LSB_DESCRIPTION) {
if (startswith_no_case(t, "Provides:")) {
} else if (state == LSB || state == LSB_DESCRIPTION) {
if (startswith_no_case(t, "Provides:")) {
- FOREACH_WORD_QUOTED(w, z, t+9, i) {
+ FOREACH_WORD_QUOTED(word, z, t+9, state_) {
"[%s:%u] Failed to add LSB Provides name %s, ignoring: %s",
s->path, line, m, strerror(-r));
}
"[%s:%u] Failed to add LSB Provides name %s, ignoring: %s",
s->path, line, m, strerror(-r));
}
} else if (startswith_no_case(t, "Required-Start:") ||
startswith_no_case(t, "Should-Start:") ||
startswith_no_case(t, "X-Start-Before:") ||
startswith_no_case(t, "X-Start-After:")) {
} else if (startswith_no_case(t, "Required-Start:") ||
startswith_no_case(t, "Should-Start:") ||
startswith_no_case(t, "X-Start-Before:") ||
startswith_no_case(t, "X-Start-After:")) {
- FOREACH_WORD_QUOTED(w, z, strchr(t, ':')+1, i) {
+ FOREACH_WORD_QUOTED(word, z, strchr(t, ':')+1, state_) {
"[%s:%u] Failed to add dependency on %s, ignoring: %s",
s->path, line, m, strerror(-r));
}
"[%s:%u] Failed to add dependency on %s, ignoring: %s",
s->path, line, m, strerror(-r));
}
+ if (!isempty(state_))
+ log_error_unit(s->name,
+ "[%s:%u] Trailing garbage in %*s, ignoring.",
+ s->path, line,
+ (int)(strchr(t, ':') - t), t);
- if (hashmap_contains(all_services, name))
- service = hashmap_get(all_services, name);
- else {
+ service = hashmap_get(all_services, name);
+ if (!service){
- r = set_ensure_allocated(&runlevel_services[i],
- trivial_hash_func, trivial_compare_func);
+ r = set_ensure_allocated(&runlevel_services[i], NULL);
- r = set_ensure_allocated(&shutdown_services,
- trivial_hash_func, trivial_compare_func);
+ r = set_ensure_allocated(&shutdown_services, NULL);