Live Squeeze system: ConsoleKit does not see serial console as active, cannot mount with udisk
I'm building a Debian Squeeze system with live-builder 3.0~a45 (from
Ubuntu 11.10). I'm running into a problem where I can't use udisk to
mount devices using a serial console on the live system (perhaps due
to problems with consolekit or policykit).
I configure a serial console using the boot line:
LB_BOOTAPPEND_LIVE="quiet ipv6.disable=1 console=tty0
console=ttyS0,115200n8 noprompt quiet hostname=mwa-live-usb"
...and some special patching in
"config/includes.chroot/lib/live/config/018-serial_console" that
produces this line in /etc/inittab:
T0:23:respawn:/bin/login -f user </dev/ttyS0 >/dev/ttyS0 2>&1
My problem is this: when I try to use udisk to mount an image via a
serial console, I get:
----
user@mwa-live-usb:~$ udisks --mount /dev/disk/by-label/image-data
--mount-options ro
Mount failed: Not Authorized
----
I read through a heap of forum postings and bug reports, and
eventually figured to try:
----
user@mwa-live-usb:~$ pkexec true
Error executing command as another user: Not authorized
This incident has been reported.
----
Then I ran "ck-list-sessions" to get the attached file. Note that only
Session 5, on /dev/tty1, has "active = TRUE" - the console I'm
actually using (Session 1 on /dev/ttyS0) has "active = FALSE".
Am I right in thinking that this is why udisk is failing to mount the
device when run on a serial console? I checked that my udisks command
worked with a video console, and it does. But unfortunately, this is
not practical - I need to be able to run the command at a serial
console OR a video console.
If I look in "/usr/share/polkit-1/actions/org.freedesktop.udisks.policy",
there's a group of keys under "<action
id="org.freedesktop.udisks.filesystem-mount">":
<allow_any>no</allow_any>
<allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active>
I'll try changing the "allow_inactive" key to yes, but this seems less
than ideal - there may be any number of other operations that are
expecting to run on what consolekit thinks is an active console. Can I
somehow tell consolekit that the serial port is an active console?
(udisks is 1.0.1+git20100614-3, consolekit is 0.4.1-4)
Thanks,
Jason
Session7:
unix-user = '1000'
realname = 'Debian Live user'
seat = 'Seat1'
session-type = ''
active = FALSE
x11-display = ''
x11-display-device = ''
display-device = '/dev/tty3'
remote-host-name = ''
is-local = TRUE
on-since = '2012-04-02T18:00:08.722914Z'
login-session-id = ''
idle-since-hint = '2012-04-02T18:00:39.004757Z'
Session1:
unix-user = '1000'
realname = 'Debian Live user'
seat = 'Seat1'
session-type = ''
active = FALSE
x11-display = ''
x11-display-device = ''
display-device = '/dev/ttyS0'
remote-host-name = ''
is-local = TRUE
on-since = '2012-04-02T18:00:08.793691Z'
login-session-id = ''
Session2:
unix-user = '1000'
realname = 'Debian Live user'
seat = 'Seat1'
session-type = ''
active = FALSE
x11-display = ''
x11-display-device = ''
display-device = '/dev/tty5'
remote-host-name = ''
is-local = TRUE
on-since = '2012-04-02T18:00:08.855576Z'
login-session-id = ''
idle-since-hint = '2012-04-02T18:00:39.005370Z'
Session3:
unix-user = '1000'
realname = 'Debian Live user'
seat = 'Seat1'
session-type = ''
active = FALSE
x11-display = ''
x11-display-device = ''
display-device = '/dev/tty6'
remote-host-name = ''
is-local = TRUE
on-since = '2012-04-02T18:00:08.644178Z'
login-session-id = ''
idle-since-hint = '2012-04-02T18:00:39.003669Z'
Session4:
unix-user = '1000'
realname = 'Debian Live user'
seat = 'Seat1'
session-type = ''
active = FALSE
x11-display = ''
x11-display-device = ''
display-device = '/dev/tty2'
remote-host-name = ''
is-local = TRUE
on-since = '2012-04-02T18:00:08.679658Z'
login-session-id = ''
idle-since-hint = '2012-04-02T18:00:39.004224Z'
Session5:
unix-user = '1000'
realname = 'Debian Live user'
seat = 'Seat1'
session-type = ''
active = TRUE
x11-display = ''
x11-display-device = ''
display-device = '/dev/tty1'
remote-host-name = ''
is-local = TRUE
on-since = '2012-04-02T18:00:08.606513Z'
login-session-id = ''
idle-since-hint = '2012-04-02T18:00:39.002456Z'
Session6:
unix-user = '1000'
realname = 'Debian Live user'
seat = 'Seat1'
session-type = ''
active = FALSE
x11-display = ''
x11-display-device = ''
display-device = '/dev/tty4'
remote-host-name = ''
is-local = TRUE
on-since = '2012-04-02T18:00:08.907727Z'
login-session-id = ''
idle-since-hint = '2012-04-02T18:00:39.013427Z'
Reply to: