Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have a similar problem, but first, I'll give you tips to debug your problem:</p> <ul> <li><p>Look at your process hierarchy to know if there are process that shouldn't be there. <code>ps faux</code></p></li> <li><p>If a process is left hanging on something, and you don't know what, you can <code>strace -p &lt;PID&gt;</code> to look at the system call that is blocking the process</p></li> <li><p>If this is about a file descriptor (blocking on a read or write call), then you can look at the file descriptors for that process using <code>lsof -p &lt;PID&gt;</code></p></li> <li><p>Now, if you want to look at what other processes are using this file descriptor, you can look at the number on the <code>NODE</code> column and run: <code>lsof | grep &lt;NODE&gt;</code></p></li> </ul> <p>The problem I had was that the standard output and standard error from the hook script were trapped by git in a pipe to forward them to the remote host (the host that did a git push). Also, my script restarted the postgresql daemon. As a consequence, postgresql inherited the standard output and standard error from git. That is, the pipe that forwards everything back to the remote hit host.</p> <p>One solution is to close stdout and stderr if you spawn services, by doing for example:</p> <pre><code>service postgresql restart &gt;&amp;- 2&gt;&amp;- &lt;&amp;- </code></pre> <p>But, you won't get any error message. The other and more generic solution I fould was to put the following code in my post-update hook:</p> <pre><code># Creates a temp file t="$(tempfile)" || exit trap "rm -f -- '$t'" EXIT # Run the script # You need to run the script in background, and to redirect its standard and # error output to $t bash path/to/script.bash &gt;"$t" 2&gt;&amp;1 &lt;/dev/null &amp; # use tail -f to follow the output of the script, and --pid to exit when the # previous script exits ($! is the pid of the script). This might not be very # portable though tail -n 0 --pid $! -f "$t" # Clean up temp file # if a process is still attached to it, the inode won't be cleared until the # process close the file or dies. In our case, we don't care much. rm -f -- "$t" trap - EXIT </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload