![]() |
Gnuite applet with run command
I have been trying to run commands from the Gnuite's load/run applet(see link below) . However they don't appear to be executing. I know the executable script files work because when I run them form Xterm command line they work.
I have been using the following to execute the command from the applet's run command: ./go2drv or sh ./go2drv Neither one of these commands work within the applet but do work at the Xterm command line I have a few questions. ********************* Can someone suggest a method to make them execute "go2drv" from this applet. Is there a way to have the applet open Xterm and then execute the "go2drv" file? Thanks for the help! http://gnuite.com:8080/nokia770/ |
Put the file in /usr/bin
|
I must be dense.
I put the files into /usr/bin and still get no results when using the load/run app. When I open xTerm and issue the same commands that I used in the load/run app it works. Does the Load/Run app "run" command line actually issue a command to xTerm, if not where does it send it to? By the way I have tried to uninstall and re-install the Load/Run app and that didn't work either. |
Put the file in /usr/bin and don't use ./ or sh
Just use the filename |
I tried all of that ( nothing in front of the script name, then tried ./ and then sh ) and it still doesn't run.
Does the Load/Run app "run" command line actually issue a command to xTerm, if not where does it send it to? Thanks for the suggestions |
It sends it to the shell - sh
can you run the command by just typing it's name? |
Quote:
But when using the same command via run/load applet nothing happens, however after running the command the run/load command states "command completed with exit code 1". |
Show me the contents of your script.
|
Here's the script:
**************** #!/bin/sh user=user if grep $user /etc/passwd then password=rootme sudo su - cd /home/user/MyDocs/.documents ./foto1.sh fi The script for foto1.sh is: ************************** grep -q cifs /home/user/MyDocs/.documents || insmod ./cifs.ko mount -t cifs //192.168.001.112/Photos /home/user/MyDocs/.documents/foto -o domain=MSHOME,user=guest,password=guest Both scripts function from the xTerm prompt, but do nothing running from the Run/Load applet. Thanks for checking this out. |
OK, Here's what I'd do:
as root, move the cifs.ko file to /lib/modules add the following line to /etc/init.d/minircS near the top after the PATH= line: insmod /lib/modules/cifs.ko add the folowing line to the bottom of /etc/fstab //192.168.001.112/Photos /home/user/MyDocs/.documents/foto cifs rw,domain=MSHOME,user=guest,password=guest 0 0 (all on one line) Now your single script should be: #!/bin/sh # mount cifs shared folder # use gainroot to become root and relaunch itself if [ `id -u` != 0 ] ; then #if not already root, call itself as root sudo gainroot <<EOF $0 $* EOF exit fi mount /home/user/MyDocs/.documents/foto Put this script in /usr/bin, reboot and you're good to go. Call it whatever you like, no need for ./ or a .sh extension. just make it executable. |
BanditRider Thanks for the tips, I truley appreciate the time you have spent on this! I'll give this a try when I get off work and report back as to it's results.
|
Also, if you haven't already, try using an absolute pathname. I don't think sh uses /etc/profile (and the load-plugin is basically using sh), so it might not be setting a PATH. I know I've had trouble trying to get it to recognize my ~/bin/ directory.
And make sure you (not just root) have execute permissions on the file. Also, the "sudo su -" part might be screwing you up - that will start a new (interactive) shell, which will not get any input since the load-applet is running it. I personally would add your command to the /etc/sudoers file and use sudo to run the command, instead of using "sudo su -". |
BanditRider, I tried your suggestions and it didn't work. Tried some other things and still no good.
Gnuite, I'm a noob so when you say "try using an absolute pathname" I'm not sure what this means As for permissions I set chmod 755 on the command and then chmod +x , won't this work? I also added the command to /etc/sudoers and this didn't work. Any other suggestions? Thanks |
What error are you getting now?
|
BanditRider: Without having the 770 in front of me, I recall when using your last suggestions verbatim that the script didn't work via Load/Run. I then tried it within xTerm and it ran to a point where it prompted me for a password. I typed in rootme and this didn't work , so I tried with some other passwords and nothing seemed to work.
Thanks again for checking this out. |
Absolute path means type in the full path. So if your script is in your home folder, type /home/user/script.sh or whatever it's called.
I've noticed that anything that gets run from the menu system, Desktop links etc, need to have the full path. Gav |
I don't get prompted for a password because I've disabled root login as part of installing Openssh.
passwd -l root that's -ell This prevents someone logging in as root over ssh (a good thing). But still allows you to use sudo gainroot or sudo su - |
BanditRider: Thanks again for the help. I'm still at it, and haven't found a solution...yet, but I'll keep trying.
As for the password -l root When issue that command I would expect that I wouldn't be able to connect to the 770 via putty/ssh. But the thing that keeps bothering me is I still can SSH into the 770 using user and rootme. Am I doing something wrong here when setting the password? |
I ssh into the 770 as user.
I have setup the keys in /home/user/.ssh (authorized_keys2 and known_hosts) This allows me to login as user with no password needed. Then to do root stuff I just sudo su - and I'm root with no password needed. For security reasons, you don't want to ssh in as root. Set your user password to something secure. (not rootme or password or god ...) |
All times are GMT. The time now is 01:10. |
vBulletin® Version 3.8.8