*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.83 1998/06/08 19:36:40 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.84 1998/06/08 22:28:26 momjian Exp $
*
* NOTES
*
for (; i < 4; i++)
new_argv[i] = "";
new_argv[4] = NULL;
+
+ if (!Execfile[0] && FindExec(Execfile, argv[0]) < 0)
+ {
+ fprintf(stderr, "%s: could not find postmaster to execute...\n",
+ argv[0]);
+ exit(1);
+ }
+ new_argv[0] = Execfile;
+
execv(new_argv[0], new_argv);
- perror(new_argv[0]);
+
/* How did we get here, error! */
+ perror(new_argv[0]);
fprintf(stderr, "PostmasterMain execv failed on %s\n", argv[0]);
exit(1);
}
exit(2);
}
- if (!Execfile[0] && FindBackend(Execfile, argv[0]) < 0)
+ if (!Execfile[0] && FindExec(Execfile, argv[0]) < 0)
{
fprintf(stderr, "%s: could not find backend to execute...\n",
argv[0]);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.73 1998/06/04 17:26:45 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.74 1998/06/08 22:28:27 momjian Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
SetCharSet();
#endif
- if (FindBackend(pg_pathname, argv[0]) < 0)
+ if (FindExec(pg_pathname, argv[0]) < 0)
elog(FATAL, "%s: could not locate executable, bailing out...",
argv[0]);
if (!IsUnderPostmaster)
{
puts("\nPOSTGRES backend interactive interface");
- puts("$Revision: 1.73 $ $Date: 1998/06/04 17:26:45 $");
+ puts("$Revision: 1.74 $ $Date: 1998/06/08 22:28:27 $");
}
/* ----------------
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/init/Attic/findbe.c,v 1.7 1997/09/08 02:31:53 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/init/Attic/findbe.c,v 1.8 1998/06/08 22:28:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
}
/*
- * FindBackend -- find an absolute path to a valid backend executable
+ * FindExec -- find an absolute path to a valid backend executable
*
* The reason we have to work so hard to find an absolute path is that
* we need to feed the backend server the location of its actual
* executable file -- otherwise, we can't do dynamic loading.
*/
int
-FindBackend(char *backend, char *argv0)
+FindExec(char *backend, char *argv0)
{
char buf[MAXPGPATH + 2];
char *p;
{
strncpy(backend, buf, MAXPGPATH);
if (DebugLvl)
- fprintf(stderr, "FindBackend: found \"%s\" using argv[0]\n",
+ fprintf(stderr, "FindExec: found \"%s\" using argv[0]\n",
backend);
return (0);
}
- fprintf(stderr, "FindBackend: invalid backend \"%s\"\n",
+ fprintf(stderr, "FindExec: invalid backend \"%s\"\n",
buf);
return (-1);
}
if ((p = getenv("PATH")) && *p)
{
if (DebugLvl)
- fprintf(stderr, "FindBackend: searching PATH ...\n");
+ fprintf(stderr, "FindExec: searching PATH ...\n");
pathlen = strlen(p);
path = malloc(pathlen + 1);
strcpy(path, p);
case 0: /* found ok */
strncpy(backend, buf, MAXPGPATH);
if (DebugLvl)
- fprintf(stderr, "FindBackend: found \"%s\" using PATH\n",
+ fprintf(stderr, "FindExec: found \"%s\" using PATH\n",
backend);
free(path);
return (0);
case -1: /* wasn't even a candidate, keep looking */
break;
case -2: /* found but disqualified */
- fprintf(stderr, "FindBackend: could not read backend \"%s\"\n",
+ fprintf(stderr, "FindExec: could not read backend \"%s\"\n",
buf);
free(path);
return (-1);
free(path);
}
- fprintf(stderr, "FindBackend: could not find a backend to execute...\n");
+ fprintf(stderr, "FindExec: could not find a backend to execute...\n");
return (-1);
}
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: miscadmin.h,v 1.24 1998/05/29 17:00:22 momjian Exp $
+ * $Id: miscadmin.h,v 1.25 1998/06/08 22:28:30 momjian Exp $
*
* NOTES
* some of the information in this file will be moved to
extern Oid GetUserId(void);
extern void SetUserId(void);
extern int ValidateBackend(char *path);
-extern int FindBackend(char *backend, char *argv0);
+extern int FindExec(char *backend, char *argv0);
extern int CheckPathAccess(char *path, char *name, int open_mode);
/* lower case version for case-insensitive SQL referenced in pg_proc.h */