You are not logged in.

#26 2009-11-11 00:56:03

Ghost1227
Forum Fellow
From: Omaha, NE, USA
Registered: 2008-04-21
Posts: 1,422
Website

Re: The Console Display Manager

Andrwe wrote:

I don't know if you'll like it but I've added a manual how you can get commands like shutdown in the menulist to the wikipage.
And I've updated the part "Configuring CDM".

Good idea! Added a builtin option configurable the same way as console, with the ability to specify both shutdown and reboot commands.

Andrwe wrote:

I've found a bug if you start an X session the session isn't started in a login shell that causes loss of e.g. umlauts for german keyboard layout (öäüß).
As a fast solution I've changed in /usr/bin/cdm

exec ck-launch-session startx /usr/share/cdm/xinitrc -- :${display} &> /dev/null &

into

exec ck-launch-session bash --login -c startx /usr/share/cdm/xinitrc -- :${display} &> /dev/null &

But this solution is bash dependent.

Added an option to use the login shell, it can be activated in the system settings section of cdmrc.


.:[My Blog] || [My GitHub]:.

Offline

#27 2009-11-11 07:33:53

Andrwe
Member
From: Leipzig/Germany
Registered: 2009-06-17
Posts: 322
Website

Re: The Console Display Manager

Works like a charm now.
I like it very much, all my systems use it now. smile

Offline

#28 2009-11-11 07:46:55

Barrucadu
Member
From: York, England
Registered: 2008-03-30
Posts: 1,158
Website

Re: The Console Display Manager

eldragon wrote:

im not sure if this was thought of yet, but maybe it source a per user config that should override the global one, instead of having the special settings in /etc/cdmrc, there should be a ~/.cdm/ dir with user settings.

If you're going to have per-user settings, at least store them in $XDG_CONFIG_HOME tongue

Offline

#29 2009-11-11 08:00:57

Andrwe
Member
From: Leipzig/Germany
Registered: 2009-06-17
Posts: 322
Website

Re: The Console Display Manager

I've got an other idea but I don't know how to implement it.
If an user already has a session running and login again he gets two possibilities (if activated in the config file) first he can use the already running session or second he can start a new session.


I've a security question, is it possible to log a session if the tty is changed?

Offline

#30 2009-11-11 11:39:07

eldragon
Member
From: Buenos Aires
Registered: 2008-11-18
Posts: 1,029

Re: The Console Display Manager

Barrucadu wrote:
eldragon wrote:

im not sure if this was thought of yet, but maybe it source a per user config that should override the global one, instead of having the special settings in /etc/cdmrc, there should be a ~/.cdm/ dir with user settings.

If you're going to have per-user settings, at least store them in $XDG_CONFIG_HOME tongue

im talking about the following part of /etc/cdmrc:

##########################
### USER CONFIGURATION ###
##########################

# courtney() {
        # Set CDM theme
        # theme=lime

        # List user allowed WM binary names
        # wmbinlist=(openbox-session)

        # List user allowed WM display names
        # wmdisplist=(Openbox)

        # Allow console login?
        # allowconsole=no

        # Set specific display for user
        # display=1
# }

############################

which is a per user settings. right now, if a user wants special treatment (be it a different theme), he/she needs root privileges to edit that file.


anyway, im liking it..

one small issue. i used gdm before this and apparently it handled my suspend actions since the key combinations stopped working when i got rid of gdm. is there any way i can fix this? or should i set it manually like ive already done?


EDIT: the suspend issue is linked to polkit. so is the issue of not being able to mount pendrives and such... the problem is explained here: http://bbs.archlinux.org/viewtopic.php?id=82170&p=2


the solution is, instead of starting gnome-session, create a script with the following:

#!/bin/bash
exec ck-launch-session gnome-session

and start the session with that script instead.

Last edited by eldragon (2009-11-11 17:09:43)

Offline

#31 2009-11-11 23:42:54

Ghost1227
Forum Fellow
From: Omaha, NE, USA
Registered: 2008-04-21
Posts: 1,422
Website

Re: The Console Display Manager

eldragon wrote:

the solution is, instead of starting gnome-session, create a script with the following:

#!/bin/bash
exec ck-launch-session gnome-session

and start the session with that script instead.

How is coding exec ck-launch-session gnome-session into CDM different then calling a script that does the same thing? Am i missing something? I would like full gnome support in CDM, so if you can point out what I'm missing I'll be thankful tongue


.:[My Blog] || [My GitHub]:.

Offline

#32 2009-11-12 01:26:21

eldragon
Member
From: Buenos Aires
Registered: 2008-11-18
Posts: 1,029

Re: The Console Display Manager

Ghost1227 wrote:
eldragon wrote:

the solution is, instead of starting gnome-session, create a script with the following:

#!/bin/bash
exec ck-launch-session gnome-session

and start the session with that script instead.

How is coding exec ck-launch-session gnome-session into CDM different then calling a script that does the same thing? Am i missing something? I would like full gnome support in CDM, so if you can point out what I'm missing I'll be thankful tongue

no, im sure there is no difference, i just dont know how to pass the command with spaces wink


----
SNIP!!   (read previous post on the issue wink )

EDIT

enableloginshell=yes drops the default xorg screen ( a couple of xterms and the clock thingy) instead sad

Last edited by eldragon (2009-11-12 01:56:49)

Offline

#33 2009-11-12 05:09:31

Ghost1227
Forum Fellow
From: Omaha, NE, USA
Registered: 2008-04-21
Posts: 1,422
Website

Re: The Console Display Manager

I just pushed a tiny update that (may) fix the gnome-session issue, mind testing it for me?


.:[My Blog] || [My GitHub]:.

Offline

#34 2009-11-12 11:29:46

eldragon
Member
From: Buenos Aires
Registered: 2008-11-18
Posts: 1,029

Re: The Console Display Manager

Ghost1227 wrote:

I just pushed a tiny update that (may) fix the gnome-session issue, mind testing it for me?

if you are refering to the locale settings, it didnt work.

same issue, loginshell=yes drops to an empty xorg

EDIT

read through your changes, and realized you were testing against gnome-session as a binary, which i had replaced for stargnome.

anyway, switching it back to gnome-session, X fails to start.

EDIT 2

added

LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"

to /etc/environment to fix the issue. and it does. but i guess this should be done within CDM, i dont know how to do this sad

Last edited by eldragon (2009-11-12 12:53:05)

Offline

#35 2009-11-12 12:52:05

Andrwe
Member
From: Leipzig/Germany
Registered: 2009-06-17
Posts: 322
Website

Re: The Console Display Manager

What happens when you run gnome-session on a tty manually?

Offline

#36 2009-11-12 12:56:04

eldragon
Member
From: Buenos Aires
Registered: 2008-11-18
Posts: 1,029

Re: The Console Display Manager

Andrwe wrote:

What happens when you run gnome-session on a tty manually?

gnome-session is not supposed to be run on its own, anyway, tried it and it fails to open the display.

im going to try and start x manually with gnome-session and see what happens....


EDIT
removed the environment tweaks, logged into console and ran "startx /usr/bin/gnome-session" and it worked ok.

Last edited by eldragon (2009-11-12 12:59:48)

Offline

#37 2009-11-12 13:13:58

Ghost1227
Forum Fellow
From: Omaha, NE, USA
Registered: 2008-04-21
Posts: 1,422
Website

Re: The Console Display Manager

Well that makes no.... wait... i got an idea.


.:[My Blog] || [My GitHub]:.

Offline

#38 2009-11-12 13:17:45

Ghost1227
Forum Fellow
From: Omaha, NE, USA
Registered: 2008-04-21
Posts: 1,422
Website

Re: The Console Display Manager

Try it now.


.:[My Blog] || [My GitHub]:.

Offline

#39 2009-11-12 13:25:31

choubi
Member
Registered: 2009-10-08
Posts: 15

Re: The Console Display Manager

Hi,
am I the only one having troubles getting multiple x-sessions running ? If I try to log in a second user once a first user is running X, the second (last) user to log on gets thrown back to tty1 login.  Having looked around a bit it seems X tries to start on display 0 regardless of the value of ${display}. 

Fatal server error:
Server is already active for display 0

EDIT:
I've tried the following after logging a second user in on tty2; with success;

> source /etc/cdmrc
> export wm_bin=/path/to/wm
> exec ck-launch-session startx /usr/share/cdm/xinitrc -- :${display} &> /dev/null &

and by magic - a second x-session appears on ctrl-alt-F8 !
EDIT 2:
but when I try the login shell version (I run bash) i.e

exec ck-launch-session --login -c startx /usr/share/cdm/xinitrc -- :${display}

X fails with same error as above.

Hope this information is helpful.

Last edited by choubi (2009-11-12 15:21:18)

Offline

#40 2009-11-12 14:02:20

eldragon
Member
From: Buenos Aires
Registered: 2008-11-18
Posts: 1,029

Re: The Console Display Manager

Ghost1227 wrote:

Try it now.

nope. same results as above: summarizing:

wmbinlist=(gnome-session)
loginshell=no

starts gnome but locale is set wrong in gnome-terminal

----

wmbinlist=(gnome-session)
loginshell=yes

starts X with default stuff (no gnome-session), some xterm and a clock

----

the new version takes 2 seconds longer to start X too no matter what i do
both tests have been done with /etc/environment empty

EDIT

to reply to the above post:

choubi wrote:

Hi,
am I the only one having troubles getting multiple x-sessions running ? If I try to log in a second user once a first user is running X, the second (last) user to log on gets thrown back to tty1 login.  Having looked around a bit it seems X tries to start on display 0 regardless of the value of ${display}. 

Fatal server error:
Server is already active for display 0

yes, same issue here...

Last edited by eldragon (2009-11-12 14:03:59)

Offline

#41 2009-11-13 15:58:01

choubi
Member
Registered: 2009-10-08
Posts: 15

Re: The Console Display Manager

I'm not a bash (nor any other scripting language) expert, but I have the feeling there is a problem with how variables are exported.  That is one thing I never really got my head around - where should a user put definitions of variables like proxies, ssh-agents etc. ? Using cdm, stuff that was working with slim don't - due to missing definitions of variables I think.

Another thing I don't know is in what order /etc/profile.d/*.sh get executed.  If some is not done before /etc/profile.d/cdm-profile.sh, then they will not be executed as far as I understand (and that might include the locale.sh and also more important for me x11-ssh-askpass.sh).  Furthermore - if one does NOT use the login shell option I think neither ~/.bash_profile nor ~/.bashrc nor ~/.xinitrc gets read.  Is this intentional ?

Offline

#42 2009-11-13 23:34:59

Ghost1227
Forum Fellow
From: Omaha, NE, USA
Registered: 2008-04-21
Posts: 1,422
Website

Re: The Console Display Manager

choubi wrote:

I'm not a bash (nor any other scripting language) expert, but I have the feeling there is a problem with how variables are exported.  That is one thing I never really got my head around - where should a user put definitions of variables like proxies, ssh-agents etc. ? Using cdm, stuff that was working with slim don't - due to missing definitions of variables I think.

That may be true, CDM is very much in alpha state still, things will go wrong. I'm still researching the best way to handle things like this.

choubi wrote:

Another thing I don't know is in what order /etc/profile.d/*.sh get executed.  If some is not done before /etc/profile.d/cdm-profile.sh, then they will not be executed as far as I understand (and that might include the locale.sh and also more important for me x11-ssh-askpass.sh).  Furthermore - if one does NOT use the login shell option I think neither ~/.bash_profile nor ~/.bashrc nor ~/.xinitrc gets read.  Is this intentional ?

I'm not using the login shell option and all .bash_profile and .bashrc both get sourced for me just fine. .xinitrc does not get read because CDM has an inbuilt xinitrc to handle launching of various DE/WMs without the need for editing user configs. Once I get a few things sorted out (incremental X displays and the issues with gnome-session primarily) I plan on adding a configuration option for setting commands to run at startup. This should handle anything outside of the actual session that you would typically put in xinitrc.


.:[My Blog] || [My GitHub]:.

Offline

#43 2009-11-16 10:13:53

choubi
Member
Registered: 2009-10-08
Posts: 15

Re: The Console Display Manager

So far I've only been raising issues and problems - I'd like to make it clear that I find the idea of a console display manager absolutely brilliant.

Ghost1227 wrote:

That may be true, CDM is very much in alpha state still, things will go wrong. I'm still researching the best way to handle things like this.
...
I'm not using the login shell option and all .bash_profile and .bashrc both get sourced for me just fine.

Regarding the first point - I think the problem lies in when the cdm scripts are run.  As one would want them to be independent on the user and his/her options/local variables/and so forth there are only two possibilities: either run them as early as possible, that is from inittab or very early in /etc/profile and then source the rest of the login scripts from cdm (I do not know if this is possible), OR run them as late as possible, i.e AFTER ~/.bashrc, /etc/profile.d and friends (not a very clean way of doing it).  As stated somewhere above - I'm not very good with scripting - I merely try to find a way where you avoid interfering with the rest of the login scripts.  Right now it runs in the middle (depending on the order (alphabetical ?) the scripts in /etc/profile.d/ are run) and starts X before having finished with the rest of the login scripts.

Regarding the second point - yes you're right - I must have messed up something when I tried to figure out why SSH_ASKPASS wasn't set and exported as before.

Offline

#44 2009-11-17 14:27:09

Ghost1227
Forum Fellow
From: Omaha, NE, USA
Registered: 2008-04-21
Posts: 1,422
Website

Re: The Console Display Manager

I'm still having issues with incremental X sessions, if anyone has any ideas or wants to take a crack at it, please feel free.


.:[My Blog] || [My GitHub]:.

Offline

#45 2009-11-17 15:49:55

choubi
Member
Registered: 2009-10-08
Posts: 15

Re: The Console Display Manager

Maybe you could use the lock files in /tmp/.X11-unix/ ?  There seems to be one for each display - called X0, X1 etc

Offline

#46 2009-11-18 00:33:19

PiousMinion
Member
Registered: 2009-07-21
Posts: 12

Re: The Console Display Manager

Isn't CDM more of a session manager than a display manager?

I would imagine most people use a display manager to have pretty/useful login facility, but CDM doesn't start until after the login.

Are there any plans to add the ability to login from CDM itself?

Offline

#47 2009-11-18 02:02:17

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: The Console Display Manager

Ghost1227 wrote:

I'm still having issues with incremental X sessions, if anyone has any ideas or wants to take a crack at it, please feel free.

I'm using this script for my needs, maybe you can use something, or get an idea:

#!/bin/bash
#------------------------------
# A script for a starting Xorg, by moljac024
#------------------------------
# Configuration:
# X starts on tty number:
X_TTY=7
#------------------------------

# Check arguments
if [[ "$#" -lt "1" ]]; then
   display=0
else
   display="$1"
fi
if `echo "$1" | grep [^0-9] &>/dev/null`; then
   #echo "Specified argument is not a number, defaulting to display :0"
   display=0
fi

# Check if X is already running on that display
xdpyinfo -display :$display.0 &> /dev/null && \
echo $? &> /dev/null

# Start X or switch to it if it is already running
if [[ `echo $?` == "1" ]]; then
   echo "Starting X..."
   exec ck-launch-session startx -- :$display &> /dev/null &
else
   echo "Switching to X..."
   let tty=$display+$X_TTY
   sudo chvt $tty
fi

The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#48 2009-11-18 03:26:38

Ghost1227
Forum Fellow
From: Omaha, NE, USA
Registered: 2008-04-21
Posts: 1,422
Website

Re: The Console Display Manager

Actually your script was what gave me the idea for cdm, and I based my 'jailed tty' option on much the same idea. however, autoincrementation still fails.


.:[My Blog] || [My GitHub]:.

Offline

#49 2009-11-18 08:24:22

Andrwe
Member
From: Leipzig/Germany
Registered: 2009-06-17
Posts: 322
Website

Re: The Console Display Manager

This isn't nice but it works to get the highest used screen number:

find /tmp/ -maxdepth 1 -name .X*-lock | tail -n 1 | sed 's/.*\([0-9]\).*/\1/g'

Offline

#50 2009-11-18 08:56:52

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: The Console Display Manager

Wouldn't something as simple as this work:

# Get the first empty display
display=0
while true; do
    xdpyinfo -display :$display.0 &> /dev/null && \
    echo $? &> /dev/null
    if [[ "$?" == "0" ]]; then
        let display=$display+1
    else
        break
    fi
done

echo "Starting X at display $display.."
exec ck-launch-session startx -- :$display &> /dev/null &

I just tried it and it works fine, it starts X at the first empty display...is that what you wanted?


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

Board footer

Powered by FluxBB