SVCNAME -> RC_SVCNAME, but export SVCNAME still for compat.
This commit is contained in:
		@@ -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)
 | 
			
		||||
 
 | 
			
		||||
@@ -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_*
 | 
			
		||||
 
 | 
			
		||||
@@ -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';
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user