Mule Esb run in background from linux command - linux

i can't figure out how to start a mule esb from command terminal in linux without keep calling the wrapper, which obliges me to mantain active the terminal.
I can actually use this simple command (from bin directory):
./mule
Anyways, if i need to pass a parameter, like this:
./mule -Denv=prod
it keeps starting in foreground mode.
How can I achieve a background start with parameters?
thanks!

Just tried it: ./mule start works in background with params (if needed). You can then stop it running ./mule stop. HTH.

Mule will be handled by the script which is placed at MULE_HOME/bin/mule. This script supports start|stop|restart|status|dump|console.
For production mode Mule should be configured as deamon as well - systemctl or service.

Related

how can I run gatsby serve as a service in centos?

or is there a third framework to deploy it? Now I use gatsby serve to run it in centos, but the server shuts down after I exit console window.
Generally for this sort of thing there are a few ways to do it, among which are:
the simplest one is appending an & after the command and running disown before exiting your terminal session, & makes it so that the process runs in the background and disown separates the process from it's parent so that it doesn't close when you exit. If you use this method I would recommend forwarding the output of the command to a file so that you can later review it after your session has closed, for example gatsby serve & > access.log
a better solution is using programs such as screen or tmux which create a terminal session that can be "closed" and reopened after, please take a look at the linked man page, or run man screen (or man tmux) on your system to see how to use them as this is beyond the scope of this question.
The best solution however is however something integrated in gatsby: the build command. This generates a standalone node.js application that can be deployed on a remote server, you would build your application and setup a server such as nginx for this

Cocoa = How to run script in background without launching terminal in C

In my Cocoa Application, I am running a script by using c functions like setenv() and popen(). It executes the script perfectly. But the issue is, At runtime, popen() opens the Terminal app and after the script is executed, It closes the Terminal app automatically. I want to execute the script without opening the Terminal app.
I found a solution to use NSAppleScript. But This class is available only in Foundation, but not available in Core Foundation. I want the same feature to be written in C. How to achieve this.
Please advice.
Use NSTask to execute the script. This allows you to have it run in background while still being able to specify environment variables, monitor output, etc.

Send UI to bakcground and get back UI of an application in linux

I'm running linux VM, OS is rhel 6.5, I'll get access the machine via Putty(SSH) only and I'll use export display option to run gui app's.
I've java application and have jar's, to run that application I'll use the below command in putty.
java -Dcms.console.available=false -Dcms.user="username" -Dcms.password="password" -jar LAUNCHER.jar
When I launch the application in command prompt, I'll get UI(If I want run this app as background process I'm using '&' at the end of the command, in this case also I'll get UI), after getting UI I'll select some options in UI then UI will load full components.
Requirement:
I want to send UI in background and I should get UI back(foreground the UI) when ever I want,
Is there any way to achieve this?
I've tried nohup & screen but it didn't worked, and googled no hlep found. Please help me in this.
fg and bg do just this:
The POSIX standard specifies two commands for resuming suspended jobs
in the background and foreground, respectively bg and fg. These were
modeled after the Korn shell job control commands
https://en.wikipedia.org/wiki/Job_control_(Unix)#Commands

How to execute a setup from an application to update it?

I'am currently writing an application that has to search on a web site if an update exists for this application. If it is the case the application download a setup file (created with inosetup) and then execute it.
My application is written in C++. And I do not arrive to do this process. I'am trying to call the setup using system(). If the command is system("mysetup") I cannot obtain what I want because the setup cannot replace the exe (currently running). So, I have tried to use system("cmd /C mysetup"), system("cmd/C start /min mysetup"), system ("cmd /C start /min /separate mysetup") without success. In these cases, the fact to stop the application also stop the setup. So I suppose that the setup is considered as a child process.
I have seen in some posts that it might be possible to use execcl(). But this function is in unistd.h. And this library is a little bit to specific for my needs (I need to be able to run on virtualized windows).
So do you have a way to do what I want?
Thanks for your help
OK,
A colleague to me gave me the solution. As we are using QT a QProcess::startDetached does exactly what I want.

What's the difference between an application launcher and type in an application name and run it from teriminal?

I have a QT application. When I use my created application launcher to start it, it doesn't work.
However, if I go to terminal and run the application from there, it works.
I'm wondering what their differences are.
Thanks.
Maybe your application launcher doesn't contain the right command and environment?
How is your launcher trying to start the program? Are any errors being reported?
It could be that the current directory is not set as expected. Or the command line parameters being sent aren't formatted correctly. Hard to say without seeing some code or an error message.

Resources