Why Not pkexec?
Why Not pkexec?
hi, why does root thunar launcher use
/opt/porteus-scripts/xorg/psu "dbus-launch --exit-with-session thunar %F"
instead of
pkexec thunar
?
THX
/opt/porteus-scripts/xorg/psu "dbus-launch --exit-with-session thunar %F"
instead of
pkexec thunar
?
THX
- ncmprhnsbl
- DEV Team
- Posts: 4256
- Joined: 20 Mar 2012, 03:42
- Distribution: v5.0-64bit
- Location: australia
- Contact:
Why Not pkexec?
that command, which actually needs to be gksu -l dbus-launch --exit-with-session thunar %F (pending bugfix) (note: in xfce(and others) /opt/porteus-scripts/xorg/psu is a symlink to /usr/bin/gksu )
is mainly to remove unwanted (system)mount entries in thunars' sidebar (some gvfs issue i think)
my own experiments with pkexec seemed to suggest that it doesn't take extra arguments (ie dbus-launch --exit-with-session)
is mainly to remove unwanted (system)mount entries in thunars' sidebar (some gvfs issue i think)
my own experiments with pkexec seemed to suggest that it doesn't take extra arguments (ie dbus-launch --exit-with-session)
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44
Why Not pkexec?
i just changed the built-in Thunar (root) launcher to your command
gksu -l dbus-launch --exit-with-session thunar %F
and now it fails.
it works with default command.
THX
gksu -l dbus-launch --exit-with-session thunar %F
and now it fails.
it works with default command.
THX
- ncmprhnsbl
- DEV Team
- Posts: 4256
- Joined: 20 Mar 2012, 03:42
- Distribution: v5.0-64bit
- Location: australia
- Contact:
Why Not pkexec?
yeah, sorry, that should have quotes: gksu -l "dbus-launch --exit-with-session thunar %F"
the -l option(login shell) fixes some issue affecting child processes if remember correctly...
the -l option(login shell) fixes some issue affecting child processes if remember correctly...
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44
Why Not pkexec?
why not pkexec?
ToZ says it's ok, if org.xfce.thunar.policy contains
https://forum.xfce.org/viewtopic.php?pid=49488#p49488
Porteus does. So, pkexec should be ok, no?
THX
ToZ says it's ok, if org.xfce.thunar.policy contains
Code: Select all
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
Porteus does. So, pkexec should be ok, no?
THX
Linux porteus 4.16.3-porteus #1 SMP PREEMPT - x86_64 Intel(R) Pentium(R) Dual CPU T2310 @ 1.46GHz GenuineIntel GNU/Linux
- Ed_P
- Contributor
- Posts: 8912
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Why Not pkexec?
Why have two commands to do the same thing? Which one is smaller?
Why Not pkexec?
exactly. This:
Code: Select all
pkexec thunar
Code: Select all
gksu -l dbus-launch --exit-with-session thunar %F
Linux porteus 4.16.3-porteus #1 SMP PREEMPT - x86_64 Intel(R) Pentium(R) Dual CPU T2310 @ 1.46GHz GenuineIntel GNU/Linux
- brokenman
- Site Admin
- Posts: 6105
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
Why Not pkexec?
I believe ncmprhnsbl already answered this question in his first post.
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.
Why Not pkexec?
Whether i can understand is a separate issue

i think exit-with-session is the sole reason ncmprhnsbl uses dbus-launch. Correct?
-l is the sole reason ncmprhnsbl uses gksu, correct?
gksu man says
i'm not sure if they mean run xhost instead, or in addition. Could this cause problems with porteus Xauthority?--login, -l
Make this a login shell. Beware this may cause problems with the Xauthority magic. Run xhost to allow the target user to open windows on your display!
https://linux.die.net/man/1/gksu
Why do we need a login shell? This post says
I'm taking a wild guess, that this has something to do with the environment variables which we want set to the local user, not root, to avoid the issue of root taking ownership of Thunar config files. Correct?login shells typically read a file that does things like setting environment variables
if we're avoiding pkexec to avoid making a policy file, we can do pkexec without a policy file by putting the environment variables on the command line. https://askubuntu.com/a/332847
so, maybe i should really compare these two. Correct?
Code: Select all
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY thunar
gksu -l dbus-launch --exit-with-session thunar %F
So what's their modern alternative to exit-with-session?exit-with-session
If this option is provided, a persistent "babysitter" process will be created, as if for --exit-with-x11. If it cannot connect to the X server, it will monitor the terminal from which dbus-launch was started instead, and if it gets a HUP on stdin, the message bus daemon will be killed. This option is not recommended, since it will consume input from the terminal where it was started; it is mainly provided for backwards compatibility.
https://dbus.freedesktop.org/doc/dbus-launch.1.html
btw, is gksu on porteus an alias? On Mint forum, i got pkexec for a gksudo alias:
Code: Select all
echo '/usr/bin/pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY $@'|sudo tee /usr/local/bin/gksudo
chmod +x /usr/local/bin/gksudo
Linux porteus 4.16.3-porteus #1 SMP PREEMPT - x86_64 Intel(R) Pentium(R) Dual CPU T2310 @ 1.46GHz GenuineIntel GNU/Linux
- ncmprhnsbl
- DEV Team
- Posts: 4256
- Joined: 20 Mar 2012, 03:42
- Distribution: v5.0-64bit
- Location: australia
- Contact:
Why Not pkexec?
no, dbus-launch is for dbus-launch "is mainly to remove unwanted (system)mount entries in root thunars' sidebar (some gvfs issue i think)"
if i reading correctly, probably the "--exit-with-x11" because it doesn't "consume input from the terminal where it was started", whatever that means... thanks for pointing that out , i'll look into it..
no. gksu is /usr/bin/gksu.
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44
Why Not pkexec?
thx, can't say i fully understand, but slowly, slowly... 

Linux porteus 4.16.3-porteus #1 SMP PREEMPT - x86_64 Intel(R) Pentium(R) Dual CPU T2310 @ 1.46GHz GenuineIntel GNU/Linux