Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mate-session compatibility with elogind #146

Closed
glensc opened this issue Aug 18, 2017 · 22 comments
Closed

mate-session compatibility with elogind #146

glensc opened this issue Aug 18, 2017 · 22 comments

Comments

@glensc
Copy link

glensc commented Aug 18, 2017

Expected behaviour

No assertion in logs, doing similar code path what would happen if systemd-logind was running.

Actual behaviour

Aug 18 08:52:21 rotten-fruit mate-session[2823]: CRITICAL: gsm_systemd_set_session_idle: assertion 'session_path != NULL' failed

Steps to reproduce the behaviour

  1. install elogind
  2. suspend: loginctl suspend
  3. wake up using keypress, mouse, etc

MATE general version

1.18

Package version

mate-session-manager-1.18.0-1.x86_64

Linux Distribution

PLD Linux


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@glensc
Copy link
Author

glensc commented Aug 18, 2017

cross-ref with elogind tracker: elogind/elogind#26

@joakim-tjernlund
Copy link
Contributor

I suspect the problem is because MATE does not support elogind. Grepping for elogind
in mate-session sources gives noting.
Adding elogind should be easy though, see https://bugs.gentoo.org/show_bug.cgi?id=599482
for adding elogind to gvfs

@joakim-tjernlund
Copy link
Contributor

The same probably applies to mate-power-manager

@jorgicio
Copy link
Contributor

jorgicio commented Oct 9, 2018

I created an attempt of patch in order to enable elogind for MATE session 1.20.x. You can check it here: https://gist.github.com/jorgicio/8ff7d8b9d2147771c7dc9e3753067e19

I hope it helps.

@joakim-tjernlund
Copy link
Contributor

Yes, that is a good start. One thing I suspect needs fixing is:

#ifdef defined(HAVE_SYSTEMD) || defined(HAVE_LIBELOGIND)
 #include <systemd/sd-login.h>
#endif

I recall elogind has is own include prefix, possibly <logind/sd-login.h> ?
You could try renaming the systemd include dir and see if mate-session still builds.

@joakim-tjernlund
Copy link
Contributor

ehh, I migth be wrong. Seems like the include patch now is the same ?

@joakim-tjernlund
Copy link
Contributor

@jorgicio, Would be great if you could have a look at mate-power as well.

@jorgicio
Copy link
Contributor

@joakim-tjernlund I fixed the patch when I replaced the "ifdef" for "if". I tried that patch and found doesn't work good as well because some apps crash, like mate-panel, which segfaults.
Respect on mate-power, it doesn't depend totally on which are you using (systemd, elogind or consolekit), only at the packaging time (as it happened with Gentoo).

Yes, it's a good start, but there's some more work to do.

@joakim-tjernlund
Copy link
Contributor

Do you have a functional elogind DE(like KDE ) ?

Yes, mate-power seems to be a runtime dep only.

@jorgicio
Copy link
Contributor

Do you have a functional elogind DE(like KDE ) ?

Yes, mate-power seems to be a runtime dep only.

Nope, I only have MATE installed, and I'm not thinking about using another desktop by now.

@joakim-tjernlund
Copy link
Contributor

@jorgicio I think you can just define both SYSTEMD and LOGIND in configure.
That way you don't need to mess with the source code.

@jorgicio
Copy link
Contributor

@jorgicio I think you can just define both SYSTEMD and LOGIND in configure.
That way you don't need to mess with the source code.

You mean define LOGIND as the same way as SYSTEMD?

@joakim-tjernlund
Copy link
Contributor

I mean adding a:
AC_DEFINE([HAVE_SYSTEMD]
inside the new logind configure snipped so that both HAVE_LIBELOGIND and HAVE_SYSTEMD are
defined.

@jorgicio
Copy link
Contributor

I mean adding a:
AC_DEFINE([HAVE_SYSTEMD]
inside the new logind configure snipped so that both HAVE_LIBELOGIND and HAVE_SYSTEMD are
defined.

It's actually the same idea of I did, but not messing a lot the code. Also, HAVE_SYSTEMD and HAVE_ELOGIND (or whatever the name) make some diference at the time of including the headers. In the case of Systemd, the header is <systemd/sd-login.h>, while in Elogin is <elogind/sd-login.h>.

Some time ago, until yesterday, I tried solutions like that, and the result is the same for all the tests I tried: some MATE apps (like mate-panel) crash at start and I can't start the session.

I started a Gentoo repo as an attempt, and this is the last patch I used: https://github.com/jorgicio/mate-elogind-gentoo/blob/master/mate-base/mate-session-manager/files/mate-session-manager-1.20-enable-elogind.patch

@joakim-tjernlund
Copy link
Contributor

@jorgicio Head over to
elogind/elogind#70

@darkshram
Copy link

@jorgicio Elogind and SystemD are mutually exclusive. So, instead of trying to make patches for everything to recognize elogind, wouldn't it be easier to just ask elogind developers to symlink and own /usr/include/systemd and /usr/lib64/pkgconfig/libsystemd-login.pc? I'm doing some testing in my systemd-less distro to replace ConsoleKit2 and so far everything builds Ok.

@joakim-tjernlund
Copy link
Contributor

0001-Add-LOGIND-support.txt

Dry port to elogind that builds.

@jorgicio
Copy link
Contributor

jorgicio commented Mar 8, 2019

0001-Add-LOGIND-support.txt

Dry port to elogind that builds.

Thanks, I just watched this and I'll try to port this to see what happens.

This was referenced Mar 8, 2019
@vkareh
Copy link
Member

vkareh commented Mar 8, 2019

I've moved the patch as a draft pull request (#195) to track within the project. I also removed the version requirement for libelogind, since I don't know what any version any distro uses (it's not in the Fedora repos, from what I can see). Please head over to #195 to continue the discussion around this patch.

@jorgicio
Copy link
Contributor

jorgicio commented Mar 8, 2019

Just tried there the patch and it works flawlessly. Thanks to @joakim-tjernlund for the patch.

Now it's included in my Gentoo overlay. check jorgicio/mate-elogind-gentoo repo.

@darkshram
Copy link

I have applied patch in testing packages for my Fedora-based-but-systemd-less distro. Builds pretty good. In a few weeks will issue a BETA liveCD with MATE Desktop using elogind. So far works perfectly with all my test machines.

@joakim-tjernlund
Copy link
Contributor

Thank you Victor :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants