Technology Insights

How to Get Information About A Stuck Process with strace

Sometimes a process will get stuck in a loop on a server either because it has run out of memory, buggy code has been pushed live, or any other number of reasons. One of the first steps in this situation before killing (kill -9) the process should be to try to figure out why the process is looping. This can be done with strace. Use the below command to gain more information about the PID (Process ID).

To output the information to your shell.

bash

  1. [root@server ~]#strace -p <pid>

Technology Errors

pg_ctl: Server Does Not Shut Down – Force Postgres to Shutdown

You might see the following when issuing the normal stop command to postgres via pg_ctl.

-bash-3.1$ pg_ctl stop
waiting for server to shut down……………………………………………………… failed
pg_ctl: server does not shut down

Sometimes postgres does not want to shutdown by just issuing a pg_ctl stop as the postgres user. User might feel the need to “kill -9” the postgres processes however this could be dangerous for PostgreSQL. Instead of trying to kill the PID follow the directions below in an attempt to stop postgres in an organized fashion.

Technology Errors

STARTTLS: read error=generic SSL error

When receiving this error you are either having a STARTTLS problem or there is a chance that it is a bug in sendmail and you just need to supply a patch to sendmail. First to resolve the issue follow the below steps.

1. Stop sendmail: /etc/init.d/sendmail stop
2. Make sure the PID’s all stopped: ps -ef | grep sendmail
3. If not kill the stuck process ID’s: kill -9
4. Also check the PID’s from the maillog where you originally saw the error and make sure those are not running.
5. Start sendmail: /etc/init.d/sendmail start