<div dir="ltr">I've done similar by having the epilog touch a file, then have the node health check (LBNL NHC) act on that file's presence/contents later to do the heavy lifting. There's a window of time/delay where the reason is "Epilog error" before the health check corrects it, but if that's tolerable this makes for a fast epilog script. <div><br></div><div>griznog</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 3, 2022 at 2:49 AM <<a href="mailto:taleintervenor@sjtu.edu.cn">taleintervenor@sjtu.edu.cn</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="ZH-CN"><div class="gmail-m_-3447850458630169699WordSection1"><p class="MsoNormal"><span lang="EN-US">Hi, all:<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">We need to detect some problem at job end timepoint, so we write some detection script in slurm epilog, which should drain the node if check is not passed.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">I know exit epilog with non-zero code will make slurm automatically drain the node. But in such way, drain reason will all be marked as <b>“Epilog error”</b>. Then our auto-repair program will have trouble to determine how to repair the node.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">Another way is call <b>scontrol</b> directly from epilog to drain the node, but from official doc <a href="https://slurm.schedmd.com/prolog_epilog.html" target="_blank">https://slurm.schedmd.com/prolog_epilog.html</a> it wrote:<u></u><u></u></span></p><p class="MsoNormal"><i><span lang="EN-US">Prolog and Epilog scripts should be designed to be as short as possible and should not call Slurm commands (e.g. squeue, scontrol, sacctmgr, etc). … Slurm commands in these scripts can potentially lead to performance issues and should not be used.<u></u><u></u></span></i></p><p class="MsoNormal"><span lang="EN-US">So what is the best way to drain node from epilog with a self-defined reason, or tell slurm to add more verbose message besides <b>“Epilog error” </b>reason?<u></u><u></u></span></p></div></div></blockquote></div>