Bug#653598: status_of_proc should handle not-world-readable pid files better
"Didier 'OdyX' Raboud" <[email protected]>
| Newsgroups | gmane.linux.debian.devel.lsb |
|---|---|
| Organization | Debian, the Universal OS |
| Message-ID | <4F573A81.8010407__38749.726888682$1331117052$gmane$org@debian.org> |
tags 653598 +pending +patch
thanks
Hi Peter, and thanks for your bugreport, and patch
Le 29.12.2011 19:15, Peter Eisentraut a écrit :
> When a pid file is specified to status_of_proc with the -p option, but
> it's not readable, then status_of_proc returns 3 (not running) instead
> of 4 (unknown). pidofproc handles this specially:
>
> if [ "$specified" ]; then
> return 3 # almost certain it's not running
> fi
>
> but it's not clear why this is supposed to be different depending on
> whether the pid file is implicit or explicit.
>
> I suggest untangling this a bit and putting
>
> if [ -n "${pidfile:-}" ] && [ ! -r "$pidfile" ]; then
> return 4 # pid file not readable
> fi
>
> near the top of pidofproc. Then we also get the correct message from
> status_of_proc.
Agreed. I committed the attached patch, attributed to you (as it's not
100% the same patch, but equal in functionality and essence).
I hope it's okay that way!
Cheers,
OdyX
signature.asc
(application/pgp-signature, 663 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (MingW32) iQGcBAEBAgAGBQJPVzqBAAoJEIvPpx7KFjRVrwwMAIWneLkidC5tg9iVMj+7Knqu yWvcQKEMC/n5vdnqXKtMrXhUjoiJ+SOBj0J/RfppwmZQpDRLKHKZb3wIXnNXPx++ pOpUc7+d7k7Rl8H/971LjlyZXMmLvlEW8yiS3ZRLvo2kJ8f6og3Dsah4NYRnWjmK oiAJpgq5x9lgqGkC7BLSeC5xubaBym+BS7S9SANRuXXAVWbIrrXAxa6lwixPj7xO uagRLVojmlcePPW13pY/LAEKQk1Svf83jP+AZNXLFh7ybnL4eloTv5mpwcub3FjK mUbtORySj6blE68kIS23XbXc7gENosFZSiYPsNmqo6f0UVsqyQCedI2AaOH5q0Oq iUO2Zdftud8eDJOFovzicLSBqn/f6BGt3HnOfpL1c77tqvR59XUBHOAcvpFStkmc TWzo0jD7er4W1+utiu+f8yLtbCtHWK5izK6ozDaSNOYK+qepk0jsFWK8jIwZQu31 +JTTq4/JzYi6ejrHGY0u86kqqmLZ3bZA93bQ6VNvGQ== =aD9Q -----END PGP SIGNATURE-----