-
-
usr/src/cmd/svc/shell/smf_include.sh (Diff revision 1) If you remove this there is no need to introduce smf_zone_netstrategy at all.
Update services for non-global, exclusive-IP DHCP zone
Review Request #289 — Created Dec. 7, 2016 and updated
Information | |
---|---|
seeemef@mac.com | |
illumos-gate | |
2875, 7650, 8587, 8689, 8690, 8691 | |
Reviewers | |
general | |
8691 net-routing-setup does a match for "current=enabled" against the ipv[46]-routing "persistent" field
net-routing-setup does a check to determine "Are we routing dynamically?", but the nawk prog prints field $2 (persistent=enabled|disabled) and tries to match "current=enabled".
2875 local zones should not enforce "smf_netstrategy==none" regardless of reality
Historical issue regarding ngz and netstrategy
7650 Update net-svc to work for an exclusive-IP, DHCP non-global zone
For a DHCP global zone, net-svc (svc:/network/service:default) creates/updates resolv.conf to incorporate DHCP DNSserv and DNSdmain parameter values and updates nsswitch.conf to ensure dns is set as an active database for hosts/ipnodes.
net-svc does nothing for an exclusive-IP, DHCP, non-global zone; but it could do easily the equivalent. Moreover, net-svc only tries once to fetch DNSserv and DNSdmain from dhcpagent (dhcpinfo), which generally works for a global zone. For fast-booting non-global zones, there needs to be a few seconds allowance.
8689 Update identity-node to work for an exclusive-IP, DHCP, non-global zone
For a DHCP global zone, identity-node (svc:/system/identity:node) will use DHCP Hostname if returned. As with 7650, identity-node does nothing for an exclusive-IP, DHCP, non-global zone; but it could do easily the equivalent. One particular difference is that the previously-existing, non-global zone fallback to
uname -n
after /etc/nodename must be preserved for DHCP-handling as well.8690 Update net-routing-setup to work for an exclusive-IP, DHCP, non-global zone
For a DHCP global zone, net-routing-setup (svc:/network/routing-setup:default) will use DHCP Router if defined as a signal to disable routeadm/default-ipv4-routing. net-routing-setup does nothing for an exclusive-IP, DHCP, non-global zone; but it could do easily the same.
8587 svc:/network/routing/route:default usually is not needed nowadays
net-routing-setup uses defined "defrouters" as a signal to disable routing. Default, static routes from /etc/inet/static_routes should also be included in this signal. (net-routing-setup reads /etc/inet/static_routes as the last step in its handling, so this is not a major change to the script.)
Global zone
- affirmed that DHCP Hostname was used if defined for DHCP address (as before)
- affirmed that resolv.conf was created/revised and nsswitch.conf was revised for a DHCP address (as before)
- affirmed that DHCP IPv4 address (with DHCP Router defined) resulted in disabled routeadm/default-ipv4-routing (as before)
- affirmed that static IPv4 address with default, static route resulted in disabled routeadm/default-ipv4-routing (new)
Non-global zone
- affirmed that first boot (no addresses) has routeadm/default-ipv4-routing enabled (as before)
- after creating DHCP address and rebooting:
1) affirmed that defined DHCP Router resulted in disabled routeadm/default-ipv4-routing (new)
2) affirmed that DHCP Hostname was used if defined for DHCP address (new)
3) affirmed that resolv.conf was created/revised and nsswitch.conf was revised (new) - For testing 8691: removed address and rebooted to see routeadm/default-ipv4-routing enabled. Added a debug statement to net-routing-setup to affirm the expected assignment: dynamic_routing="true".
-
-
usr/src/cmd/svc/milestone/net-svc (Diff revision 1) Is it really necessary to spawn a sub shell/fork+exec for such a simple thing?
Because the system shell is now ksh93, IMHO
{1..6}
is a better choice than theseq
call (even bash supports this to produce sequences). -
usr/src/cmd/svc/milestone/net-svc (Diff revision 1) why explicitly
/bin/sleep
? Wouldn't be a simplesleep
better, so that the shell is able to use its builtin if available and thus avoid fork storms?Also the test for < 6 is for my taste not really needed/kind of redundant (if something goes wrong, waiting an add. sec doesn't really hurt) ...
-
usr/src/cmd/svc/shell/smf_include.sh (Diff revision 1) Why not
export VAR=value
? Would be less bloat, make the script more readable ...see also http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#export
-
Change Summary:
- Fix bug 8691 found during testing.
- Update identity-node and net-routing-setup also to support exclusive-IP, DHCP, non-global zones.
- Update net-routing-setup to use /etc/inet/static_routes as a defrouters signal. (Testing of 7650 etc found the same odd behavior as issue 8587).
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Testing Done: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Bugs: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 2 (+106 -34) |
Change Summary:
- condense consecutive patterns into one prog execution with "&&"
Description: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Bugs: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 3 (+106 -35) |
Change Summary:
- simplify matching of default routes from /etc/inet/static_routes
Diff: |
Revision 4 (+105 -35) |
---|
Change Summary:
- also call smf_netstrategy2 from net-physical, rc2.sh, rc3.sh, and rcS.sh
- remove redundancy in usr/src/cmd/svc/milestone/identity-node. (The RB diff erroneously shows "only whitespace changes" for this file in https://www.illumos.org/rb/r/289/diff/4-5, but in fact a redundant statement was removed -- probably an RB bug related to "moved code" detection, as the removed line is now shown as moved.)
Diff: |
Revision 5 (+113 -49) |
---|
-
In net-routing-setup, you've added a check for static_routes.
First - should the /etc/svc/volatile stuff have happened before that first check?
Second - would it be easier to simply move the entire static_routes handling (both the /etc/svc/volatile movement and the actual setting of routes) from the end of the file to before the section with the netstat in it? That way you don't need to add the separate check for static_routes (and you can just rely on the netstat check to see if a default route has been added).