SVCNAME -> RC_SVCNAME, but export SVCNAME still for compat.

This commit is contained in:
Roy Marples
2008-03-19 19:57:24 +00:00
parent 6d2e1f7add
commit 6159a32f39
15 changed files with 80 additions and 80 deletions

View File

@@ -207,7 +207,7 @@ static int do_service(int argc, char **argv)
if (argc > 1)
service = argv[1];
else
service = getenv("SVCNAME");
service = getenv("RC_SVCNAME");
if (! service || *service == '\0')
eerrorx("%s: no service specified", applet);
@@ -229,7 +229,7 @@ static int do_service(int argc, char **argv)
else if (strcmp(applet, "service_started_daemon") == 0) {
d[0] = argv[1];
service = getenv("SVCNAME");
service = getenv("RC_SVCNAME");
if (argc > 3) {
service = argv[1];
d[0] = argv[2];
@@ -252,7 +252,7 @@ static int do_service(int argc, char **argv)
static int do_mark_service(int argc, char **argv)
{
bool ok = false;
char *svcname = getenv("SVCNAME");
char *svcname = getenv("RC_SVCNAME");
char *service = NULL;
char *runscript_pid;
char *mtime;
@@ -262,7 +262,7 @@ static int do_mark_service(int argc, char **argv)
if (argc > 1)
service = argv[1];
else
service = getenv("SVCNAME");
service = getenv("RC_SVCNAME");
if (! service || *service == '\0')
eerrorx("%s: no service specified", applet);
@@ -311,7 +311,7 @@ static int do_mark_service(int argc, char **argv)
static int do_value(int argc, char **argv)
{
bool ok = false;
char *service = getenv("SVCNAME");
char *service = getenv("RC_SVCNAME");
char *option;
if (! service)

View File

@@ -1129,7 +1129,7 @@ int runscript(int argc, char **argv)
}
setenv("EINFO_LOG", service, 1);
setenv("SVCNAME", applet, 1);
setenv("RC_SVCNAME", applet, 1);
/* Set an env var so that we always know our pid regardless of any
subshells the init script may create so that our mark_service_*

View File

@@ -583,7 +583,7 @@ int start_stop_daemon(int argc, char **argv)
int stderr_fd;
pid_t pid;
int i;
char *svcname = getenv("SVCNAME");
char *svcname = getenv("RC_SVCNAME");
RC_STRINGLIST *env_list;
RC_STRING *env;
char *path;
@@ -974,8 +974,9 @@ int start_stop_daemon(int argc, char **argv)
rc_stringlist_add(env_list, environ[i++]);
TAILQ_FOREACH(env, env_list, entries) {
if ((strncmp(env->value, "RC_", 3) == 0 &&
strncmp(env->value, "RC_SERVICE=", strlen("RC_SERVICE=")) != 0) ||
strncmp(env->value, "SSD_NICELEVEL=", strlen("SSD_NICELEVEL=")) == 0)
strncmp(env->value, "RC_SERVICE=", 10) != 0 &&
strncmp(env->value, "RC_SVCNAME=", 10) != 0) ||
strncmp(env->value, "SSD_NICELEVEL=", 14)) == 0)
{
p = strchr(env->value, '=');
*p = '\0';