1

I have created a custom distro using Cubic which comes from Ubuntu 20.04.2 LTS Desktop 64-bit.

I have noticed that if I open the file manager as root and then double click on the file then it works.

I have also noticed that in the ubiquity.desktop file, if I change the default line:

Exec=sudo --preserve-env=DBUS_SESSION_BUS_ADDRESS,XDG_RUNTIME_DIR sh -c 'ubiquity gtk_ui'

In:

Exec=sudo --preserve-env=DBUS_SESSION_BUS_ADDRESS,XDG_RUNTIME_DIR ubiquity gtk_ui

The problem is solved.

There seems to be a problem with the sh -c '' command when is executed in a file manager with normal privileges through a .desktop file, even if the sudo command is used inside it.
Instead it runs correctly from the terminal both as a normal user and as root.

Why?

Mario Palumbo
  • 277
  • 2
  • 8
  • 36
  • You may have changed your system shell. Make sure which sh points to /usr/bin/sh. Do you have this problem when creating a *.desktop file in an original Ubuntu live environment? – Enterprise Jul 05 '21 at 01:30
  • yes, is /usr/bin/sh – Mario Palumbo Jul 05 '21 at 07:19
  • I tested, and I do not see an issue with sh -c ''. Nevertheless, per AskUbubtu guidelines, you should post your solution as an Answer, below. Aldo, edit your question and remove the solution from the Question section. After a ~couple~ of days, you can select your own answer as Accepted. This will help other users who are experiencing a similar problem quickly find an answer to their issue. Welcome to AskUbuntu, by the way! – Enterprise Jul 09 '21 at 19:08
  • I misinterpreted your statement "The problem is solved". Basically you have a work-around by removing sh -c ''. I performed a test in an unmodified Ubuntu Live ISO, and sh -c '' does work. Try the same test yourself... It is possible that something you've customized has affected this. Think carefully about the changes you have made. Also, you might want to make a only few changes, generate an ISO, and test. Then repeat this process, making more changes each time, until you find what modification is causing sh -c '' to not work in a *.desktop file. – Enterprise Jul 14 '21 at 21:30
  • Yes, I too have tried on the original iso and it always works. – Mario Palumbo Jul 15 '21 at 10:12

0 Answers0