]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
When rerooting, take the init(8) path from argv[0] instead of fetching
authortrasz <trasz@FreeBSD.org>
Wed, 11 May 2016 10:03:13 +0000 (10:03 +0000)
committertrasz <trasz@FreeBSD.org>
Wed, 11 May 2016 10:03:13 +0000 (10:03 +0000)
commit6517c9db491c33980f1ce202e5363102be7bf7d0
tree86495d51fc0bd0c9291aa028925bde949f980b3d
parent2a88184c42d305ccddddfab4c4ea206aef3b5e37
When rerooting, take the init(8) path from argv[0] instead of fetching
it via kern.proc.pathname sysctl(2).  In some cases - booting from NFS
or rerooting after replacing the init binary with a new one - the sysctl
would fail.  In other cases - after upgrading, which moves the old init
to /sbin/init.bak - it would return /sbin/init.bak, which is the actual
path of the running init, instead of /sbin/init.

Reported by: Melissa Jenkins <melissa-freebsd at littlebluecar.co.uk>, jilles@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
sbin/init/init.c