VectorLinux

Please login or register.

Login with username, password and session length
Advanced search  

News:

Visit our home page for VL info. For support and documentation, visit the Vector Linux Knowledge Center or search the Knowledge Center and this Forum using the search box above.

Author Topic: Installing Lightdm  (Read 414 times)

black-clover

  • Member
  • *
  • Posts: 84
  • user
Installing Lightdm
« on: August 23, 2017, 06:48:29 pm »

Hello everybody,

I' d like to replace Gdm with Lightdm, the reason being that Lightdm allows a very smooth transition from login to the Xfce desktop, whereas with Gdm there is always a flash before it loads Xfce.
Assuming that I remove Gdm and install Lightdm from sources, how do I configure the system so it would load it properly?
Logged

roarde

  • Vectorian
  • ****
  • Posts: 753
  • it's enough
Re: Installing Lightdm
« Reply #1 on: August 24, 2017, 11:16:59 am »


Here's where gdm is launched from within /etc/rc.d/rc.X:
Code: [Select]
## launch a login manager
for DM in $DISPLAY_MANAGER KDM GDM WDM XDM NONE; do
  case $DM in
  KDM)
    if [ -x $KDM_CMD ]; then
      #echo KDE Display Manager
      exec $KDM_CMD -nodaemon
      exit
    fi
    ;;
  GDM)
    if [ -x $GDM_CMD ]; then
      #echo GNOME Display Manager
      clear
      exec $GDM_CMD -nodaemon
      exit
    fi
    ;;
  WDM)
    if [ -x $WDM_CMD ]; then
      #echo WING Display Manager
      buildsessions WDM &> /dev/null
      exec $WDM_CMD -nodaemon > /dev/null
      exit
    fi
    ;;
  XDM)
    if [ -x $XDM_CMD ]; then
      #echo XFree86 Display Manager
      exec $XDM_CMD -nodaemon
      exit
    fi
    ;;
  NONE)
    # error
    echo
    echo "Hey, you don't have KDM, GDM, WDM, or XDM."
    echo "Can't use GUI mode without one of them installed, mate."
    sleep 30
    break
    ;;
  esac
done
$GDM_CMD, etc were already set further up the script.

When that was written many years ago, it had to be done pretty much that way. But it would be nice to have a setup that allows for external configuration of X display manager instead of its being hard-coded in a script.

You can start tracking the entire initialization process (after boot and initrd) by looking over /etc/inittab.

enjoy!
Logged
Robert

black-clover

  • Member
  • *
  • Posts: 84
  • user
Re: Installing Lightdm
« Reply #2 on: August 24, 2017, 12:42:15 pm »

Thanks alot, this is fascinating.
Logged

roarde

  • Vectorian
  • ****
  • Posts: 753
  • it's enough
Re: Installing Lightdm
« Reply #3 on: August 25, 2017, 01:38:31 pm »

If it becomes more frustrating than fascinating, we'll give more detail. Just figured you didn't want that right now :)
Logged
Robert

black-clover

  • Member
  • *
  • Posts: 84
  • user
Re: Installing Lightdm
« Reply #4 on: September 10, 2017, 01:55:44 pm »

is /etc/rc.d/rc.x the only file I would need to edit in order to start lightdm?

Also, considering the binary the lightdm package installed is /usr/sbin/lightdm, how would I have to modify the entry in rc.x?
Logged

roarde

  • Vectorian
  • ****
  • Posts: 753
  • it's enough
Re: Installing Lightdm
« Reply #5 on: September 10, 2017, 03:51:08 pm »

I think /etc/rc.d/rc.X is the only file that needs changing in order to start Lightdm, but I'm not sure about that. Thing is, you still need a working configuration of Lightdm itself. I don't know how Lightdm would choose which greeter to use, for example. That's part of figuring out its configuration.

As for how to modify rc.X, see if you can read it through, or at least chase down references to the various display managers and work from there. I do notice that if DISPLAY_MANAGER is not set, the order of trying display managers is kdm, gdm, wdm, xdm, and none. You'd want to insert ldm naturally, but also may want to change the order of those already there. Because of how VL implements various flavors, you actually do want kdm first. Then gdm, no doubt. Choose between ldm and xdm next, and tag on wdm after that for those waxing nostalgic. For bonus points, the NONE entry isn't really necessary, but further changes would be needed to leave it out.

You can include the new rc.X in any potential slackbuild, but you want to do that without forcing those installing the package to start using Lightdm right away. Take a look at how the .new files are handled in NetworkManager.SlackBuild. You have to look at the config() section that gets added to the doinst.sh to see it. What's missing there is a notice to take a look at the .new files, which would be printed on the screen when the package is installed and the doinst is run.

What you were asking about was the difference between /usr/bin and /usr/sbin. I actually think display managers belong in /usr/sbin, but the case can be made for /usr/bin as well. Make your choice. Adding /usr/sbin/lightdm is not a problem, just do it as the others (like /usr/bin/gdm) are done. If you want lightdm in /usr/bin instead, there's a ./configure option that would do that.

You probably should websearch "lightdm slackbuild" and take a look at some of the results. There are small differences in the way Slackware and VL implement PAM and the display managers, so read carefully.
Logged
Robert

black-clover

  • Member
  • *
  • Posts: 84
  • user
Re: Installing Lightdm
« Reply #6 on: September 14, 2017, 03:44:07 pm »

Thanks for the info,

I decided to try this step by step, editing /etc/rc.d/rc.x to learn the ropes.
First, I changed:

DISPLAY_MANAGER=XDM

and xdm showed up after rebooting (albeit I was not able to make it start the right wm)
Since Slim is already in the repo, I decided to try that next.

I edited  rc.x as follow:

Code: [Select]
# This setting will be changed by vxdmset
DISPLAY_MANAGER=SMD


#####################################################
# Don't touch below these. Expert is excepted ;)
KDM_CMD=/usr/bin/kdm
SMD_CMD=/usr/bin/slim
GDM_CMD=/usr/bin/gdm
WDM_CMD=/usr/bin/wdm
XDM_CMD=/usr/bin/xdm

and below;

Code: [Select]
    ;;
  SDM)
    if [ -x $SDM_CMD ]; then
      #echo SDM Display Manager
      clear
      exec $SDM_CMD -nodaemon
      exit
    fi
    ;;

Of course it didn't work.
How should I change the entries?
Logged

roarde

  • Vectorian
  • ****
  • Posts: 753
  • it's enough
Re: Installing Lightdm
« Reply #7 on: September 14, 2017, 10:20:34 pm »

The "vxdmset" mentioned was part of vasm originally, but the most recent vasm-legacy doesn't have it; it's unavailable unless one grabs the old source. Setting display manager manually by editing rc.X is a valid method. Why not list all of the display managers up front, comment each out, then uncomment the one used. A cheap way of documenting the possibly available display managers.
#DISPLAY_MANAGER=KDM
#DISPLAY_MANAGER=GDM

and so on.

The entries as you have them are fine, though it would be more consistent to add slim to the "for" list too, so it can be tested when DISPLAY_MANAGER isn't set, like the rest are.

Because of the chance of breaking someone's configured, working system (and a few other reasons), I'm guessing that an offer of a new official rc.X for 7.2 may not be accepted. It's easy enough for interested users to customize on their own while 7.2 is the current version.

The problem is in slim's configuration. If you installed slim from the command line, you were shown a note to check out /etc/slim.conf.new and /etc/logrotate.d/slim.new. If you haven't, rename each of those without the .new extension.

Now look at /etc/slim.conf:
Code: [Select]
login_cmd       exec /bin/bash -login ~/.xinitrc %sessionThat's only going to work when a user has an .xinitrc that looks very similar to the sample provided with the Slim source code. (It would be nice to have that copied to /usr/doc/slim-*/, but I'm not taking the time to do that.) Comment out that login_cmd line in slim.conf. There must be better ways to do this, but here's a working line so you can get on with what you're doing:
Code: [Select]
login_cmd       exec /bin/bash -login -c ". ~/.xinitrc || . /etc/X11/xinit/xinitrc"
A Bash shell is started with a fresh environment just as in a terminal login, except that what follows "-c" is executed: That shell tries to source a user's .xinitrc; should that fail -- usually because the user doesn't have one --, then /etc/X11/xinit/xinitrc is sourced. That's usually a link to the system's default desktop session, as distinguished from the default session that's just an xterm. A VL installation has that linking done by default.

Gdm, and I think Kdm, use a different method. The user's preferred session type is given in ~/.dmrc. I once chased down exactly how things end up there, but have forgotten. Can anyone remind me? Anyway, whatever Session= is pointing to, the desktop file /usr/share/xsessions/<Session>.desktop is read and its Exec= setting is executed, with "default" being  a special case.

A lot of different ways to go here, but the edit above to slim.conf will get you something working. The flash you mentioned elsewhere that GDM has isn't present for Slim. I resized my desktop wallpaper to fit my screen so that it wouldn't have to be resized on the fly. Icewmvmods is my DE. Because spacefm has a flash of its own and doesn't handle background transparency on startup, I disabled spacefm control of the desktop in the IceWM startup file, then set IceWM preferences to have icewmbg handle the background. Then I set both Slim and icewmbg to use the background made from the wallpaper above. As far as can be seen, all that happens after login is that the word "Login:" and the text-typing box disappear, leaving me in my desktop and looking at the same wallpaper, with no flash at all.

Nice find. I think we'd all forgotten about Slim.
Logged
Robert

black-clover

  • Member
  • *
  • Posts: 84
  • user
Re: Installing Lightdm
« Reply #8 on: September 15, 2017, 01:31:21 pm »

Robert,
thanks for your input.

Everything you say makes a lot of sense, as usual.
I just hacked away whatever I didn't need in the rc.x file and now Slim starts as default display manager in my project VL.
Since it is going to be the only DM installed I think that's ok.

It's nice to know that Slim allows a smooth transition into the desktop, which was the real issue in the first place.
I haven't had time  to deal with the graphic setup yet, since I want to deal with functionality first.
I copied Slim sample .xinitrc to ~/ and it starts Jwm all right.
I also tried

Code: [Select]
login_cmd       exec /bin/bash -login -c ". ~/.xinitrc || . /etc/X11/xinit/xinitrc"
In the slim.conf file but I get an error, it just can't execute login.

Slim seems to be a versatile DM, and I just got started, so there's quite a bit to learn about its functions.


 
Logged