Might be the wrong areAdding a link to the desktopForum: HD Install Topic: Might be the wrong areAdding a link to the desktop started by: lantian2004 Posted by lantian2004 on May 30 2006,20:07
might be the wrong area to ask (probably more of a dev question), but having problems with getting an icon to launch a shellscript in a term window and keep it on screen. As of right now, I have an app that calls upon java (well, make that 3 of them). So, what I do now is open aterm, sudo su, change to my directory the ./program.shI want to make an icon that will launch it for me, and the syntax I have so far for my lnk is sudo aterm -T "my program" -e /path/program.sh now, if I just open aterm and type in "sudo /path/program.sh" I get the following error message, which I assume is also being produced by the lnk on the desktop, hence the reason it closes. error: exception in thread "main" java.lang.NoClassDefFoundError: /confidential directory/examples/Banzai So, it works if I change to the directory the run ./ it works fine. Any ideas? Posted by mikshaw on May 30 2006,20:24
add this to the beginning of the script:
Posted by lantian2004 on May 30 2006,20:35
Sweet! Well, kind of, I can launch it from aterm with just sudo /path/program.shNow, how do I get a link on my desktop to run it? Posted by mikshaw on May 31 2006,03:46
same as any other program...just use the command "aterm -e sudo /path/program.sh" in a new *.lnk file where it says "Command:"
Posted by lantian2004 on May 31 2006,04:00
No luck with that, I still just get a window pop open then close. I spent the entire day trying every aterm possibility and nothing. This particular script also launches a small app that lets clients input data, and that doesn't open, so I know it isn't terminating due to lack of user input, and it works fine by just opening aterm and putting in the path without sudo, so very odd. Everything I have seen says it should work... actually i think I have about 50 ways that it should work now, in the lnk, the type is set to Program, would I need to change that? anyways, my other 2 scripts which just open a terminal window and display heartbeats and client/server transactions don't work either using a .lnk or through the menu system of JWM.
Posted by mikshaw on May 31 2006,04:08
If it works when you run it from a terminal, it should also work by running it as an argument to aterm.Is this a script that continues to run indefinitely, or does it run quickly and finish? Posted by lantian2004 on May 31 2006,04:10
it runs indefinetely, until you hit enter to quit, but that is just one script, the others just keep running and scrolling messages.
Posted by mikshaw on May 31 2006,04:20
I'm not sure what could be the problem, then...although it might be an issue with syntax. If i remember correctly I have had problems in the past with running sudo apps in an x term. I think I needed some quotes or something....maybe this... aterm -e "sudo /path/to/program.sh" or this... sudo aterm -e /path/to/program.sh This is all guesswork at this point. If you run "aterm -e program.sh" from an existing aterm, does it work then? I tend to test commands from a terminal before adding them to scripts, icons, whatever, just so i don't have to edit and re-edit. Posted by lantian2004 on May 31 2006,04:23
basically, one script opens a server that allows transactions between financial institutions, another script opens a server that mimics a financial institution and the third script opens a terminal that shows feedback from the server along with a client app that allows you to enter your financial transactions and get info back from the mimic server. So they definitely stay open when you launch them. It just doesnt make any sense that I can run it from inside aterm but not by using an aterm variable, what i see is a window with a green block in the corner for a nonosecond then it closes. Also, if I open emelFM and type in the command for the link I get a simple end-of-output message, Unless it has something to do with environments? However i doubt that. Posted by lantian2004 on May 31 2006,04:29
If I enter aterm -e /path/script.sh while in aterm it brings up a new window and works fine. If I use quotes then i get nothing, not even a pop-up window... so it should work just fine....
Posted by lantian2004 on May 31 2006,04:35
so, assuming that it works in aterm, maybe i need to write another script that opens aterm then runs the command? I had read something about the enviromental variables with a .lnk and the script they used had aterm then under it exec /path/program.However, I have no idea how that script should look. Posted by lantian2004 on May 31 2006,07:32
Doing more research and came across this: < http://www.linuxquestions.org/questions/showthread.php?t=171978 > After I did some testing within aterm with launching the app, I noticed that my script takes a bit to get running, much more time than the aterm window opens and closes. It looks like, and if i can remember right, by using Konsole you can specify a noclose variable. So my current theory is that since I am getting only an end-of-output statement in elmfm, and no error codes, that the aterm window auto closes faster than my script starts up? It makes sense based on that link also, they did also have to set a working directory, but I got the code to do that in the script earlier. unfortunately, I can't set aterm to noclose. Another option I had read about was adding aterm into my script and having my desktop link point directly to the script with no aterm, well, that just opened 500 aterm windows haha. I probably have the code wrong, maybe. Any thoughts? Posted by lantian2004 on May 31 2006,11:06
I created a simple simple script that literally just pings google, it works fine running the aterm command from aterm, but no dice as a desktop icon, and tried every variable of aterm possible, including the quotes. All I get is a window that pops up and closes.
Posted by mikshaw on May 31 2006,13:44
well...that looks like it's turning back around to your original suspicion, which was that there's a problem with the icon. With this I can't say much right now except look closely at your *.lnk file to see if there might be even the slightest difference from the ones that do work (maybe post the contents of the *.lnk here). I can't do any testing at the moment, since my window manager doesn't play well with icons, but i'll do some tests in a little bit and see if i can recreate your issue.
Posted by lantian2004 on May 31 2006,13:54
well, I did a chmod u+x on my little script that pings google, and it works through the icon, but that had no affect on the other scripts
Posted by mikshaw on May 31 2006,13:59
maybe it needs "chmod a+x"? Are you running the scripts manually as user dsl, or other?
Posted by lantian2004 on May 31 2006,14:23
Turns out the java_home wasn't defined somewhere correctly, and have to do the chmod u+x, so appears as though everything works.
Posted by mikshaw on May 31 2006,14:52
1) cd /opt/quickfixjLN/bin/ $0This doesn't look right....if you're just trying to cd to the directory containing the script it should be either cd /opt/quickfixjLN/bin/ or cd `dirname $0`. I'm not sure what adding $0 will do to a cd command that already contains a path, but it might be nothing damaging. In any case, it's best not to tempt a command by sending it incompatible parameters. 2) The CLASSPATH is utilizing relative paths, so you need to be in the directory containing "output" and "lib" when the *.Banzai command is run. This might already be the case, though i don't know what the directory structure of the program is. Typically path variables should use absolute paths, or paths that are made absolute with the addition of variables or command substitution, to avoid troubles like this. 3) Do you have the variable $JAVA_HOME available to the script (is it being exported prior to running the script)? If not, you should add a line to export $JAVA_HOME 4) What does your *.lnk file look like? Posted by lantian2004 on May 31 2006,15:01
I want to thank you immensely, actually, our entire team wants to thank you for your input and help, you found the exact same problem with the java issue as we did, but we were just changing random things.We were on the verge of dropping DSL, I think we have been using linux for a week? hehe so not that linux savy. Once again, Thank you. Posted by lantian2004 on May 31 2006,15:22
Just one more thing, any idea on how to password protect root/su access?
Posted by mikshaw on May 31 2006,15:26
just posted here a minute ago...< http://damnsmalllinux.org/cgi-bin....t=13664 > You'll also need to use the passwd command as root to set up a password. Posted by lantian2004 on May 31 2006,15:33
Thanks a dozen. No idea where your from but if you ever stop by Chicago we gotta take you out for a good steak.
Posted by mikshaw on May 31 2006,23:01
I lived in chicago for a few years (wicker park), but now in maine =o)
|