Getting Access to PID in install4j / Mirth Connect - install4j

I am using Mirth connect which uses install4j to launch the program.
I am using the mcservice program and would like to get the pid of the launched application so that I can monitor it. How do I do this? Right now the service only has the standard start, status, etc commands.
Back in 2011 there seemed to be some indication that pid monitoring would be coming soon: http://www.mirthcorp.com/community/forums/showthread.php?t=5509

If you need get the the number of the process pid, you can do it by the terminal command:
$ pgrep mcservice
Also, you can store the pid number into a file and run the next command:
$ kill -9 `cat /path/to/file.pid`
In this case, you choosing the best solution for your issue. If you need something more complex you can view this link: Simple Process Checker To Find Out If A Service Is Running or Not

Related

Secure Socket Agent Proxies listener Error

I try to run the server for ssa by using ssaserver& command but I face this error on my server machine
from yesterday.
Error creating listening socket at [host name : port number] the network address may be in use.
I really don't know why it is showing this error and how can be the address in use.
My OS is RedHat7.
That is really happen because you maybe closed your terminal or logged out from current user account in RedHat.
To solve this issue you can use this command here:
ps -ef|grep ssaserver
Which will show you if the service ssaserver already in use and from this you can get the service id and child ids.
You can then kill the service id by using kill command:
kill #(serviceid)
Here is a link to show you how to use kill command: Link_1
But you can face this problem again and again so I think it will be fine if you will use nohup command to run the service you need.
Note: nohup is a command used to run a process(job) on a server and have it continue after you have logged out or otherwise lost connection to the server
Such as:
nohup ssaserver&
Here is extra link for nohup examples: Link_2

How to establish real time log output for running container when using docker-compose

I'm working on a Django REST framework API that is built in a docker image and launched/managed with docker-compose. When I launch my app I get the real time log of the Django application in the terminal. I accidentally closed the terminal and I want to re-establish a real time log output in the terminal without restarting my containers.
I tried docker-compose logs which will print a tail of the log but does not re-establish a real time output. I would have to rerun this every time I wanted to see new log information.
I think if you add the --follow flag to your command, you'll get the desired result. So:
docker-compose logs --follow ...

How can I launch postgres server headless (without terminal) on Windows?

Using Postgres 9.5 and the libpqxx c++ bindings, I want to launch a copy of postgres that is not installed on the users machine, but is instead packaged up in my application directory.
Currently, I am using pg_ctl.exe to start and stop the server, however when we do this, pg_ctl.exe seems to launch postgres.exe in a new terminal window.
I want it to launch postgres.exe in a headless state, but can't work out how.
I have tried enabling/disabling the logging collector, setting the logging method to a csv file (instead of stdout/stderr), and a couple of other logging related things, but I don't think the issue is the logging.
I have also tried running postgres.exe manually (without pg_ctl) and can get that to run headless by spawning it as a background process and redirecting the logs, but I would prefer to use the "pg_ctl start" api for the "wait for startup" (-w), and "timeout" (-t) options that it provides.
I believe you won't be able to do that with pg_ctl.
It is perfectly fine to start PostgreSQL directly through the server executable postgres.exe. Alternatively, you can use pg_ctl register to create a service and start the service.
In my use case, I was able to resolve the issue by running pg_ctl.exe using
CreateProcess, and providing the dwCreationFlags CREATE_NEW_PROCESS_GROUP | CREATE_NO_WINDOW.
I was originally using CREATE_NEW_PROCESS_GROUP | DETACHED_PROCESS, but DETACHED_PROCESS still allowed a postgres terminal to appear. This is because DETACHED_PROCESS will spawn the pg_ctl without a console, but any process that inherits stdin/stdout from pg_ctl will try to use it's console, and since there isn't one, one will be spawned. CREATE_NO_WINDOW however will launch the process with a conhost.exe, however the console will have no window. When the executables spawned by pg_ctl try to write to the terminal, they will successfully write to the console created by the conhost.exe which has no window.
I am now able to run pg_ctl from code with no console appearing.

Eclipse hanging, how to kill it properly?

Sometimes my Eclipse hangs and I need to kill it violently. However, I have been unable to do it properly. It seems that kill -9 does not actually shut it down in a proper way since I can still see the hanged window. What command sequence would kill my Eclipse properly so I could restart it?
I am running Ubuntu 12.10 and Eclipse 4.2(Juno).
You can also use jps -l to get all of the process id's of java processes
You need to kill the javaw process on which Eclipse runs (usually it is the one with about 1GB memory usage :) )
Based on the answer of Uku and Michael you can do the following:
On your terminal first run:
jps -l
Check the pid of the process that is running Eclipse and copy the pid.
Then kill the process id by running:
// use the actual process id
kill -p {the_copied_pid}

netbeans 6.91 and gdb - attaching to a process run by another user

I am trying to debug a program run as another user, using Netbeans. I can do this manually at the command line, by running sudo gdm and then attaching to the pid.
However, I would like to make use of the Netbeans GUI for easier/quicker/visual debugging. When I select the pid from the list of running processes, I get the error:
GDB failed to attach to process
When I attempt to attach manually (i.e. by running gdb at the command line - without sudo), I get an 'Operation not permitted', so I know Netneans is failing to attach because of permissioning.
Does anyone know how I can attach to processes being run by another user?.
BTW I am running all this on my dev machine at home (Ubuntu), so security is not an issue.
Have you tried running netbeans as the target user?
You can do "sudo -u username netbeans"
With that, you shouldnt have a problem attaching to the process. If the target user is in another computer, I would suggest ssh with X forwarding (ssh -X user#machine).
Actually, if the target (local) user has no password set, you can try changing your gdb command to "sudo -u username gdb" to start the debugger as that user.