ClusterLabs / resource-agents

Combined repository of OCF agents from the RHCS and Linux-HA projects
GNU General Public License v2.0
489 stars 577 forks source link

Filesystem: modify the check for the exit code of the child process. #1905

Closed SatomiOSAWA closed 6 months ago

SatomiOSAWA commented 7 months ago

Hi All,

I found something a bit off with the check for the exit code of the child process. It's in the stop operation. According to TLDP, the exit code when a process is signaled is expected to be "128 + signal number", not "127 + child exit code". (FYI: https://tldp.org/LDP/abs/html/exitcodes.html) So, I've done some small tweaks. I hope this will help.

Best Regards, SatomiOSAWA

knet-jenkins[bot] commented 7 months ago

Can one of the admins check and authorise this run please: https://ci.kronosnet.org/job/resource-agents/job/resource-agents-pipeline/job/PR-1905/1/input

oalbrigt commented 6 months ago

From the wait manpage: If id specifies a non-existent process or job, the return status is 127. If wait is interrupted by a signal, the return status will be greater than 128, as described under SIGNALS in bash(1). Otherwise, the return status is the exit status of the last process or job waited for.

SatomiOSAWA commented 6 months ago

Hi, @oalbrigt

OH!! I understand now. I'm so sorry for bothering you. Now I think the code is fine as it is. However, I still believe it's better to make adjustments to just the comment section.

Thank you.

Best Regards, Satomi OSAWA

oalbrigt commented 6 months ago

Updating the comment makes sense, so I'll look into that later this week.

oalbrigt commented 6 months ago

https://github.com/ClusterLabs/resource-agents/pull/1911/files

SatomiOSAWA commented 6 months ago

Hi, @oalbrigt

Thank you so much!

Satomi OSAWA

oalbrigt commented 6 months ago

You're welcome.