Script not executed if started from the main menu

Questions about applications and software
Forum rules
Before you post please read this

Script not executed if started from the main menu

Postby Pommfriz on Mon Feb 25, 2013 4:42 pm

I wrote a script to allow a user to start a server and mount the cifs-share after a boot delay.
I altered the sudoers file to give the user acces to the mount command without entering the sudo-password.
All works fine if I execute the script within the terminal or the file explorer.
So I created a link to this script in the main menu.
But executing this link doesn't work. What could be the reason ?

My konfiguration:
mint 14 Nadia with Mate desktop.

The content of my script:
#!/bin/bash
# Server on
wakeonlan 00:23:05:EF:33:00
# Bootdelay
sleep 60
# Mount CIFS-share
sudo mount //192.168.1.250/Datensicherung /mnt/_freenas -o user=guest,guest

The additional sudoers entry:
%user ALL= NOPASSWD: /bin/mount


Regards
Pommfriz
Pommfriz
Level 1
Level 1
 
Posts: 3
Joined: Mon Feb 25, 2013 4:21 pm

Linux Mint is funded by ads and donations.
 

Re: Script not executed if started from the main menu

Postby karlchen on Mon Feb 25, 2013 5:07 pm

Hello, Pommfriz.

Assuming that the script is named "cifsmounter" and that it is located under /usr/bin, modify the menu launcher to launch the script like this:
Code: Select all
/usr/bin/cifsmounter > $HOME/cifsmounter.log 2>&1

Launch the script from the menu and find its screen output, error messages included, in the file $HOME/cifsmounter.log

Post the logfile content in case you need help interpreting it.

Kind regards,
Karl
User avatar
karlchen
Level 11
Level 11
 
Posts: 3515
Joined: Sat Dec 31, 2011 7:21 am

Re: Script not executed if started from the main menu

Postby Pommfriz on Mon Feb 25, 2013 5:55 pm

Thank you for your quick reply.
I tried to redirect the output to the log.
But the command was not executed.
It seems not to be a problem of my script.
I guess, it relates to the rights management, but I have no idea.

Kind regards
Pommfriz
Pommfriz
Level 1
Level 1
 
Posts: 3
Joined: Mon Feb 25, 2013 4:21 pm

Re: Script not executed if started from the main menu

Postby karlchen on Mon Feb 25, 2013 7:51 pm

Hello, Pommfriz.

Have you checked whether a file named cifsmounter.log has been created in your home folder?
I gues you have made sure that the script has got the executable bit set? - You must have, because you wrote that you could launch it successfully inside a terminal window.

You state that you launch the script from the menu.
What is the name of the corresponding desktop file?
Where is it located?
What is the its content?

Kind regards,
Karl
User avatar
karlchen
Level 11
Level 11
 
Posts: 3515
Joined: Sat Dec 31, 2011 7:21 am

Re: Script not executed if started from the main menu

Postby Pommfriz on Tue Feb 26, 2013 4:40 am

It seems to be a bug of mozo.
If I put the same starter located in mozo on the desktop then all works fine.

Regards
Pommfriz
Pommfriz
Level 1
Level 1
 
Posts: 3
Joined: Mon Feb 25, 2013 4:21 pm

Re: Script not executed if started from the main menu

Postby karlchen on Tue Feb 26, 2013 6:51 pm

Hello, Pommfriz.

I see. No "mozo" here, because I use Cinnamon, not Mate. Cinnamon comes with the Cinnamon Menu Editor which looks a lot like good old "alacarte". But I would not bet that the current "alacarte" which can be used on Mate. So knowing there is "alacarte" may not help you solve your problem.

Cheers,
Karl
User avatar
karlchen
Level 11
Level 11
 
Posts: 3515
Joined: Sat Dec 31, 2011 7:21 am


Return to Software & Applications

Who is online

Users browsing this forum: all41 and 8 guests