Trying to start jails using "service jail start <jailname>".
I found two types of failures that cause the /etc/rc.d/jail script to return 0 after printing "cannot start jail" and not starting the jail.
The two cases are:
1. An exec.prestart command fails
2. The named jail does not exist
[root@kwik-e /etc]# service jail start lmcv6
Starting jails: cannot start jail "lmcv6":
ifconfig: BRDGADD epair4b: File exists
jail: lmcv6: ifconfig bridge1 addm epair4b: failed
[root@kwik-e /etc]# echo $?
[root@kwik-e ~]# service jail start doesnotexist
Starting jails: cannot start jail "doesnotexist":
jail: "doesnotexist" not found
[root@kwik-e ~]# echo $?
Looking at the code quickly it looks to me that no failures are handled with regards to the exit code of the script itself.
Some logic might need to be defined to deal with partial failures when starting multiple or all jails. Returning 1 on anything except complete and utter success would also work for me.