The officially official Devuan Forum!

You are not logged in.

#26 2016-12-21 02:38:08

chillfan
Member
Registered: 2016-12-01
Posts: 54

Re: LXDE user upgrades to Devuan Jessie

Geoff 42 wrote:
chillfan wrote:

Yeah gvfs combined with dbus and polkit takes care of auto mounting see the thunar-volman package for thunar auto mounting, spacefm is supposed to work for auto mounting, maybe xfe can do it too, not sure about pcmanfm (the default file manager for lxde).

I have just had a quick look at installing gvfs and I see that it will pull in libsystemd0, so I have decided not to do that.

Geoff

Try with spacefm if you really need automounting, there is no dependency on systemd that I know of, I believe it uses udisks2 and dbus directly. Alternatively you can try mounting without dbus.

Last edited by chillfan (2016-12-21 02:45:18)

Offline

#27 2016-12-21 03:30:04

chillfan
Member
Registered: 2016-12-01
Posts: 54

Re: LXDE user upgrades to Devuan Jessie

When I get some time I may make a guide on this and convert the answers in this topic to a wiki page here.

Offline

#28 2016-12-21 10:28:03

Geoff 42
Member
Registered: 2016-12-15
Posts: 165

Re: LXDE user upgrades to Devuan Jessie

Right! I think that I may be getting somewhere and it is to do with Policykit.

Policykit was not installed although lxpolkit was and some privilege escalation things did not work, including the shutdown option off the logout menu. I had worked out that the error pop-up which I was getting on login, was coming from lxpolkit. lxpolkit does not depend on policykit, but reading around the subject I found an article over at ArchLinux :-
https://bbs.archlinux.org/viewtopic.php?id=169203
and as policykit does not seem to pull in anything much, I installed it. I logged out and back in again, and the pop-up did not appear. Encouraged by this I selected gparted from the launch menu and it put up the password box and on completion gparted then ran. This is a major improvement. Just to check I was also able to start synaptic this way. The next thing I tried was the logout menu and I asked it to reboot, and it did! However, when I logged back in, an error pop-up appeared, although with a different message, but still GDBus related. Now I was not able to run gparted, so I logged out and logged back in and this time there was no error pop-up and I was then able to run synaptic from the launch menu.

So, although lxpolkit is not dependent on policykit, it does seem to need it in order to work! There remains a problem with it starting up, which I still need to track down.

Geoff

Offline

#29 2016-12-21 14:58:51

Geoff 42
Member
Registered: 2016-12-15
Posts: 165

Re: LXDE user upgrades to Devuan Jessie

chillfan wrote:

When I get some time I may make a guide on this and convert the answers in this topic to a wiki page here.

I was intending producing a summary of this thread, once I had got things in a satisfactory state. Assuming I succeed, you are most welcome to make any use of it.

Geoff

Offline

#30 2016-12-21 15:49:55

Geoff 42
Member
Registered: 2016-12-15
Posts: 165

Re: LXDE user upgrades to Devuan Jessie

Tracking down the policykit situation, the first login after booting up, produces an error pop-up from lxpolkit, saying :-

GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed:
Cannot determine user of subject

and it leaves no obvious record in /var/log/auth.log. If I run pkexec manually it works, as in "pkexec /usr/sbin/gparted" asks for the password and then runs, but stuff in the launcher menu does not run.

When I log out and then back in again, without a reboot, there is a record in auth.log from lxpolkit :-

Dec 21 15:34:52 fluorine polkitd(authority=local):
 Registered Authentication Agent for unix-session:/org/freedesktop/ConsoleKit/Session3
 (system bus name :1.36 [lxpolkit], object path /org/freedesktop/PolicyKit1/AuthenticationAgent,
 locale en_GB.UTF-8)

and I can run gparted from the launcher menu.

I think that I am close, but no cigar yet...

Geoff

Last edited by Geoff 42 (2016-12-21 15:50:45)

Offline

#31 2016-12-21 16:05:30

Geoff 42
Member
Registered: 2016-12-15
Posts: 165

Re: LXDE user upgrades to Devuan Jessie

golinux wrote:
Geoff 42 wrote:

There is no GUI method to shutdown the system as lxde only allows logout/lock and slim does not have any options to shutdown. I have a quick kludge with xmessage and sudo.
Geoff

'man slim' offers suggestions for alternate actions.  Note that I have not tried any of them. YMMV.

I have had a look at "man slim" and you can indeed shutdown the system there by giving the username "halt". However, it does then prompt you for the root password, which I do know ;-) but my partner does not. I persuaded her that Linux was better than Windows by telling her that Penguin Solitaire was better than MS Solitaire. I think that I should not ask her to shutdown with this method, but with a nice tidy menu option.

Geoff

Offline

#32 2016-12-22 16:25:00

chillfan
Member
Registered: 2016-12-01
Posts: 54

Re: LXDE user upgrades to Devuan Jessie

Geoff 42 wrote:
golinux wrote:
Geoff 42 wrote:

There is no GUI method to shutdown the system as lxde only allows logout/lock and slim does not have any options to shutdown. I have a quick kludge with xmessage and sudo.
Geoff

'man slim' offers suggestions for alternate actions.  Note that I have not tried any of them. YMMV.

I have had a look at "man slim" and you can indeed shutdown the system there by giving the username "halt". However, it does then prompt you for the root password, which I do know ;-) but my partner does not. I persuaded her that Linux was better than Windows by telling her that Penguin Solitaire was better than MS Solitaire. I think that I should not ask her to shutdown with this method, but with a nice tidy menu option.

Geoff

Give lightdm a try, it has all those buttons/menus etc plus better support upstream vs slim.

Offline

#33 2016-12-22 17:01:02

Geoff 42
Member
Registered: 2016-12-15
Posts: 165

Re: LXDE user upgrades to Devuan Jessie

chillfan wrote:

Give lightdm a try, it has all those buttons/menus etc plus better support upstream vs slim.

I was running lightdm before, but there seemed to be a recommendation to use Slim. I also got the impression that lightdm was dependent on systemd, but a quick check shows that it is either libpam-systemd or consolekit and I do have consolekit running.

However, I feel that I am getting nearer to having lxsession-logout working properly so that we can shutdown from there. This is tied in with lxpolkit and policykit and it needing a logout and log back in before it works properly. This also gets other stuff working as well, such as running programs such as gparted from the launch menu. I am still working on this but I am finding it quite hard...

Geoff

Offline

#34 2016-12-23 11:19:48

Geoff 42
Member
Registered: 2016-12-15
Posts: 165

Re: LXDE user upgrades to Devuan Jessie

Policykit and lxpolkit are now working, although I am not entirely sure why!

Clearly lxpolkit requires policykit-1 although it is not given as a dependency. I believe that policykit runs as root and does all the clever authentication and permissions stuff, while lxpolkit runs as the user and acts as the interface to the user. Then there is the question of getting lxpolkit started by lxsession. lxsession-edit is used to set up the files. It finds them in /etc/xdg/autostart/*.desktop and if you change one it copies your own version over into ~/.config/autostart/. If things get too confused, you can delete the files in your own directory ~/.config/autostart/ and start again. You can run lxsession-edit from the launch menu as
Preferences>Default applications for LXSession
In the "Core applications" tab you must make sure that the polkit agent is lxpolkit.
In the "Autostart" tab LXPolkit is DISABLED, as this setting stops the pop-up error message.
I also have enabled the 4 gnome-keyring items :-
SSH Key Agent, Certificate and Key Storage, GPG Password Agent & Secret Storage Service.

If lxpolkit does not show up in lxsession-edit, then you can edit /etc/xdg/autostart/lxpolkit.desktop and change the line
Hidden=true
to be false. It will then show up and you can ensure that it is disabled.

Now, after a fresh reboot, I can run gparted or synaptic from the launch menu (with password checking) and the shutdown options work on the logout menu.

In debugging this I did try installing policykit-1-gnome, which did not pull in anything else much, and having set it up, I found that it produced the same errors as lxpolkit, so I went back to using lxpolkit.

There was some helpful stuff on the Rasberry Pi web site :-
https://raspberrypi.stackexchange.com/q … n-start-up
as well as our friends at Arch Linux :-
https://bbs.archlinux.org/viewtopic.php?id=144783

Geoff

Last edited by Geoff 42 (2016-12-23 15:47:38)

Offline

#35 2016-12-24 15:17:46

Geoff 42
Member
Registered: 2016-12-15
Posts: 165

Re: LXDE user upgrades to Devuan Jessie

I am afraid that I posted too quickly! The running of gparted from the launch menu only works after logging out and logging back in again, while shutting down from the logout menu works all the time! looking at the output from "ps -elf" I can see lxpolkit is running, but it appears not to have registered with polkitd. If I send a HUP to lxpolkt's pid, then it seems to die and fire up a new instance, which does register itself with polkitd and then I can run gparted from the launch menu.

There seem to be 2 questions :-
Is there some timing problem the first time lxpolkit runs, so that polkitd is not ready for it, but is ready after a logout and log back in?
What is the difference in the way gparted is run and the way that shutdown is run?

Geoff

Offline

#36 2016-12-24 15:50:30

Geoff 42
Member
Registered: 2016-12-15
Posts: 165

Re: LXDE user upgrades to Devuan Jessie

What is it that runs the policy kit deamon, polkitd? It runs as root, but only seems to start when I first log in and is then persistent over subsequent logins.

Geoff

Offline

#37 2016-12-28 10:52:12

Geoff 42
Member
Registered: 2016-12-15
Posts: 165

Re: LXDE user upgrades to Devuan Jessie

The command "ps axjf" was helpful in finding out what starts what, as it shows the process tree.

dbus is started by init.
It seems that the dbus daemon starts polkitd (as well as the console-kit-daemon and upowerd) and they all run as root.
Slim (which runs as root) starts lxsession, which then starts lxpolkit. lxsession and lxpolkit run as the user.

It is possible to see the (fairly verbose) output from lxsession in the log file :-
.cache/lxsession/LXDE/run.log

Geoff

Last edited by Geoff 42 (2016-12-28 11:01:41)

Offline

#38 2016-12-29 16:12:15

Geoff 42
Member
Registered: 2016-12-15
Posts: 165

Re: LXDE user upgrades to Devuan Jessie

Summary

This is a summary of what I did  to upgrade from Debian Jessie to Devuan Jessie. The result of this is a machine running LXDE, with most things working normally. Shutdown from the logout menu is working.

I will update this message as necessary.

The desktop machine had been running Debian Jessie for a long time with many applications installed as well as some desktops, including XFCE and LXDE.

The following is the equivalent of what I actually did, reconstructed from the log files
and more or less follows the instructions for XFCE given by Chillfan
https://dev1galaxy.org/viewtopic.php?pid=67#p67

As root comment out all of the entries in sources.list and add the Devuan repository entries.
As I had previously added contrib and non-free, I kept these here.

nano /etc/apt/sources.list

deb http://auto.mirror.devuan.org/merged jessie main contrib non-free 
deb http://auto.mirror.devuan.org/merged jessie-updates main contrib non-free 
deb http://auto.mirror.devuan.org/merged jessie-security main contrib non-free 

Log into the console as root (maybe you need <ctl><alt><F1> to get to the console).

Now update the cache and get the Devuan keyring. Once this is installed the packages will be authenticated.

apt-get update
apt-get install devuan-keyring -y --allow-unauthenticated
apt-get update -y

Now install the Devuan packages and remove systemd. The purges will remove a large number of packages incluidng LXDE and XFCE as well some Gnome applications and parts of LibreOffice.

apt-get dist-upgrade
apt-get autoremove --purge
apt-get purge systemd-shim libsystemd0
apt-get autoremove

Now put back LXDE and a display manager as well as putting back the missing parts of LibreOffice.

apt-get install lxde slim
apt-get install policykit-1 upower
apt-get install libreoffice libreoffice-gtk
apt-get purge sysvinit gnome-mplayer

If you now reboot, Slim should start and let you log in to your previous LXDE set-up.

(Edit: the next section was edited in later, from postings below)

To make sure that you can shutdown the machine from the logout menu, enable it in polkit/consolekit as described by Paweł Cholewiński in,
https://lists.dyne.org/lurker/message/2 … 34.en.html
thus, as yourself :-

cat << EOF > /tmp/consolekit.pkla
[restart]
Identity=unix-user:`whoami`
Action=org.freedesktop.consolekit.system.restart
ResultAny=yes

[stop]
Identity=unix-user:`whoami`
Action=org.freedesktop.consolekit.system.stop
ResultAny=yes

[hibernate]
Identity=unix-user:`whoami`
Action=org.freedesktop.upower.hibernate
ResultAny=yes

[suspend]
Identity=unix-user:`whoami`
Action=org.freedesktop.upower.suspend
ResultAny=yes
EOF

and as root

cp /tmp/consolekit.pkla /etc/polkit-1/localauthority/50-local.d/

While the above uses polkit, on the grounds that it works, the following tries to avoid polkit/dbus as there can be problems with lxpolkit failing to register itself.

Use the small wrapper program in C which Didier Kryn has posted on [DNG], which looks like pkexec but runs sudo for commands or udevil for mount/umount requests. udevil and ssh-askpass also need to be installed and sudo.conf set-up.

As yourself, copy the C code from
https://lists.dyne.org/lurker/message/2 … ea.en.html
It is probably easier to cut and paste the code into your favourite editor, rather than saving the web page and then editing out the HTML! Save it into a file called pkexec.c in a suitiable working subdirectory and then give the command

make -k pkexec
# then as root :-
cp pkexec /usr/local/bin
apt-get install ssh-askpass udevil

cat << EOF2 >> /etc/sudo.conf
# Specify the GUI helper program to read the password
Path askpass `which ssh-askpass`
EOF2

It is assumed that /usr/local/bin comes before /usr/bin and /bin in your path.
Test that it works with :-
pkexec gparted
Then you can try running gparted from the launch menu.

udevil can be used by some file managers to mount removable devices under /media. SpaceFM seems to work well and will detect udevil and use it for mounting removable devices. Some of the other SpaceFM configurations are not set this up in the preferences from the menus at the top, but by right clicking on a file in the display panel and then, say, selecting view>columns where you can select which attributes to display. I think that the settings for each of the up to 4 file display panels is independent. It is probably a good idea to read the help for SpaceFM.

apt-get install spacefm

This should then have most of the normal stuff working. If on logging in you get a pop-up error message from GDBus about "Cannot determine user of subject" then you should be able to get rid of it by disabling lxpolkit in "Default applications for LXSession" under "Core applications" and "Autostart".

Last edited by Geoff 42 (2017-01-20 16:09:21)

Offline

#39 2017-01-01 14:24:25

Geoff 42
Member
Registered: 2016-12-15
Posts: 165

Re: LXDE user upgrades to Devuan Jessie

I thought that I had seen something written about polkit and pkexec. I have now found it again in the [DNG] Mailing list archives :-

https://lists.dyne.org/lurker/list/dng.en.html

To read about avoiding polkitd and pkexec and also allowing for file mounting using udevil and sudo, see :-

https://lists.dyne.org/lurker/message/2 … 7e.en.html

I believe that the reason that I could reliably shutdown from the logout menu was that I had previously followed the instructions in this post :-

https://lists.dyne.org/lurker/message/2 … 34.en.html

and set up /etc/polkit-1/localauthority/50-local.d/consolekit.pkla as described there.

I think that it works like this with the vertical || being dbus :-

pkexec shutdown
  \requests  permission--->-----||----->----polkitd
                                ||             | ok
                                ||          polkitd
                                ||           ok
pkexec -------------------<-----||-----<-----/
 runs shutdown

Compare this with, say, gparted, which needs a password before it is allowed to run :-

pkexec gparted
  \requests  permission--->-----||----->----polkitd
                                ||             | authenticate
lxpolkit-----------<------------||-----<----polkitd
 requests password              ||
lxpolkit----------->--OK--------||----->----polkitd
                                ||           ok
pkexec -----------------<-------||-----<-----/
 runs gparted

If lxpolkit has failed to register itself with dbus/polkitd, then this is not going to work, while shutdown does not require a password.
As a comparison, I think that sudo works like this :-

sudo gparted
 sudo checks
 ok (asks for password if required)
 runs gparted

I suspect that there is a timing problem with starting lxpolkit, so that after a reboot, it starts before dbus/polkitd is ready to accept its registration. Following a logout & login dbus/polkitd are ready when lxpolkit starts. Somewhat bizarely, I have had lxpolkit registering successfully after a boot from cold. I wonder whether the difference between the cold boot and a reboot could be down to something like the dhcp server being a bit slower to respond, which could have some knock on effect!!

I think that I will investigate the posts above about udevil and sudo, hence avoiding dbus/polkitd.

Geoff

Offline

#40 2017-01-01 14:37:54

golinux
Administrator
Registered: 2016-11-25
Posts: 959

Re: LXDE user upgrades to Devuan Jessie

gksu works just fine. smile

Online

#41 2017-01-01 15:40:22

Geoff 42
Member
Registered: 2016-12-15
Posts: 165

Re: LXDE user upgrades to Devuan Jessie

golinux wrote:

gksu works just fine. smile

Yes, it does ;-) When I suggested using su as a work round, I was including gksu, which is the form I normally use. I thought that I had read that gksu was deprecated and on my testing/Ascii machine it became removed.

Geoff

Offline

#42 2017-01-01 20:25:45

Geoff 42
Member
Registered: 2016-12-15
Posts: 165

Re: LXDE user upgrades to Devuan Jessie

I have just found the correct thread about using udevil, which I mentioned a couple of posts ago. It is at :-
https://lists.dyne.org/lurker/message/2 … 4b.en.html

Geoff

Offline

#43 2017-01-03 15:44:03

Geoff 42
Member
Registered: 2016-12-15
Posts: 165

Re: LXDE user upgrades to Devuan Jessie

I found the post in [DNG] where Didier Kryn has posted a small wrapper program in C, which looks like pkexec but runs sudo for commands or udevil for mount/umount requests.
https://lists.dyne.org/lurker/message/2 … ea.en.html
I copied this and compiled it and as root copied the binary to /usr/local/bin. Then I installed ssh-askpass and udevil. After setting up

Path askpass /usr/bin/ssh-askpass

in /etc/sudo.conf I was then able to run gparted from the launch menu.

I then had a look at which file managers could use udevil to mount removable devices under /media :-

SpaceFM auto-detects udevil and uses it.
xfe you can manually enter a command such as "udevil mount /dev/sdc1".
PCManFM I can't see how to get it to use udevil unless it is to do with "Modules".
Thunar does not appear to allow custom commands to mount media. It requires HAL to do the mounting.

So SpaceFM seems to work well for the mounting and un-mounting, although I didn't really like the layout of the files as it did not seem to offer the dates of the files, which can be really useful if you want to copy a block of files somewhere else. I suppose that I could use SpaceFM to look after the mounts and then use PCManFM to move stuff about!

Geoff

Offline

#44 2017-01-03 16:11:10

Geoff 42
Member
Registered: 2016-12-15
Posts: 165

Re: LXDE user upgrades to Devuan Jessie

I was unnecessarily rude about SpaceFM. Looking at the help I find that you can add all of the information which you might want to see about a file, but you do not set this up in the preferences from the menus at the top, you do it by right clicking on a file in the display panel and then select view>columns where you can select what you want. I think that the settings for each of the up to 4 file display panels is independent. The help probably needs a bit more investigation.

Geoff

Offline

#45 2017-01-04 14:31:09

Geoff 42
Member
Registered: 2016-12-15
Posts: 165

Re: LXDE user upgrades to Devuan Jessie

I have updated the summary in message number 38
https://dev1galaxy.org/viewtopic.php?pid=430#p430
with the extra info in the recent posts.

Geoff

Last edited by Geoff 42 (2017-01-04 14:31:33)

Offline

#46 2017-01-06 09:17:44

Geoff 42
Member
Registered: 2016-12-15
Posts: 165

Re: LXDE user upgrades to Devuan Jessie

I made a mistake in the summary, where I used `whoami` to insert your username into /etc/polkit-1/localauthority/50-local.d/consolekit.pkla. Unfortunately I suggested doing this as root and therefore `whoami` would insert "root" into the file. I have therefore changed it to say that you produce the file as yourself and then copy it into place as root.

Geoff

Offline

#47 2017-02-02 16:18:04

Geoff 42
Member
Registered: 2016-12-15
Posts: 165

Re: LXDE user upgrades to Devuan Jessie

A few more thoughts on SpaceFM with LXDE.

I tend to forget that the wallpaper for LXDE sessions is looked after by PCManFM and, in fact, the pop-up menu when you right click on the background in also supplied by PCManFM. SpaceFM does also work in this way. From the "Preferences" menu select the "Default applications for LXSession" and in the "Autostart" tab you should see an entry for pcmanfm :-

@pcmanfm --desktop --profile LXDE"

you can untick the box for that entry and then add in a new one, thus :-

@spacefm --desktop

This will probably only take effect when you next log-in. The actual entries for Autostart live in the file : ~/.config/lxsession/LXDE/autostart, although you should probably be a bit careful about editing the files directly.

Once you have SpaceFM running then you can change the wallpaper with a right-click on the background and select "Desktop Settings" and the "Desktop" tab. It is interesting to note that SpaceFM and PCManFM treat the screens differently if you are running in Zaphod mode (twin-headed). SpaceFM just treats the space as one large area, with several modes to fit the picture to the space. PCManFM treats each monitor separately on most of its display modes, with only one mode for the combined display.

I am currently still running udev, but SpaceFM does mount file systems when they are plugged in. When I plug in my Cheap Android 'phone, both the internal files and the SD card files are both mounted. It is some time since I tried my camera, a Canon PowerShot A470, but when I plugged it in, the file system was not mounted. I then found my little write-up to remind me how to use gphoto2 to download the pictures and this does still work.

Geoff

Offline

#48 2017-12-28 02:10:18

thierrybo
Member
Registered: 2017-11-11
Posts: 7

Re: LXDE user upgrades to Devuan Jessie

Hi,

although for me it is safe to have libsystemd0 (but not systemd init), I did not understand how you can avoid installing it. It is a dependency of xserver-xorg-core, and unless you are running a server, any desktop environment or window manager will have  xserver-xorg-core package.

Offline

#49 2017-12-28 02:45:02

fsmithred
Administrator
Registered: 2016-11-25
Posts: 688

Re: LXDE user upgrades to Devuan Jessie

thierrybo wrote:

Hi,

although for me it is safe to have libsystemd0 (but not systemd init), I did not understand how you can avoid installing it. It is a dependency of xserver-xorg-core, and unless you are running a server, any desktop environment or window manager will have  xserver-xorg-core package.

Easy. Install jessie. That dependency doesn't come up until ascii.

Offline

Board footer