Mozo fails unless its run as root from a terminal

Mozo fails unless its run with sudo from a terminal. Right clicking the menu icon, running it from the Control Center, using gksudo and gksu all prompt for a password, start the program and apparently allow editing, but none of the changes stick.

Run with “sudo mozo” in a terminal the changes take effect immediately and are permanent, the expected result.

I can’t reproduce on Ubuntu MATE 16.04 LTS.
I see no password prompt and I can edit the menus just fine. Changes are persistent.
What version of Ubuntu MATE are you using?
Cheers

Xenial. This was a do-release-upgrade from 15.10.

@:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
@
:~$

go to ~/.config/menus and see the permissions and the owner of the files in there . if the owner or group is root then this is the problem . You can give us some info from terminal output of mozo when run with standart privileges .

The permissions look OK.

@:~/.config/menus$ ls -al
total 24
drwxr-xr-x 2 don don 4096 Aug 1 20:35 .
drwxr-x— 136 don don 12288 Jul 17 22:30 …
-rw-rw-r-- 1 don don 1397 Aug 1 20:34 mate-applications.menu
-rw-rw-r-- 1 don don 229 Aug 1 20:34 mate-settings.menu
@
:~/.config/menus$

Also, in a Mate terminal sudo isn’t required. Just running mozo as a user works properly. The problem is: Why do right clicking the menu icon and running it from the Control Center ask for a password to run as root? Those seems to be using gksudo or gksu or something similar because I get the same form of password prompt.

Well permisions look fine to me to. So go to ‘~/.local/share/applications’ and ‘/usr/share/applications’ and open mozo.desktop file (The file may not be in the first path , but that is normal). See if the command propertie has gksudo/gksu infront of the command and if it has such thing remove it . The reason I am making you do this becouse when you run mozo from terminal you launch the program directly but when you call it from control-center or righ click on menu applet and then ‘edit menus’ it calls the desktop file . The desktop file may be modified for some mistirious reason . (Sorry for bad english but I don’t use spell checking)

Nothing in ‘~/.local/share/applications’, and ‘/usr/share/applications’ looks correct:

.
.
Comment[zh_HK]=選擇那一個應用程式顯示在主選單上
Comment[zh_TW]=選擇那一個應用程式顯示在主選單上
Exec=mozo
Terminal=false
Type=Application
StartupNotify=true
Categories=Settings;DesktopSettings;
Keywords=application;main;menu;editor;customize;MATE;
OnlyShowIn=MATE;
Icon=mozo
X-MATE-Bugzilla-Bugzilla=MATE
.
.
.

Another clue. When I log in as a different user everything works. UID 1000 doesn’t work, but UID 1001 does.

On second look there was a mozo.desktop file with a “exec gksu mozo” in ‘~/.local/share/applications’. I just deleted it to fall back to the correct ‘/usr/share/applications’ versions.

I must have created the incorrect file and forgotten I’d done it, right?

Thanks very much IvCho. I have checked your last response as the solution.

1 Like