ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Hi: I have a website(servlets on Apache/Tomcat/mysql ) that does the following.
Lets user upload a file, gives this file as input to a C program. The C program exectutes and gives some output files. The servlet picks up those output files and lists them to user for downloading/viewing.
Problems I have now:
1. Where to store the C program- I have put it in /tomcat/bin for now. If I have it anywhere else, it gives me a segmentation fault or Access Denied(dont know why) The file owner is root. Now is this safe?
2. After a period of inactivity(generally overnight) my servlet gives this exception "./myCcode: No such file or directroy" . If I restart the server this error disappears.
3. Sometimes the c code gives me a core dump for a particular file. Once again restarting the server makes this disappear.
4. I call the c code either directly from the servlet or in the background as a thread(depending on if the user wants the result sent to him as an email). Now for the same uploaded file, the direct servlet execution works ok while if its a background thread I get a core dump. Again restarting the server makes this behavior disappear.
I use the Runtime.exec() method to execute the c code. If anybody can solve any or all of the above mysteries(to me) I would really appreciate it.
Actually I have another c program with similar functions as the first one on my website, and it has NEVER given me any of the above problems. This was written by another programmer, which makes me wonder if its the c program which is faulty?!!!