From: Sergey V Turchin <zerg@altlinux.org>
To: ALT Linux Sisyphus discussions <sisyphus@lists.altlinux.org>
Subject: Re: [sisyphus] kdm4 + lxde и переключение пользователей
Date: Mon, 16 Jan 2012 16:11:43 +0400
Message-ID: <9700499.5ktIjMqu2a@summoner.localdomain> (raw)
In-Reply-To: <4F13DBDF.10205@gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 873 bytes --]
On 16 января 2012 12:12:15 Alexey Borisenkov wrote:
> Короткий вопрос: почему kdm4 создаёт файл /var/run/xdm.pid, а не
> /var/run/kdm.pid ?
Чтоб однообразнее было. Да и по другому никогда и не было. В KDE3 тоже.
> $ cat /proc/`cat /var/run/xdm.pid`/cmdline
> kdm-nodaemon
> Это для чего-то надо или просто так получилось?
C cmdline и именем процесса в proc там вообще ахалай-махалай какой-то.
> Теперь, почему интересуюсь. Если используется связка lxde + gdm, то
> переключение пользователей доступно.
Прилагаю набросок для KDM.
[...]
--
Regards, Sergey. ALT Linux, http://www.altlinux.ru/
[-- Attachment #1.2: lxsession-logout.c.patch --]
[-- Type: text/x-patch, Size: 2319 bytes --]
--- lxsession-logout.c~ 2011-08-30 01:05:54.000000000 +0400
+++ lxsession-logout.c 2012-01-16 16:08:45.391131299 +0400
@@ -75,7 +75,7 @@ typedef struct {
} HandlerContext;
static gboolean lock_screen(void);
-static gboolean verify_running(const char * display_manager, const char * executable);
+static gboolean verify_running(const char * display_manager, const char * executable, const char * proc_dm = NULL);
static void logout_clicked(GtkButton * button, HandlerContext * handler_context);
static void change_root_property(GtkWidget* w, const char* prop_name, const char* value);
static void shutdown_clicked(GtkButton * button, HandlerContext * handler_context);
@@ -101,7 +101,7 @@ static gboolean lock_screen(void)
}
/* Verify that a program is running and that an executable is available. */
-static gboolean verify_running(const char * display_manager, const char * executable)
+static gboolean verify_running(const char * display_manager, const char * executable, const char * proc_dm)
{
/* See if the executable we need to run is in the path. */
gchar * full_path = g_find_program_in_path(executable);
@@ -144,8 +144,14 @@ static gboolean verify_running(const cha
/* Null terminate the buffer and look for the display manager name in the command.
* If found, return success. */
buffer[length] = '\0';
- if (strstr(buffer, display_manager) != NULL)
- return TRUE;
+ if( proc_dm != NULL )
+ {
+ if (strstr(buffer, proc_dm) != NULL)
+ return TRUE;
+ } else {
+ if (strstr(buffer, display_manager) != NULL)
+ return TRUE;
+ }
}
}
}
@@ -450,7 +456,7 @@ int main(int argc, char * argv[])
}
/* If we are under KDM, its "Switch User" is available. */
- if (verify_running("kdm", "kdmctl"))
+ if (verify_running("xdm", "kdmctl", "kdm"))
{
handler_context.switch_user_available = TRUE;
handler_context.switch_user_KDM = TRUE;
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2012-01-16 12:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-16 8:12 Alexey Borisenkov
2012-01-16 12:11 ` Sergey V Turchin [this message]
2012-01-16 12:36 ` Alexey Borisenkov
2012-01-16 13:08 ` Sergey V Turchin
2012-01-16 16:08 ` Alexey Borisenkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9700499.5ktIjMqu2a@summoner.localdomain \
--to=zerg@altlinux.org \
--cc=sisyphus@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Sisyphus discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
public-inbox-index sisyphus
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.sisyphus
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git