Eclipse hanging, how to kill it properly? - eclipse

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}

Related

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.

Getting Access to PID in install4j / Mirth Connect

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

Stop or restart beanstalkd manually on command line

Beanstalkd is running on my Ubuntu VPS. I don't know how to stop or shut down the beandstalkd server. I want to stop the server manually on the command line.
I've found monitoring tools and a configurations script, but no commands for the commandline.
Beanstalkd is normally run with the standard OS-level tools (so, on Ubuntu, upstart). There are a number of example configuration scripts for LaunchD, systemD and Upstart in the Beanstalkd repo.
For an Ubuntu system, you would copy the Upstart .conf file, making any required tweaks to the command line you need (to enable the binary log, for example) and drop it into the /etc/init/ directory. Then the usual start, restart, stop & status commands would be able to control the Beanstalkd daemon, and it could be auto-started on bootup.
If it's not already under upstart control, then you can simply kill the process, like anything else, by finding the process ID (pgrep -lf beanstalkd).

Killing a mysqld process causes another mysqld process to immediately start

I'm having an issue starting the MySQL server using MAMP, and the problem may be that I can't seem to kill all my mysqld proceses before I open MAMP. Starting MAMP creates a second, conflicting mysqld process. Before opening MAMP, I use killall -9 mysqld, but that only creates another mysqld process with a different processid. Any idea what's causing the mysqld process to be created? I installed mysql after installing MAMP.
I uninstalled mysql, and then everything worked.

Paste (Python) Web Server - Autoreload Problem

When I start the `Paste' web server in daemon mode, it seems to kill off it's ability to reload when the timestamp of a source file is updated.
Here is how I start the daemon...
cd ${project} && ../bin/paster serve --reload --daemon development.ini; cd ..;
...which defeats one of the main points of using Paste (for me).
Has anyone come across this or know what I'm doing wrong?
To be complete, the file that I'm changing is a controller file.
The version is `PasteScript 1.7.3'
I believe that the two options are essentially incompatible, since the reloader stops the server with a SIGTERM and the daemon-ized server is impervious to that -- and since daemon is intended for running in a production environment, and reload for a development/debugging environment, I guess that their incompatibility is not seen as a big loss. I imagine a customized reloader, tailored to properly stop and restart the daemonized server, could certainly be developed, but I don't know of any existing one.
I had a similar problem and circumvented the problem. I currently have paster running on a remote host, but I am still developing, so I needed a means to restart paster, but manually by hand was too time consuming, and daemon didnt work. So I always had to keep a shell window open to the server and running paster without --daemon in there. Once I finished my work for that day, and i closed the shell, paster died, which is bad.
I circumvented that by running paster non daemonized in a "screen".
Simply type "screen" in your shell of choice, you will usually depending on your linux be presented with a virtual terminal, that will keep running even when you log out your remote session. Start paster as usually in your new "window" (the screen) with --reload but without daemon, and then detach the window, so you can return to your normal shell (detach = CTRL-A, then press D). You can re-enter that screen by typing "screen -r". If you would like to kill it, reconnect it (screen -r) and inside the screen type CTRL-A, then press K.
Hope that helps.