PDA

View Full Version : Lightweight Display Manager with auto-login



KevinHansen
05-Mar-2015, 15:12
Hi.
We are preferring Icewm as WM but unfortunately the default Display Manager XDM doesn't allow auto-login.

On our SLED 11 SP3 setup we have edited /etc/inittab and disabled DM.
However as far as I understand the recommended setup is to use a DM and I have always thought of this workaround as a bit of a hack.

So now with SLE 12 and a new systemd based way to setup this up anyway, I would like to know if there is a recommended way to setup auto-login for Icewm, without using GDM and all that comes with it.

I would like to setup as clean a SLE 12 system as possible and I can't find a lightweight DM in the SLE 12 repos that allow auto-login.

Thank you in advance for any help and feedback on this.

Kind Regards,
Kevin

malcolmlewis
06-Mar-2015, 01:50
On Thu 05 Mar 2015 02:14:01 PM CST, KevinHansen wrote:


Hi.
We are preferring Icewm as WM but unfortunately the default Display
Manager XDM doesn't allow auto-login.

On our SLED 11 SP3 setup we have edited /etc/inittab and disabled DM.
However as far as I understand the recommended setup is to use a DM and
I have always thought of this workaround as a bit of a hack.

So now with SLE 12 and a new systemd based way to setup this up anyway,
I would like to know if there is a recommended way to setup auto-login
for Icewm, without using GDM and all that comes with it.

I would like to setup as clean a SLE 12 system as possible and I can't
find a lightweight DM in the SLE 12 repos that allow auto-login.

Thank you in advance for any help and feedback on this.

Kind Regards,
Kevin




Hi
With systemd and a customized getty service you can skip any login type
manager straight to your desktop of choice (basically a kiosk mode).
http://0pointer.de/blog/projects/serial-console.html

Have a look here at an example...
http://wiki.gentoo.org/wiki/X_without_Display_Manager#X11_autologin_with_syste md

--
Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel 3.12.36-38-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below... Thanks!

KevinHansen
06-Aug-2015, 23:28
Hi
With systemd and a customized getty service you can skip any login type
manager straight to your desktop of choice (basically a kiosk mode).


Hi Malcolm.
I hope you can help with this follow-up question to this post.

We did setup a simple systemd based login method, so that we login to icewm without using any login/display manager.
This has worked fine.

However we are struggling with some permission issues using e.g. the graphical Gnome NetworkManager while logging in this way.
We can run the nm-applet on start-up and LAN network just connects. However trying to connect to a WiFi network we are getting the following message:
"Failed to add new connection: (32) Insufficient privileges"

If we run the nm-applet as root we can connect to a WiFi, also as regular user, without getting this message.
So the permissions issues are concerning the regular user only.

As far as I can see this has something to do with polkit not being configured the right way with our current login method (without DM).
Our primary problem is the WiFi issue, but I think this is affecting a bunch of other things for the regular user.

I have tried all suggestions I have been able to find like custom rules in /etc/dbus-1/system.d/ and /etc/polkit-1/rules.d/ etc.
Nothing has worked so far.
(besides I would really like to be sure that the fundamental setup and all dependencies for polkit etc. is setup the right way - so that we are not relying on a ugly hack to get this working)


Could you explain what is required in order to get polkit working the right way during login?
Apparently the DisplayManager we used before did load / setup a couple of things which we are not doing now with just a systemd rule and startx.

Any help is much appreciated!

PS. If you have any suggestions to another WiFi Network manager with a GUI we could use, I am very interested in suggestions as here as well.

Thank you.

Kind Regards,
Kevin

malcolmlewis
06-Aug-2015, 23:42
On Thu 06 Aug 2015 10:34:01 PM CDT, KevinHansen wrote:


malcolmlewis;26772 Wrote:
> Hi
> With systemd and a customized getty service you can skip any login
> type manager straight to your desktop of choice (basically a kiosk
> mode).
>

Hi Malcolm.
I hope you can help with this follow-up question to this post.

We did setup a simple systemd based login method, so that we login to
icewm without using any login/display manager.
This has worked fine.

However we are struggling with some permission issues using e.g. the
graphical Gnome NetworkManager while logging in this way.
We can run the nm-applet on start-up and LAN network just connects.
However trying to connect to a WiFi network we are getting the following
message:
"Failed to add new connection: (32) Insufficient privileges"

If we run the nm-applet as root we can connect to a WiFi, also as
regular user, without getting this message.
So the permissions issues are concerning the regular user only.

As far as I can see this has something to do with polkit not being
configured the right way with our current login method (without DM).
Our primary problem is the WiFi issue, but I think this is affecting a
bunch of other things for the regular user.

I have tried all suggestions I have been able to find like custom rules
in /etc/dbus-1/system.d/ and /etc/polkit-1/rules.d/ etc.
Nothing has worked so far.
(besides I would really like to be sure that the fundamental setup and
all dependencies for polkit etc. is setup the right way - so that we are
not relying on a ugly hack to get this working)


Could you explain what is required in order to get polkit working the
right way during login?
Apparently the DisplayManager we used before did load / setup a couple
of things which we are not doing now with just a systemd rule and
startx.

Any help is much appreciated!

*PS. * If you have any suggestions to another WiFi Network manager with
a GUI we could use, I am very interested in suggestions as here as
well.

Thank you.

Kind Regards,
Kevin




Hi
That's correct, so as the regular user on the wifi settings and select
the 'Identify' section, then select make available to other users.
Enter the root password and it should all work fine after that.

If that doesn't work the for sure it's a polkit setting, need to
investigate more if above doesn't work.

--
Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel
3.12.44-52.10-default If you find this post helpful and are logged into
the web interface, please show your appreciation and click on the star
below... Thanks!

KevinHansen
07-Aug-2015, 10:05
Hi
That's correct, so as the regular user on the wifi settings and select
the 'Identify' section, then select make available to other users.
Enter the root password and it should all work fine after that.

If that doesn't work the for sure it's a polkit setting, need to
investigate more if above doesn't work.


Hi.
I am not getting prompted for root password but get an error about "insufficient privileges" instead.
If I open nm-connection-editor as root, I can setup connections easily.
The connections root setup works for the non-root user, when make available to other users is selected.

So the issue is error messages about "insufficient privileges" every time the non-root user touch a network setting.
When we used a DisplayManager we didn't get these messages and we could connect to a WiFi network, enter WPA2 password and the connection was saved for auto-connect - all done by the non-root user without entering root password.
The DM we used was LightDM and apparently it was taken care of some permission/polkit settings so that non-root user has privileges to edit network-connections and probably also other functions we are not using currently.

I think we are missing something in our systemd "startx" service or xinitrc file, so that polkit is not setup the right way.
Or that it has something to do with the VT we are starting X on like described at this link:
http://comments.gmane.org/gmane.linux.arch.general/44630
----copy from the link----
If you don't use a display manager, it means you won't have a
registered pam session for your graphical login, which means login
won't give the correct info to polkit (it will think that there is no
active session).

A workaround for this is to start your WM on the same VT as your
consolelogin, and hence "steal" that pam session. I believe the magic
incantation is:
----end copy from the link----

Have tried all suggestions I have been able to find but without any luck so far.


This is our very simple login setup:
Used the example you linked to (last method 2): https://wiki.gentoo.org/wiki/X_without_Display_Manager#X11_autologin_with_syste md

1:
created systemd service file:


[Unit]
After=systemd-user-sessions.service

[Service]
ExecStart=/bin/su username -l -c /usr/bin/xinit -- VT08

[Install]
WantedBy=multi-user.target


2:
created xinitrc file in user home dir based on the xinitrc.template and are using this with default settings

3:
Installed icewm and changed WindowManager to icewm in /etc/sysconfig/windowmanager

We have startup programs etc. in the icewm startup file but I will leave that out for now.
In the above clean and simple setup we need to setup some dbus-1 and polkit-1 related rules for our user, so that it works like if we were still using a DisplayManager.


We need NetworkManager the most so this is what we test with:
We have followed the suggestions here in order to allow our user to use NetworkManager: http://awesome.naquadah.org/wiki/Nm-applet

Adding our user to the /etc/dbus-1/system.d/NetworkManager.conf file works and NetworkManager / nm-applet is loaded for our user.
So I believe the dbus-1 setup works.

However setup privileges for our user in order to get rid of "Failed to add new connection: (32) Insufficient privileges" with a polkit-1 rule doesn't work.
Described here: http://jeffhoogland.blogspot.fr/2012/05/howto-give-network-manager-sufficient.html
So I think this is polkit related.

Any idea?

Thanks.

Kind Regards,
Kevin

Carlos E. R.
07-Aug-2015, 17:53
On 2015-08-07 11:14, KevinHansen wrote:
> I think we are missing something in our systemd "startx" service or
> xinitrc file, so that polkit is not setup the right way.

Indeed. You need a display manager to set it up right. startx has very
little or no maintenance, and doesn't cope with it. Other things may
fail as well.

--
Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 "Bottle" at Telcontar)

KevinHansen
10-Aug-2015, 10:58
Indeed. You need a display manager to set it up right. startx has very
little or no maintenance, and doesn't cope with it. Other things may
fail as well.


Hi Carlos.
Thank you for your reply.

Well that will bring me back to my initial question:



I would like to know if there is a recommended way to setup auto-login for Icewm on SLE 12, without using GDM and all that comes with it.

I would like to setup as clean a SLE 12 system as possible and I can't find a lightweight DM in the SLE 12 repos that allow auto-login.


Is GDM really the only way to setup a SLE 12 system with auto-login and all permission etc. setup the right way - if we are using official SLE 12 repo packages only?
I would prefer a more light DM with fewer dependencies however it is more important with a stable system.
I am just surprised if this is the only way.

Any last comments or suggestions here?

Thank you!

Kind Regards,
Kevin

Carlos E. R.
10-Aug-2015, 22:25
On 2015-08-10 12:04, KevinHansen wrote:
> Hi Carlos.
> Thank you for your reply.
>
> Well that will bring me back to my initial question:

Welcome. About your initial question, sorry, I don't know, I'm not an
SLE expert. I just wanted to comment on why startx has problems.

--
Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 "Bottle" at Telcontar)