summaryrefslogtreecommitdiff
path: root/src/core/service.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-01-16 21:09:03 +0100
committerLennart Poettering <lennart@poettering.net>2013-01-16 21:34:09 +0100
commit5d4caf565471ff3401bd9b53aa814c8545a18a93 (patch)
tree1e6dc444c24402a81d1d895a9698b80ae110e6a0 /src/core/service.c
parenta485210ce73fe1186fdc5fae481dc31773e14b3c (diff)
service: ignore dependencies on $syslog and $local_fs in LSB scripts
We no longer allow early-boot init scripts, however in late boot the syslog socket and local mounts are established anyway, so let's simplify our dep graph a bit. If $syslog doesn't resolve to syslog.target anymore there's no reason to keep syslog.target around anymore. Let's remove it. Note that many 3rd party service unit files order themselves after syslog.target. These will be dangling dependencies now, which should be unproblematic, however.
Diffstat (limited to 'src/core/service.c')
-rw-r--r--src/core/service.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/core/service.c b/src/core/service.c
index 017d292a8b..ebd0baea89 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -322,7 +322,8 @@ static void service_done(Unit *u) {
static char *sysv_translate_name(const char *name) {
char *r;
- if (!(r = new(char, strlen(name) + sizeof(".service"))))
+ r = new(char, strlen(name) + sizeof(".service"));
+ if (!r)
return NULL;
if (endswith(name, ".sh"))
@@ -348,16 +349,12 @@ static int sysv_translate_facility(const char *name, const char *filename, char
static const char * const table[] = {
/* LSB defined facilities */
- "local_fs", SPECIAL_LOCAL_FS_TARGET,
- /* Due to unfortunate name selection in Mandriva,
- * $network is provided by network-up which is ordered
- * after network which actually starts interfaces.
- * To break the loop, just ignore it */
+ "local_fs", NULL,
"network", SPECIAL_NETWORK_TARGET,
"named", SPECIAL_NSS_LOOKUP_TARGET,
"portmap", SPECIAL_RPCBIND_TARGET,
"remote_fs", SPECIAL_REMOTE_FS_TARGET,
- "syslog", SPECIAL_SYSLOG_TARGET,
+ "syslog", NULL,
"time", SPECIAL_TIME_SYNC_TARGET,
};
@@ -378,8 +375,9 @@ static int sysv_translate_facility(const char *name, const char *filename, char
if (!table[i+1])
return 0;
- if (!(r = strdup(table[i+1])))
- return -ENOMEM;
+ r = strdup(table[i+1]);
+ if (!r)
+ return log_oom();
goto finish;
}