Commit 3ea6fd0
committed
[SPARK-22377][BUILD] Use /usr/sbin/lsof if lsof does not exists in release-build.sh
## What changes were proposed in this pull request?
This PR proposes to use `/usr/sbin/lsof` if `lsof` is missing in the path to fix nightly snapshot jenkins jobs. Please refer #19359 (comment):
> Looks like some of the snapshot builds are having lsof issues:
>
> https://amplab.cs.berkeley.edu/jenkins/view/Spark%20Packaging/job/spark-branch-2.1-maven-snapshots/182/console
>
>https://amplab.cs.berkeley.edu/jenkins/view/Spark%20Packaging/job/spark-branch-2.2-maven-snapshots/134/console
>
>spark-build/dev/create-release/release-build.sh: line 344: lsof: command not found
>usage: kill [ -s signal | -p ] [ -a ] pid ...
>kill -l [ signal ]
Up to my knowledge, the full path of `lsof` is required for non-root user in few OSs.
## How was this patch tested?
Manually tested as below:
```bash
#!/usr/bin/env bash
LSOF=lsof
if ! hash $LSOF 2>/dev/null; then
echo "a"
LSOF=/usr/sbin/lsof
fi
$LSOF -P | grep "a"
```
Author: hyukjinkwon <[email protected]>
Closes #19695 from HyukjinKwon/SPARK-22377.
(cherry picked from commit c8b7f97)
Signed-off-by: hyukjinkwon <[email protected]>1 parent d905e85 commit 3ea6fd0
1 file changed
+9
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
124 | 131 | | |
125 | 132 | | |
126 | 133 | | |
| |||
337 | 344 | | |
338 | 345 | | |
339 | 346 | | |
340 | | - | |
| 347 | + | |
341 | 348 | | |
342 | 349 | | |
343 | 350 | | |
| |||
375 | 382 | | |
376 | 383 | | |
377 | 384 | | |
378 | | - | |
| 385 | + | |
379 | 386 | | |
380 | 387 | | |
381 | 388 | | |
| |||
0 commit comments