Latest update = can't run scripts anymore from desktop

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
igor83

Latest update = can't run scripts anymore from desktop

Post by igor83 »

After the latest update (backport) for Linux Mint Mate (13, I think), I can't launch scripts from the desktop. chmod +x regen.sh has been performed, but nothing happens when I click on the launcher. And trying to launch "sudo ~/regen.sh" doesn't work either, nor does "bash ~/regen.sh" or "terminal ~/regen.sh".

No error messages, nothing, but clicking on the launcher, nothing at all happens...

The exact same script works without any difficulty whatsoever in Linux Mint Nadia KDE.

If I create a Launcher that tries to run Application within terminal, I get an error message about Xterm and a child process which I do not understand.

Mate overall has given me more difficulty than KDE and Xfce. With Xfce or KDE, if something arises it's usually something I can google and figure out. With Mate, I don't see anything about this via google searches. It is just one of those Mate things. And I have seen some hits on Xterm and the child process, but the proposed fix didn't work for changing xterm to gnome-terminal.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
bjornmu
Level 3
Level 3
Posts: 189
Joined: Wed Dec 19, 2012 2:50 am
Location: Trondheim, Norway

Re: Latest update = can't run scripts anymore from desktop

Post by bjornmu »

Maybe something in the script that doesn't work after downgrading, or is *any* script affected? It might help if you post at least the top of the script here.
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: Latest update = can't run scripts anymore from desktop

Post by xenopeek »

And to be clear, when you write "I can't launch scripts from the desktop," do you mean you can't launch any scripts, or only scripts located on your desktop?
Image
igor83

Re: Latest update = can't run scripts anymore from desktop

Post by igor83 »

xenopeek wrote:And to be clear, when you write "I can't launch scripts from the desktop," do you mean you can't launch any scripts, or only scripts located on your desktop?
My post was a bit unclear, I must admit; thanks for replying anyway. I wrote it late at night after pulling my hair out. :)

What puzzles me is that I've set up a launcher on my desktop's KDE environ, and it works fine. Trying to get a launcher working on my laptop's MATE environ has proved challenging. However, if I open a terminal in Mate, I can run regen.sh without difficulty. That's what is confusing, that the script seems ok. It runs in KDE from the GUI, and it runs in Mate only from a terminal, but not from the GUI's launcher. Clicking on the launcher does nothing.

In Mate, I have set up a launcher icon to run an Application, /home/igor/games/regenforlinux/regen.sh. Permissions on this launcher do permit executing the file as a program. The script, regen.sh, has been chmod +x'ed so that it can execute. Its security is as follows (output of ls -l command):

Code: Select all

-rwxrwxrwx 1 igor igor 7176 Jan 19 00:37 regen.sh
I don't wish to post the content of regen.sh here as doing so would create a duplicate search engine result. Its content is already online here, in both a .zip file and posted in plain text in a little box.

My guess is there is a security consideration I've overlooked, but I can't think what it may be. Security in Linux is still something of a gray area for me. I've tried adding sudo as a prefix in the launcher, as well as mate-terminal; the former asks for the root password and does nothing, and the latter does not seem to work.
User avatar
bjornmu
Level 3
Level 3
Posts: 189
Joined: Wed Dec 19, 2012 2:50 am
Location: Trondheim, Norway

Re: Latest update = can't run scripts anymore from desktop

Post by bjornmu »

OK here's a trick I often use when I want to check if something is actually run: replace it with something that breaks or does something traceable.

For example, you can try replacing regen.sh with something like this:

Code: Select all

#!/bin/sh
echo "Kilroy was here" > /tmp/fromregen
Then try running the script from the GUI. If it writes to /tmp/fromregen, then you know that the script could be started. It won't tell you what the problem is, but help narrow down where the is.
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: Latest update = can't run scripts anymore from desktop

Post by xenopeek »

I downloaded the file you linked to, extracted the Linux folder as-is and didn't change any file permissions. Then I added a new Application launcher to the panel on Linux Mint 13 MATE, and for the command browsed to the location of the regen.sh and picked that. At the top of the regen.sh I something similar as bjornmu has shown, writing a file to my desktop instead. Then I launched it, and it successfully created the file so the script is indeed run.

I'm not sure what could be wrong here :(
Image
igor83

Re: Latest update = can't run scripts anymore from desktop

Post by igor83 »

xenopeek wrote:I downloaded the file you linked to, extracted the Linux folder as-is and didn't change any file permissions. Then I added a new Application launcher to the panel on Linux Mint 13 MATE, and for the command browsed to the location of the regen.sh and picked that. At the top of the regen.sh I something similar as bjornmu has shown, writing a file to my desktop instead. Then I launched it, and it successfully created the file so the script is indeed run.

I'm not sure what could be wrong here :(
I created simple.sh, composed of:

$ cat simple.sh

Code: Select all

    #!/bin/sh
    echo "Kilroy was here" > /tmp/fromregen
    sleep 8
I right-click on the desktop, create a launcher, added simple.sh as an Application (after chmod +x) and it won't execute. Nothing happens, actually, when I double-click. I checked /tmp, and the file was not created.

Thanks for your help. I think I'm going to just ignore this problem for the time being; something seems broken in my Mate installation after the latest update. When the next version of Linux Mint comes out, I think I'll install the Xfce flavor on this old laptop of mine. I've had fewer problems with Xfce, and I particularly like Linux Mint's spin, especially for hardware as old as a Thinkpad R60. For the time being, I can simply drop to a Terminal to execute scripts. Old-fashioned, but it works.

It may be advisable not to enable backported updates, at least for the time being, if you happen to launch scripts on a regular basis from your desktop.
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: Latest update = can't run scripts anymore from desktop

Post by xenopeek »

Did you give the full path to the script to run as the command?
Image
igor83

Re: Latest update = can't run scripts anymore from desktop

Post by igor83 »

xenopeek wrote:Did you give the full path to the script to run as the command?
Yes, I know that trick, that Linux requires the full path, whether in a terminal or a desktop launcher.
Full paths for both the test case and regen.sh.

Nothing doing.

However regen.sh works well on my KDE desktop so it's not a biggie. Just means I have to drop to a terminal to execute a script in Linux Mint Maya Mate. I'm planning to reinstall when the next version Linux Mint rolls out. I'm actually leaning more towards KDE at this time because KDE makes life so pleasant. If I need to buy an SSD to speed things up, well then, I will do so... but I doubt that will be necessary.
HodariUbunifu

Re: Latest update = can't run scripts anymore from desktop

Post by HodariUbunifu »

Hi,
if it is not obsolete: The problem is,that the launcher still coming from Gnome wants to use an xterm 'xterm', where Mate by default provides only the Mate Terminal 'mate-terminal'
As a work around you can install xterm by the software manager.
Myself i'd like more to change the launcher that way, that it uses mate-terminal instead of xterm but haven't figured out yet. Anybody ideas ?
HodariUbunifu

Re: Latest update = can't run scripts anymore from desktop

Post by HodariUbunifu »

It is solved already.Read here und use the second solution.
http://forums.linuxmint.com/viewtopic.p ... cher+xterm
igor83

Re: Latest update = can't run scripts anymore from desktop

Post by igor83 »

HodariUbunifu wrote:It is solved already.Read here und use the second solution.
http://forums.linuxmint.com/viewtopic.p ... cher+xterm
You may get dinged for resurrecting an old thread, but since it has resumed life, I will observe that I replaced Mate with KDE months ago and like KDE better. I also prefer Xfce where my htpc is concerned, because Xfce gives me just enough functionality for htpc purposes and is indeed fast and extremely fast booting. From the time the BIOS has initialized to when Thunar opens up my video folder is 18 seconds, using a slow, slow 5400 rpm "Green" Western Digital hard drive. I do not see any reason to use OpenElec, since Linux Mint Xfce can serve the same purpose as that distro, although I think OpenElec is intended for low-tech users, not exactly my description.
Locked

Return to “Scripts & Bash”