Commit cec2a7f5 authored by William Jon McCann's avatar William Jon McCann Committed by William Jon McCann

Remove the PidFile configuration option. Fixes #162849

2007-03-26  William Jon McCann  <mccann@jhu.edu>

	* config/gdm.conf.in:
	* configure.ac:
	* daemon/gdm-daemon-config-entries.h:
	* daemon/gdm-daemon-config-keys.h:
	* daemon/gdm-daemon-config.c: (gdm_daemon_config_to_string),
	(check_servauthdir), (handle_no_displays),
	(gdm_daemon_change_user), (gdm_daemon_check_permissions):
	* daemon/gdm.c: (gdm_daemonify), (gdm_final_cleanup), (main):
	* gui/gdmXnestchooser.c: (main):
	* gui/gdmcomm.c: (gdmcomm_check):
	* gui/gdmlogin.c: (gdm_read_config):
	* gui/greeter/greeter.c: (gdm_read_config):
	Remove the PidFile configuration option.  Fixes #162849


svn path=/trunk/; revision=4714
parent f4ef945e
2007-03-26 William Jon McCann <mccann@jhu.edu>
reviewed by: <delete if not using a buddy>
* config/gdm.conf.in:
* configure.ac:
* daemon/gdm-daemon-config-entries.h:
* daemon/gdm-daemon-config-keys.h:
* daemon/gdm-daemon-config.c: (gdm_daemon_config_to_string),
(check_servauthdir), (handle_no_displays),
(gdm_daemon_change_user), (gdm_daemon_check_permissions):
* daemon/gdm.c: (gdm_daemonify), (gdm_final_cleanup), (main):
* gui/gdmXnestchooser.c: (main):
* gui/gdmcomm.c: (gdmcomm_check):
* gui/gdmlogin.c: (gdm_read_config):
* gui/greeter/greeter.c: (gdm_read_config):
2007-03-26 William Jon McCann <mccann@jhu.edu>
* docs/C/gdm.xml:
......
......@@ -106,8 +106,6 @@ Group=gdm
# does not always work, only if those clients have a window of their own.
#KillInitClients=true
LogDir=@logdir@
# You should probably never change this value unless you have a weird setup.
PidFile=/var/run/gdm.pid
# Note that a post login script is run before a PreSession script. It is run
# after the login is successful and before any setup is run on behalf of the
......
......@@ -1116,8 +1116,24 @@ if test "x$USER_POST_PATH" != "x"; then
GDM_USER_PATH="$GDM_USER_PATH:$USER_POST_PATH"
fi
dnl ---------------------------------------------------------------------------
dnl - PID file
dnl ---------------------------------------------------------------------------
# Turn on the additional warnings last, so they don't affect other tests.
AC_ARG_WITH(pid-file, [ --with-pid-file=<file> pid file])
if ! test -z "$with_pid_file"; then
GDM_PID_FILE=$with_pid_file
else
GDM_PID_FILE=${LOCALSTATEDIR}/run/gdm.pid
fi
AC_SUBST(GDM_PID_FILE)
AC_DEFINE_UNQUOTED(GDM_PID_FILE, "$GDM_PID_FILE", [pid file])
dnl ---------------------------------------------------------------------------
dnl - Additional warnings
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(more-warnings,
AC_HELP_STRING([--enable-more-warnings], [Maximum compiler warnings]),
......
......@@ -60,7 +60,6 @@ typedef enum {
GDM_ID_KILL_INIT_CLIENTS,
GDM_ID_LOG_DIR,
GDM_ID_PATH,
GDM_ID_PID_FILE,
GDM_ID_POSTSESSION,
GDM_ID_PRESESSION,
GDM_ID_POSTLOGIN,
......@@ -256,9 +255,7 @@ typedef enum {
* code section for best performance.
*
* + The gui/gdmsetup.c program should be updated to support the new option
* unless there's a good reason not to (like it is a configuration value
* that only someone who really knows what they are doing should change
* like GDM_ID_PID_FILE).
* unless there's a good reason not to.
*
* + Currently GDM treats any key in the "gui" and "greeter" categories,
* and security/PamStack as available for per-display configuration.
......@@ -312,7 +309,6 @@ static const GdmConfigEntry gdm_daemon_config_entries [] = {
{ GDM_CONFIG_GROUP_DAEMON, "KillInitClients", GDM_CONFIG_VALUE_BOOL, "true", GDM_ID_KILL_INIT_CLIENTS },
{ GDM_CONFIG_GROUP_DAEMON, "LogDir", GDM_CONFIG_VALUE_STRING, LOGDIR, GDM_ID_LOG_DIR },
{ GDM_CONFIG_GROUP_DAEMON, "DefaultPath", GDM_CONFIG_VALUE_STRING, GDM_USER_PATH, GDM_ID_PATH },
{ GDM_CONFIG_GROUP_DAEMON, "PidFile", GDM_CONFIG_VALUE_STRING, "/var/run/gdm.pid", GDM_ID_PID_FILE },
{ GDM_CONFIG_GROUP_DAEMON, "PostSessionScriptDir", GDM_CONFIG_VALUE_STRING, GDMCONFDIR "/PostSession/", GDM_ID_POSTSESSION },
{ GDM_CONFIG_GROUP_DAEMON, "PreSessionScriptDir", GDM_CONFIG_VALUE_STRING, GDMCONFDIR "/PreSession/", GDM_ID_PRESESSION },
{ GDM_CONFIG_GROUP_DAEMON, "PostLoginScriptDir", GDM_CONFIG_VALUE_STRING, GDMCONFDIR "/PreSession/", GDM_ID_POSTLOGIN },
......
......@@ -42,7 +42,7 @@ G_BEGIN_DECLS
#define GDM_KEY_KILL_INIT_CLIENTS "daemon/KillInitClients=true"
#define GDM_KEY_LOG_DIR "daemon/LogDir=" LOGDIR
#define GDM_KEY_PATH "daemon/DefaultPath=" GDM_USER_PATH
#define GDM_KEY_PID_FILE "daemon/PidFile=/var/run/gdm.pid"
#define GDM_KEY_PID_FILE "daemon/PidFile=" GDM_PID_FILE
#define GDM_KEY_POSTSESSION "daemon/PostSessionScriptDir=" GDMCONFDIR "/PostSession/"
#define GDM_KEY_PRESESSION "daemon/PreSessionScriptDir=" GDMCONFDIR "/PreSession/"
#define GDM_KEY_POSTLOGIN "daemon/PostLoginScriptDir=" GDMCONFDIR "/PreSession/"
......
......@@ -522,6 +522,15 @@ gdm_daemon_config_to_string (const gchar *keystring,
goto out;
}
/* Backward Compatibility */
if (group != NULL &&
key != NULL &&
(strcmp (group, "daemon") == 0) &&
(strcmp (key, "PidFile") == 0)) {
result = g_strdup (GDM_PID_FILE);
goto out;
}
res = gdm_config_get_value (daemon_config,
group,
key,
......@@ -1176,8 +1185,6 @@ check_servauthdir (const char *auth_path,
g_free (s);
}
gdm_config_set_string_for_id (daemon_config, GDM_ID_PID_FILE, NULL);
gdm_fail (_("%s: Authdir %s does not exist. Aborting."), "gdm_config_parse", auth_path);
}
......@@ -1194,8 +1201,6 @@ check_servauthdir (const char *auth_path,
g_free (s);
}
gdm_config_set_string_for_id (daemon_config, GDM_ID_PID_FILE, NULL);
gdm_fail (_("%s: Authdir %s is not a directory. Aborting."), "gdm_config_parse", auth_path);
}
}
......@@ -1723,8 +1728,6 @@ handle_no_displays (GdmConfig *config)
g_free (s);
}
gdm_config_set_string_for_id (daemon_config, GDM_ID_PID_FILE, NULL);
gdm_fail (_("%s: XDMCP disabled and no static servers defined. Aborting!"), "gdm_config_parse");
}
}
......@@ -1767,8 +1770,6 @@ gdm_daemon_change_user (GdmConfig *config,
g_free (s);
}
gdm_config_set_string_for_id (daemon_config, GDM_ID_PID_FILE, NULL);
gdm_fail (_("%s: Can't find the GDM user '%s'. Aborting!"), "gdm_config_parse", username);
} else {
uid = pwent->pw_uid;
......@@ -1786,8 +1787,6 @@ gdm_daemon_change_user (GdmConfig *config,
g_free (s);
}
gdm_config_set_string_for_id (daemon_config, GDM_ID_PID_FILE, NULL);
gdm_fail (_("%s: The GDM user should not be root. Aborting!"), "gdm_config_parse");
}
......@@ -1803,8 +1802,6 @@ gdm_daemon_change_user (GdmConfig *config,
g_free (s);
}
gdm_config_set_string_for_id (daemon_config, GDM_ID_PID_FILE, NULL);
gdm_fail (_("%s: Can't find the GDM group '%s'. Aborting!"), "gdm_config_parse", groupname);
} else {
gid = grent->gr_gid;
......@@ -1821,8 +1818,6 @@ gdm_daemon_change_user (GdmConfig *config,
g_free (s);
}
gdm_config_set_string_for_id (daemon_config, GDM_ID_PID_FILE, NULL);
gdm_fail (_("%s: The GDM group should not be root. Aborting!"), "gdm_config_parse");
}
......@@ -1884,8 +1879,6 @@ gdm_daemon_check_permissions (GdmConfig *config,
g_free (s);
}
gdm_config_set_string_for_id (daemon_config, GDM_ID_PID_FILE, NULL);
gdm_fail (_("%s: Authdir %s is not owned by user %d, group %d. Aborting."),
"gdm_config_parse",
auth_path,
......@@ -1908,8 +1901,6 @@ gdm_daemon_check_permissions (GdmConfig *config,
g_free (s);
}
gdm_config_set_string_for_id (daemon_config, GDM_ID_PID_FILE, NULL);
gdm_fail (_("%s: Authdir %s has wrong permissions %o. Should be %o. Aborting."),
"gdm_config_parse",
auth_path,
......
......@@ -197,7 +197,7 @@ gdm_daemonify (void)
pid = fork ();
if (pid > 0) {
const char *pidfile = gdm_daemon_config_get_value_string (GDM_KEY_PID_FILE);
const char *pidfile = GDM_PID_FILE;
errno = 0;
if ((pf = gdm_safe_fopen_w (pidfile)) != NULL) {
......@@ -397,7 +397,7 @@ gdm_final_cleanup (void)
closelog ();
pidfile = gdm_daemon_config_get_value_string (GDM_KEY_PID_FILE);
pidfile = GDM_PID_FILE;
if (pidfile != NULL) {
VE_IGNORE_EINTR (g_unlink (pidfile));
}
......@@ -1651,7 +1651,7 @@ main (int argc, char *argv[])
/* get the name of the root user */
gdm_root_user ();
pidfile = gdm_daemon_config_get_value_string (GDM_KEY_PID_FILE);
pidfile = GDM_PID_FILE;
/* Check if another gdm process is already running */
if (g_access (pidfile, R_OK) == 0) {
......@@ -1666,8 +1666,6 @@ main (int argc, char *argv[])
kill (pidv, 0) == 0 &&
linux_only_is_running (pidv)) {
/* make sure the pid file doesn't get wiped */
gdm_daemon_config_set_value_string (GDM_KEY_PID_FILE, NULL);
pidfile = NULL;
VE_IGNORE_EINTR (fclose (pf));
gdm_fail (_("GDM already running. Aborting!"));
}
......
......@@ -468,7 +468,7 @@ main (int argc, char *argv[])
gboolean honor_indirect;
int display;
char *socket;
char *pidfile;
const char *pidfile;
GOptionContext *ctx;
char *xnest;
char **execvec;
......@@ -503,7 +503,7 @@ main (int argc, char *argv[])
xdmcp_enabled = gdm_config_get_bool (GDM_KEY_XDMCP);
honor_indirect = gdm_config_get_bool (GDM_KEY_INDIRECT);
pidfile = gdm_config_get_string (GDM_KEY_PID_FILE);
pidfile = GDM_PID_FILE;
xnest = gdm_config_get_string (GDM_KEY_XNEST);
/* At this point we are done using the socket, so close it */
......
......@@ -616,11 +616,11 @@ gdmcomm_check (gboolean show_dialog)
GtkWidget *dialog;
FILE *fp = NULL;
long pid;
char *pidfile;
const char *pidfile;
struct stat s;
int statret;
pidfile = gdm_config_get_string (GDM_KEY_PID_FILE);
pidfile = GDM_PID_FILE;
pid = 0;
if (pidfile != NULL)
......
......@@ -3176,7 +3176,6 @@ gdm_read_config (void)
/* Keys not to include in reread_config */
gdm_config_get_bool (GDM_KEY_LOCK_POSITION);
gdm_config_get_string (GDM_KEY_PID_FILE);
gdm_config_get_int (GDM_KEY_POSITION_X);
gdm_config_get_int (GDM_KEY_POSITION_Y);
gdm_config_get_string (GDM_KEY_PRE_FETCH_PROGRAM);
......
......@@ -901,7 +901,6 @@ gdm_read_config (void)
/* Keys not to include in reread_config */
gdm_config_get_string (GDM_KEY_SESSION_DESKTOP_DIR);
gdm_config_get_string (GDM_KEY_PID_FILE);
gdm_config_get_string (GDM_KEY_PRE_FETCH_PROGRAM);
gdmcomm_comm_bulk_stop ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment