You are not logged in.
I'm trying to get consolekit to work with autologin, in order to mount stuff as a user in pcmanfm.
When i start X from the shell with xinit everything works:
.xinitrc:
if test -z "$DBUS_SESSION_BUS_ADDRESS"; then
eval "$(dbus-launch --sh-syntax --exit-with-session)"
fi
/usr/bin/urxvtd -q -o -f
/usr/bin/urxvtc
/usr/bin/ck-launch-session /usr/bin/dwm
pstree:
|-login---zsh---xinit-+-.xinitrc--ck-launch-sessi---dwm---pcmanfm
| `-X
ck-list-sessions:
Session1:
unix-user = '1000'
realname = ''
seat = 'Seat1'
session-type = ''
active = FALSE
x11-display = ''
x11-display-device = ''
display-device = '/dev/tty1'
remote-host-name = ''
is-local = TRUE
on-since = '2011-06-04T09:06:26.199904Z'
login-session-id = '1'
Session2:
unix-user = '1000'
realname = ''
seat = 'Seat1'
session-type = ''
active = TRUE
x11-display = ':0'
x11-display-device = '/dev/tty7'
display-device = '/dev/tty1'
remote-host-name = ''
is-local = TRUE
on-since = '2011-06-04T09:06:32.334032Z'
login-session-id = '1'
and i can mount as user, although i'm not sure where that second session comes from.
When i autologin like this:
/bin/su litemotiv -l -c "/bin/sh --login -c xinit"
This doesn't work, there is only one FALSE session and the user is not authorized.
pstree:
|─su───xinit─┬─.xinitrc───ck-launch-sessi───dwm---pcmanfm
| `-X
ck-list-sessions:
Session1:
unix-user = '1000'
realname = ''
seat = 'Seat2'
session-type = ''
active = FALSE
x11-display = ':0'
x11-display-device = '/dev/tty7'
display-device = ''
remote-host-name = ''
is-local = FALSE
on-since = '2011-06-04T08:38:44.753057Z'
login-session-id = '4294967295
What am i missing here? Why doesn't "su username" work as expected? And where is that extra consolekit session coming from?
ᶘ ᵒᴥᵒᶅ
Offline
Try with this:
/bin/su litemotiv -l -c "ck-launch-session dbus-launch /bin/sh --login -c xinit"
Ok.
"Yo creo que los muertos son tiernos. ¿Nos besamos?"
Offline
Try with this:
/bin/su litemotiv -l -c "ck-launch-session dbus-launch /bin/sh --login -c xinit"
Ok.
Hmm no that doesn't work, still getting a Not Authorized then..
ᶘ ᵒᴥᵒᶅ
Offline
Ok, try with this alternative .xinitrc:
urxvtd -q -o -f &
urxvtc &
exec ck-launch-session dbus-launch dwm
and with my other code:
/bin/su litemotiv -l -c "ck-launch-session dbus-launch /bin/sh --login -c xinit"
"Yo creo que los muertos son tiernos. ¿Nos besamos?"
Offline
That doesn't work, it also doesn't seem like a sensible approach to stack multiple consolekit sessions.
Have you tried these suggestions on your own system?
ᶘ ᵒᴥᵒᶅ
Offline
I'm having the very same problem, and none of the alternatives work for me either. Using it with systemd, and logging in normally and using startx works properly with console kit, but not autologin.
Offline
You have to start X from a TTY (a getty or a display manager) so it counts as a local session.
You can use mingetty's autologin feature to get consolekit working without a display manager:
https://wiki.archlinux.org/index.php/St … sh_profile
Last edited by thestinger (2011-06-09 15:45:03)
Offline
That's excellent information thestinger, thanks.
ᶘ ᵒᴥᵒᶅ
Offline
Isn't there a way to make this method https://wiki.archlinux.org/index.php/Au … in_program work? It's faster than the mingetty way -- considerably faster (at least for me). And it works with systemd.
Offline
I did it this way:
I didn't want to edit the getty@.service in /lib, so I created a new one (/etc/systemd/system/getty2@.service).
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
[Unit]
Description=Getty on %I
BindTo=dev-%i.device
After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service
After=rc-local.service
# If additional gettys are spawned during boot then we should make
# sure that this is synchronized before getty.target, even though
# getty.target didn't actually pull it in.
Before=getty.target
[Service]
Environment=TERM=linux
ExecStart=-/sbin/agetty %I 38400
Restart=always
RestartSec=0
UtmpIdentifier=%I
TTYPath=/dev/%I
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes
KillMode=process
# Unset locale for the console getty since the console has problems
# displaying some internationalized messages.
Environment=LANG= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION=
# Some login implementations ignore SIGTERM, so we send SIGHUP
# instead, to ensure that login terminates cleanly.
KillSignal=SIGHUP
[Install]
Alias=getty.target.wants/getty2@tty2.service getty.target.wants/getty2@tty3.service getty.target.wants/getty2@tty4.service getty.target.wants/getty2@tty5.service getty.target.wants/getty2@tty6.service
I simply removed one of the install ttys (the first one).
Then I created another one (/etc/systemd/system/getty2-auto@.service)
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
[Unit]
Description=Getty on %I
BindTo=dev-%i.device
After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service
After=rc-local.service
# If additional gettys are spawned during boot then we should make
# sure that this is synchronized before getty.target, even though
# getty.target didn't actually pull it in.
Before=getty.target
[Service]
Environment=TERM=linux
ExecStart=-/sbin/agetty %I 38400 -n -l /usr/bin/autologin
Restart=always
RestartSec=0
UtmpIdentifier=%I
TTYPath=/dev/%I
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes
KillMode=process
# Unset locale for the console getty since the console has problems
# displaying some internationalized messages.
Environment=LANG= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION=
# Some login implementations ignore SIGTERM, so we send SIGHUP
# instead, to ensure that login terminates cleanly.
KillSignal=SIGHUP
[Install]
Alias=getty.target.wants/getty2-auto@tty1.service
Removed all except tty1, and edited the ExecStart line (ExecStart=-/sbin/agetty %I 38400 -n -l /usr/bin/autologin).
And then just
# systemctl disable getty@.service
# systemctl enable getty2@.service
# systemctl enable getty2-auto@.service
Offline
and does that give you a working console-kit session?
Offline
Yes it does.
Offline
I'll try it then, as soon as I get systemd to work again.
But anyway, your method isn't anything fancy, why won't the classic inittab method work? Is you autologin script the same as the wiki's?
using the wiki's autologin program a ck session is launched correctly if I logout. So I don't get it.. is it too "fast" for ck if getty autologins with that program? because after I issue $ exit I get autologged in and ck works.
(Should I open a new thread?)
Last edited by el mariachi (2011-07-06 23:06:00)
Offline
No my method isn't anything fancy, why would it be? I agree it would be a lot less work with inittab.
Inittab works, if you're not using systemd.
Yes the program is exactly the same.
Last edited by Glaucous (2011-07-07 11:05:38)
Offline
I must have messed something. CK won't work no matter what (mingetty method, autologin.c method, systemd method, inittab, manual login, ...)
I'll have to fresh install and try again. So in theory using inittab with agetty launching the autologin program would work as well as using mingetty's autologin right?
Offline
Yes, yes it would.
Offline
I decided to give that C approach a try too, it works fine indeed, seems slightly faster than the mingetty solution but not much.
ᶘ ᵒᴥᵒᶅ
Offline
Glad I (was) am not the only one sensing that
I'll backup and reinstall everything, my laptop has already crossed the point of no return in terms of experimentation..
Thanks for the tips Glaucous and litemotiv.
Offline