git: bfe353ddfe - main - Use full path to ifconfig/route binaries in VNET config example script

Benedict Reuschling <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.doc
Message-ID <[email protected]>
The branch main has been updated by bcr:

URL: https://cgit.FreeBSD.org/doc/commit/?id=bfe353ddfe4296576a04f328cfb3578e60bd25e2

commit bfe353ddfe4296576a04f328cfb3578e60bd25e2
Author:     Benedict Reuschling <[email protected]>
AuthorDate: 2024-08-12 09:06:20 +0000
Commit:     Benedict Reuschling <[email protected]>
CommitDate: 2024-08-12 09:06:20 +0000

    Use full path to ifconfig/route binaries in VNET config example script
    
    Before this change, the jail.conf example for VNET jails produces the
    following error when running "service jail start vnet":
    
    Starting jails: cannot start jail  "vnet":
    jail: vnet: exec ifconfig: No such file or directory
    jail: vnet: ifconfig epair154 create up: failed
    
    The solution is to provide full paths to both ifconfig and route
    (/sbin/ifconfig and /sbin/route, respectively) in the example.
    Afterwards, the jail starts without errors. This seems to be the only
    occurance in the chapter since the other examples do not have any
    exec.{prestart,start,poststop} sections.
---
 documentation/content/en/books/handbook/jails/_index.adoc | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/documentation/content/en/books/handbook/jails/_index.adoc b/documentation/content/en/books/handbook/jails/_index.adoc
index c49052cdb2..fbe5e053c4 100644
--- a/documentation/content/en/books/handbook/jails/_index.adoc
+++ b/documentation/content/en/books/handbook/jails/_index.adoc
@@ -752,13 +752,13 @@ vnet {
   $epair = "epair${id}";
 
   # ADD TO bridge INTERFACE
-  exec.prestart  = "ifconfig ${epair} create up";
-  exec.prestart += "ifconfig ${epair}a up descr jail:${name}";
-  exec.prestart += "ifconfig ${bridge} addm ${epair}a up";
-  exec.start    += "ifconfig ${epair}b ${ip} up";
-  exec.start    += "route add default ${gateway}";
-  exec.poststop = "ifconfig ${bridge} deletem ${epair}a";
-  exec.poststop += "ifconfig ${epair}a destroy";
+  exec.prestart  = "/sbin/ifconfig ${epair} create up";
+  exec.prestart += "/sbin/ifconfig ${epair}a up descr jail:${name}";
+  exec.prestart += "/sbin/ifconfig ${bridge} addm ${epair}a up";
+  exec.start    += "/sbin/ifconfig ${epair}b ${ip} up";
+  exec.start    += "/sbin/route add default ${gateway}";
+  exec.poststop = "/sbin/ifconfig ${bridge} deletem ${epair}a";
+  exec.poststop += "/sbin/ifconfig ${epair}a destroy";
 }
 ....
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.