PacketFence - BTS - PacketFence
View Issue Details
0001272PacketFenceerror-handlingpublic2011-09-20 10:382015-02-13 15:39
psnizek 
 
lowtweakalways
closedopen 
2.2.1 
 
0001272: pfcmd checkup non-zero return value if everything isok
pfcmd checkup always returns non-zero values.
This can cause premature exits if shell scripts use set -e.

This return value seems OK:
Checking configuration sanity...
FATAL - internal network(s) not defined!
root@ar:/usr/local/pf/bin# echo $?
255

This return value does not seem to be OK:
root@ar:/usr/local/pf/bin# ./pfcmd checkup
Checking configuration sanity...
Nothing to report.
root@ar:/usr/local/pf/bin# echo $?
1
small script to test:
#!/bin/bash
set -e
/usr/local/pf/bin/pfcmd checkup
echo "If you can read this, exit status is 0"


"Patch":
sed -i 's/exit(1)/exit(0)/' pfcmd
(only tested in conjunction with pfcmd checkup).
No tags attached.
Issue History
2011-09-20 10:38psnizekNew Issue
2011-09-20 11:02obilodeauNote Added: 0002229
2011-09-20 11:02obilodeauPrioritynormal => low
2011-09-20 11:02obilodeauCategoryrefactoring => error-handling
2011-09-20 11:02obilodeauTarget Version => +1
2015-02-13 15:39lmunroNote Added: 0003773
2015-02-13 15:39lmunroStatusnew => closed

Notes
(0002229)
obilodeau   
2011-09-20 11:02   
triage
(0003773)
lmunro   
2015-02-13 15:39   
Closing old bugs.
If we haven't fixed them in four years they are either not a bug, no longer relevant or not worth it.