https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223325
Bug ID: 223325 Summary: usr.sbin/service: Add support for interacting with services in jails. Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: bin Assignee: freebsd-bugs@FreeBSD.org Reporter: dor....@xm0.uk Created attachment 187586 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=187586&action=edit Add jails support to /usr/sbin/service and update man page. This patch adds support to `/usr/sbin/service` for interacting with services within jails. This is mostly useful when upgrading services within jails as it allows users to stay within the usual flow and tools for upgrading packages and restarting services. I've been using this patch for a while now personally and everything seems to work as intended. Consider the following when operating on the jail host, this is the usual flow when some services are updated: --- # Upgrade all packages pkg upgrade # Restart a service that needs it service named restart --- If named is within a jail, the flow changes in an inconsistent way. --- # Upgrade all packages within the dns jail pkg -j dns upgrade # Restart the named service within the dns jail. # Just one of many, perhaps ezjail-admin or some other tool was used to execute # commands within the jail. jexec dns service named restart --- With this patch, users can stay within the more familiar workflow of just using the pkg and service utilities. --- # Upgrade all packages within the dns jail. pkg -j dns upgrade # Restart the named service within the dns jail. service -j dns named restart --- The man page was updated to reflect this change and is included in the diff. The patch to `service.sh` includes comments on was is happening around the -j option, as we end up parsing the options twice. The first time we check for `-j` and use it if we find it, the second time is parsing the rest of the `service` arguments. There may be a better way of achieving this, but my shell scripting is rusty. -David -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ freebsd-bugs@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"