Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

pkexec tuxcmd: creating policy rule

Graphical Environments, Managers, Multimedia & Desktop questions.
Post Reply
Message
Author
peer
Posts: 443
Joined: 2017-03-26 10:14
Has thanked: 8 times
Been thanked: 20 times

pkexec tuxcmd: creating policy rule

#1 Post by peer »

I want to run the filemanager tuxcmd as root.
When I run the command "pkexec tuxcmd"in the terminal I get the following error:

Code: Select all

(tuxcmd:817): Gtk-WARNING **: 09:34:50.511: cannot open display:
Tuxcmd does run as root when I give the following command:

Code: Select all

pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY tuxcmd
Now I know that it does work I try to create a policy rule. I made the file "com.ubunutu.pkexec.tuxcmd.policy" that contains the following text:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
 "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>

  <action id="com.ubuntu.pkexec.synaptic">
    <message>Authentication is required to run Tux Commander/message>
    <message xml:lang="en_GB">Authentication is required to run Tux Commander</message>
    <icon_name>tuxcmd</icon_name>
    <defaults>
      <allow_any>auth_admin</allow_any>
      <allow_inactive>auth_admin</allow_inactive>
      <allow_active>auth_admin</allow_active>
    </defaults>
    <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/tuxcmd</annotate>
    <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
  </action>

</policyconfig>
Then I rebooted and run "pkexec tuxcmd" again. But It did not work I still get the error:

Code: Select all

(tuxcmd:817): Gtk-WARNING **: 09:34:50.511: cannot open display:
What am I doing wrong????

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: pkexec tuxcmd: creating policy rule

#2 Post by sunrat »

I'm no expert on policykit but I see a mismatch when comparing it to my doublecmd policy file. It seems Tux Commander is a dead project which hasn't been updated for 8 years and depends on deprecated GTK2. I suggest to install Double Commander instead which comes with pkexec already set up.

Code: Select all

apt install doublecmd
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

peer
Posts: 443
Joined: 2017-03-26 10:14
Has thanked: 8 times
Been thanked: 20 times

Re: pkexec tuxcmd: creating policy rule

#3 Post by peer »

I know that double commander works with pkexec. I have used doublecmd a few years back in its early days. Then I had had a bad experience. I copied my home directory with doublecmd to a external drive as a backup. When I needed this backup I discovered that doublecmd had created sub directories but did not copy the files and directories in it. So I missed a lot of of files!
But doublecmd has improved a lot so I guess it will work properly now.

I like tuxcmd because it is a simple program that just works. It would be very nice if tuxcmd could be updated again.
But I will check doublecmd again.

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: pkexec tuxcmd: creating policy rule

#4 Post by sunrat »

I forgot to detail the mismatch. The doublecmd file is called "org.doublecmd.root.policy" and the <action id= section matches the file name. Yours doesn't match and contains "synaptic" for some reason. Could probably lose the "ubuntu" as well.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

peer
Posts: 443
Joined: 2017-03-26 10:14
Has thanked: 8 times
Been thanked: 20 times

Re: pkexec tuxcmd: creating policy rule

#5 Post by peer »

I like tuxcmd more the doublecmd so I made an alias in ~/bashrc:

Code: Select all

alias pexec="pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY"
now:
"pkexec tuxcmd" does not work but
"pexec tuxcmd" does work!!

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: pkexec tuxcmd: creating policy rule

#6 Post by sunrat »

Hmmm, I never had to set environment for any other application running via pkexec. But if it works...
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

peer
Posts: 443
Joined: 2017-03-26 10:14
Has thanked: 8 times
Been thanked: 20 times

Re: pkexec tuxcmd: creating policy rule

#7 Post by peer »

Yad gives the same problem.

peer
Posts: 443
Joined: 2017-03-26 10:14
Has thanked: 8 times
Been thanked: 20 times

Re: pkexec tuxcmd: creating policy rule

#8 Post by peer »

I tried double commander. It is a very nice file commander that does work very good.
But on my older laptops double commander needed some time to start. And tuxcmd starts immediately
so on these older laptops I prefer tuxcmd.

Post Reply