B4J Question How to run shell script in background

AndroidMadhu

Active Member
Licensed User
Hi,
I am running the below command using nohup as below:

B4X:
nohup ./connect-standalone.sh /opt/oracle/kafka/config/connect-standalone.properties &

The shell running at the background as long as as the server restart.

But If I want to call the script using b4j and try to run the script forever even if I close the b4j application, then how to do that?

Thanks
 

AndroidMadhu

Active Member
Licensed User
What happens if you run this command with Shell?
It is running as expected If I run the script manually. As long as the servers restarts the scripts keep on running. I want to run the script using b4j.
Expectation is the script will run as a service in linux. Is that possible using b4j.

Thanks
 
Upvote 0

aminoacid

Active Member
Licensed User
Longtime User
I think what @Erel is asking you, is to try running your shell script using the B4J jShell Library as follows:


B4X:
    Private shl As Shell
    shl.Initialize("shl","nohup",Array As String("./connect-standalone.sh", "/opt/oracle/kafka/config/connect-standalone.properties", "&"))
    shl.Run(-1)
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…