https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242437
Bug ID: 242437
Summary: Jail rc script does not return non-0 exit code on
problems
Product: Base System
Version: 12.1-RELEASE
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: conf
Assignee: [email protected]
Reporter: [email protected]
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
Examples:
[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 $?
0
[root@kwik-e ~]# service jail start doesnotexist
Starting jails: cannot start jail "doesnotexist":
jail: "doesnotexist" not found
.
[root@kwik-e ~]# echo $?
0
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.
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"