how do I kill a zeopack without restarting zeo? - plone

It seems that in using the zeopack script, the zeopack script returns to the shell after signalling zeo to do a pack on a database. How can I kill a zeopack operation in zeo without bringing down the database?

The only way to kill the pack is to restart the server:
bin/zeoctl restart
Clients should reconnect automatically.
The server starts the packing in a separate thread to handle the packing but offers no 'stop' hook.

Related

How to kill a running EL pipeline in Meltano

When running an Extract/Load pipeline with Meltano, what's the best way (or ways) to kill a running job?
Generally these would be run via Airflow but would be nice to have a process that worked also with bare meltano elt and/or meltano run invocations from orphaned terminal sessions, which might not be able to be canceled simply by hitting Ctrl+C.

Grakn server stop takes too much time

I'm trying to stop Grakn server but it doesn't stop. When I query status, it says both server and storage are running.
I thought it's related with this issue. However this issue is solved long before.
I did some operations like insert, match, delete with Python client. Is it possible one of them didn't close well?
I can't run any query on Python client or console now, it gives this error:
Unable to create connection to Grakn instance at localhost:48555
Cause: io.grpc.StatusRuntimeException
UNAVAILABLE: io exception
It's possible that the server has actually stopped but the terminal process doesn't know about it.
Grakn Core 1.8 runs as a Java process. You can check if there is a server instance by running:
jps
If there is a Grakn instance, it will be named GraknServer, and you can force quit it if necessary using kill.
After that you can restart Grakn using ./grakn server start as normal.

How to poll an unix server reboot in an automated way?

I am performing an install on a server, which requires the server to reboot to complete the installation. My query is how to find out when the reboot completes so that I can run a basic smoke test on the server and confirm the deployment status.
This is a non-trivial task in general, and the solution will be depending on the operating system of the server that's restarted.
In general, it will be best to let the server decide itself on when the startup process has completed, and have it send some notification to interested entities.
If you can't do that, you can check for services that are typically available after reboot (like, HTTP port reachable, exported file shares mountable,...). Adding some additional time on top of that may be useful.
On the other, more unreliable end of possible solutions, you can simply wait for a certain amount of time that's typically required for completing a reboot.

How to fork properly within an nginx/php-fpm environment?

I have a very simple php socket server that runs on my machine. I created a convinience class with simple methods like "restart" and "stop" and etc. to control the server once it is already running.
What the restart function does is it sends the server the command to stop and then it forks the process and starts a new instance of the socket server within the child process while the parent process returns to the caller.
This works great on the command line, however I am trying to make an admin webpage which restarts the socket server and the forking is causing problems in php-fpm. Basically, what it appears is happening is that the life of the "page loading" is not ending when the parent process ends and nginx/php-fpm are not reassigning the process to new connections until the forked process also ends.
In my case, I do not want the forked process to ever end, and I end up with a completely debilitated server. (in my test environment, for simplicity i have the worker pool set to only 1, in a production environment this will be higher, but this issue would lead to one worker slot being permanently occupied).
I have tried a few things including calling fastcgi_finish_request() just prior to the forking, however this had no affect.
How can I restart my service from a php-fpm worker process without locking up an assignment in the nginx connection pool?
The solution was simple and elementary.
My child processes were not redirecting STDOUT and STDERR to /dev/null so therefore even though the parent process finished, the fact that the child process still had active file descriptors was causing php-fpm to consider that connection in its pool as still active, and therefore it would never be re-assigned to new connections on the basis that the child process would run continually.
Redirecting STDERR and STDOUT to /dev/null caused php-fpm to correctly reassign connections while simultaneously allowing the child process (the socket server) to run forever. Case closed.
./some/command >/dev/null 2>&1
Should have seen this one a mile off...
(I solved this problem months ago, but haven't signed into this account in a long time ... it didn't take me 7 months to figure out I need to direct output to /dev/null!)
Sounds like you have your protocol design wrong. The server should be capabele of restarting itself. There's quite a few examples of how to do that in the internet.
The client (your webpage) should not need to do any forking.
The server should also not run inside php-fpm, but be a console application that uses a daemon(3) type interface to detach itself from the console.

SSH Equivalent on Windows

I am making an Asp.Net application which does the following on the client computer:
Establish a Connection
Check client's cpu usage to see if it is idle or not
if the client is idle it starts executing a c application
while executing the script if client starts doing something (also checked by monitoring his cpu usage) stop signal is sent
start signal is again sent to the client if he is back to his idle position
If the client is Ubuntu, I use ssh and execute what I want to. What is the way of doing this in Windows without the root access.
thanks in advance for replying.
This sounds a bit dodgy to me. However, what you are looking for is called PsExec (http://technet.microsoft.com/en-us/sysinternals/bb897553)
UPDATE
The only other way I can think of doing this is to use the built in task scheduler for windows.
With the task scheduler you can set a task to start when a computer has been idle for a particular amount of time and pause or stop it when it ceases to be idle.
Once the task is installed, just forget about it.
try SSH FTP or SFTP is analogous to SSH in windows

Resources