How to run shell script from daemon in Ubuntu?

Asked by Sushil

Hi,

I Installed java application as daemon using Apache Daemon(Jsvc).
Now I want to install [.deb] package from daemon for that I used following way.

1. From Java application(daemon) I use the following code to run shell script file

String[] s = {"/home/sushil/Desktop/Package Test/ShellScriptFile/RunShell1.sh", "install"};
            Process p = Runtime.getRuntime().exec(s);

2. In RunShell1.sh I write the following text to install package

#!/bin/sh
### BEGIN INIT INFO

installit() {
    echo "installing Java-package1.0 ..."
 eval "dpkg -i Java-Package-1.0.deb"
}

uninstallit() {
    echo "uninstalling ava-package1.0 ..."
    eval "sudo dpkg -r Java-Package-1.0"
}

and other stuff to execute the installation process.

When I run the above shell script file from the Normal Java Application it works fine(installation success).
but similar script I run from the Daemon then it not working (Installation failure).

I don't know what is going wrong when I try same code from daemon.
If any one have any Idea regarding this please reply to post ASAP

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu apache2 Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jacobsallan (jacobsallan) said :
#1

Check your Apache log file. There are probably error messages there. If you have questions about them, paste them into this thread.

Revision history for this message
Launchpad Janitor (janitor) said :
#2

This question was expired because it remained in the 'Needs information' state without activity for the last 15 days.