Running the command in a bash wrapper would allow you to know when the process is killed by oom-killer
#!/bin/bash
REAL_COMMAND="/usr/bin/tail /dev/zero"
$($REAL_COMMAND)
ecode=$?
if [ $ecode -ne 0 ]; then
echo "$REAL_COMMAND returned $ecode" >&2
fi
exit $ecode#!/bin/bash
$ecode will be (128+9) = 137 when the oom_killer kills it.
For testing, the oom condition will probably occur quicker if you:
sudo swapoff -a
First
From:
HTCondor-users <htcondor-users-bounces@xxxxxxxxxxx> on behalf of Greg Thain via HTCondor-users <htcondor-users@xxxxxxxxxxx>
Date: Friday, October 6, 2023 at 6:19 PM
To: htcondor-users@xxxxxxxxxxx <htcondor-users@xxxxxxxxxxx>
Cc: Greg Thain <gthain@xxxxxxxxxxx>
Subject: Re: [HTCondor-users] Capturing the signal from worker nodes when job breaches memory