Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 04 Dec 2019 20:53:10 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 242437] Jail rc script does not return non-0 exit code on problems
Message-ID:  <bug-242437-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D242437

            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: bugs@FreeBSD.org
          Reporter: philipp@copythat.de

Trying to start jails using "service jail start <jailname>".

I found two types of failures that cause the /etc/rc.d/jail script to retur=
n 0
after printing "cannot start jail" and not starting the jail.

The two cases are:=20
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":=20
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":=20
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 star=
ting
multiple or all jails. Returning 1 on anything except complete and utter
success would also work for me.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-242437-227>