[OpenIndiana-discuss] Split-root installations
Cedric Blancher
cedric.blancher at gmail.com
Wed Nov 27 17:01:03 UTC 2013
On 27 November 2013 13:15, Jim Klimov <jimklimov at cos.ru> wrote:
> On 2013-11-27 12:16, Jim Klimov wrote:
>>>
>>> restart = disable and enable. If your /usr is nfs mounted,
>>> what happens when you disable networking?
>>
>>
>> I see a good point here, thanks :)
>>
>> So this trick with restarts should take place only in case that
>> I am testing - with the locally mounted /usr filesystem (though
>> how can we determine this well with i.e. iSCSI pools?), or perhaps
>> a check that there was no /usr/bin at start of the script and
>> there is one after it has done its work - actually this is what
>> I am trying to counter here?..
>
>
> Would this updated logic for filesystem/root be acceptable at least
> in terms of least-breakage? Again, the only(?) other solution is in
> the direction of reworked SMF dependencies so that networking starts
> after /usr is mounted - and there are cases that /usr can depend on
> the network, so it would become a spaghetti mess like the Live Media,
> not something I'd want to impose on everyone for production ;)
>
> --- /lib/svc/method/fs-root.splitroot 2013-11-17 03:21:47.000000000 +0100
> +++ /lib/svc/method/fs-root 2013-11-27 04:22:10.617171864 +0100
> @@ -24,10 +24,16 @@
>
> #
>
> # Make sure that the libraries essential to this stage of booting can be
> found.
> LD_LIBRARY_PATH=/lib; export LD_LIBRARY_PATH
>
> +NET_PHYS_FMRI="svc:/network/physical:default"
> +NET_NWAM_FMRI="svc:/network/physical:nwam"
> +NET_IPTUN_FMRI="svc:/network/iptun:default"
> +SVCADM=/usr/sbin/svcadm
> +SVCS=/usr/bin/svcs
> +
> libc_mount() {
> #
> # If there is an optimized libc available in /usr that fits this
> # processor, mount it on top of the base libc.
> #
> @@ -66,10 +72,17 @@
> libc_mount
> exit $SMF_EXIT_OK
> fi
>
> #
> +# Keep a flag that /usr was (or was not) available when the script started,
> +# because some services may need to reinitialize if it got mounted now.
> +#
> +_USR_WAS_AVAILABLE=yes
> +[ -d /usr/bin ] || _USR_WAS_AVAILABLE=no
> +
> +#
> # Root is already mounted (by the kernel), but still needs to be
> # checked, possibly remounted and entered into mnttab. First
> # mount /usr if it is a separate file system. If the file system
> # type is something other than zfs, mount it read-only. This must
> # be done first to allow utilities such as fsck and setmnt to
> @@ -237,8 +250,24 @@
> # Update kernel driver.conf cache with any additional driver.conf
> # files found on /usr, and device permissions from /etc/minor_perm.
>
> #
> /usr/sbin/devfsadm -I -P
>
> +#
> +# After getting an /usr, redo network. NWAM in particular requires good
> /usr.
> +#
> +if [ x"$_USR_WAS_AVAILABLE" = no ]; then
> + for _SVC in $NET_PHYS_FMRI $NET_NWAM_FMRI $NET_IPTUN_FMRI; do\
1. x"$_USR_WAS_AVAILABLE" = no will never be true because the string
constructed by x"$_USR_WAS_AVAILABLE" will always start with a x
character
2. Could this ugliness be finally replaced with [[ ]], i.e.
if [[ "$_USR_WAS_AVAILABLE" == "no" ]];
Ced
--
Cedric Blancher <cedric.blancher at gmail.com>
Institute Pasteur
More information about the OpenIndiana-discuss
mailing list