]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r328032,r328060,r328243: service(8): Support services in jails
authorkevans <kevans@FreeBSD.org>
Tue, 30 Jan 2018 19:16:38 +0000 (19:16 +0000)
committerkevans <kevans@FreeBSD.org>
Tue, 30 Jan 2018 19:16:38 +0000 (19:16 +0000)
commitd3a9144a73ad565126e63c40cada6f8f2ede9dd5
treeeceac43e7764d502f95c59ad46e5b591621cd4af
parent52a77a1711cb08761024ac1c465ec76f486209df
MFC r328032,r328060,r328243: service(8): Support services in jails

MFC r328032: service(8): Add support for interfacing with services in jails

Provide a -j option that can take a jail name or id. If -j is specified,
check that the jail exists and proxy the service request through to
service(8) in the jail.

This allows for cleaner workflows when updating services in a jail, turning
the following:

pkg -j dns upgrade
jexec dns service named restart

into:

pkg -j dns upgrade
service -j dns named restart

MFC r328060: service(8): Reset OPTIND properly now that we parse args twice

r328032 introduced a second round of argument parsing to proxy the request
through to a jail as needed, but failed to reset OPTIND before getting to
the second round of parsing to allow other flags to be set.

MFC r328243: usr.sbin/service: Fix -j to not be order dependant

The introduced -j option is highly dependant on the ordering of arguments,
and it exhibited broken behavior in some other circumstances. Fix these
issues, and simplify the feature by removing the unneessary double parsing
of options.

PR: 223325
usr.sbin/service/service.8
usr.sbin/service/service.sh