Using Java to install a package with dpkg in Debian
I have got an interesting problem.
First I have to tell a little bit about the setting. I have a linux embedded device. I am using Debian with this device. I have made the necessary arrangements so that when I put a USB flash disk with a file update.jar in the USB flash, the device automatically run the command java -jar update.jar and do whatever necessary (create a directory, delete a file etc.).
This has been working like a charm till now. But now I have to install a package (openntpd) using this setting. In the update.jar java file I have the command:
/usr/bin/dpkg --install /media/usb0/openntpd.deb
I expect this to install the package without a problem when I put the USB flash stick. But it doesn't do that. However it does runs the other commands in the update.jar file.
So I suspect that the problem is related with dpkg command.
The interesting part is when I manually enter the command java -jar /media/usb0/update.jar into the console it does installs the package.
any ideas why this would be happenning?
|