Hi Keith,
I'm not sure that this is a very likely use case but agree it
could be confusing. I've made the following change to implement this:
diff -r 18cf686a949e usr/src/cmd/installadm/create-client.sh
--- a/usr/src/cmd/installadm/create-client.sh Fri Nov 20 12:25:22 2009
-0700
+++ b/usr/src/cmd/installadm/create-client.sh Fri Nov 20 13:51:00 2009
-0700
@@ -233,6 +233,10 @@
echo "${myname}: Image-path record for service" \
"${SERVICE_NAME} is missing."
exit 1
+ elif [ ! -d $IMAGE_PATH ]; then
+ echo "${myname}: Install image directory " \
+ "${IMAGE_PATH} (from SMF) does not exist."
+ exit 1
fi
fi
So now one sees:
root at jumprope:~# installadm create-client -e c0:ff:ee:c0:ff:ee -n
clay_ai_sparc
create-client: Install image directory /var/ai/clay_ai_sparc1 (from SMF) does
not exist.
Thank you,
Clay
On Wed, 18 Nov 2009, Keith Mitchell wrote:
> Thank you Clay. Do you think there might be a need to explicitly state that
> the image_path entry in the SMF service is bad when the '-t' flag is not
> supplied, or will the users be able to figure it out? I'm concerned that
> getting a message about "/some/path is not valid" when /some/path was not
> supplied at the command line might be confusing, but I could be over thinking
> this.
>
> - Keith
>
>
> Clay Baenziger wrote:
>> Hi Keith,
>> I should have included my test cases which I'd sent only to Ethan.
>> They're below, see under Pathological cases for your questions.
>> Thank you,
>> Clay
>>
>> Test cases:
>> -----------
>> All commands based off installadm create-client -e c0:ff:ee:c0:ff:ee
>> [options]. Where [options] are:
>> -n <existant service>
>> jack at footest:~# installadm create-client -e c0:ff:ee:c0:ff:ee -n
>> test
>> Setting up SPARC client...
>> Creating SPARC configuration file
>>
>> Detected that DHCP is not set up on this server.
>> If not already configured, please create a DHCP macro
>> named 01C0FFEEC0FFEE with:
>> Boot server IP (BootSrvA) : 172.20.24.42
>> Boot file (BootFile) :
>> http://172.20.24.42:5555/cgi-bin/wanboot-cgi
>> If you are running Sun's DHCP server, use the following
>> command to add the DHCP macro, 01C0FFEEC0FFEE:
>> /usr/sbin/dhtadm -g -A -m 01C0FFEEC0FFEE -d
>> :BootSrvA=172.20.24.42:BootFile=\
>> "http://172.20.24.42:5555/cgi-bin/wanboot-cgi\":
>>
>> Note: Be sure to assign client IP address(es) if needed
>> (e.g., if running Sun's DHCP server, run pntadm(1M)).
>>
>> -n <non-existant service>
>> jack at footest:~# installadm create-client -e c0:ff:ee:c0:ff:ee -n
>> test1
>> create-client: Service does not exist: test1
>>
>> -n <existant service> -t <existant dir>
>> jack at footest:~# installadm create-client -e c0:ff:ee:c0:ff:ee -n
>> test -t
>> /var/ai/test
>> Setting up SPARC client...
>> Creating SPARC configuration file
>>
>> Detected that DHCP is not set up on this server.
>> If not already configured, please create a DHCP macro
>> named 01C0FFEEC0FFEE with:
>> Boot server IP (BootSrvA) : 172.20.24.42
>> Boot file (BootFile) :
>> http://172.20.24.42:5555/cgi-bin/wanboot-cgi
>> If you are running Sun's DHCP server, use the following
>> command to add the DHCP macro, 01C0FFEEC0FFEE:
>> /usr/sbin/dhtadm -g -A -m 01C0FFEEC0FFEE -d
>> :BootSrvA=172.20.24.42:BootFile=\
>> "http://172.20.24.42:5555/cgi-bin/wanboot-cgi\":
>>
>> Note: Be sure to assign client IP address(es) if needed
>> (e.g., if running Sun's DHCP server, run pntadm(1M)).
>>
>> -n <non-existant service> -t <non-existant dir>
>> [unchanged behavior]
>> jack at footest:~# installadm create-client -e c0:ff:ee:c0:ff:ee -n
>> test1 -t
>> /var/ai/lakdjf
>> create-client: Install image directory /var/ai/lakdjf does not
>> exist.
>>
>> -n <non-existant service> -t <existant dir>
>> [unchanged behavior]
>> jack at footest:~# installadm create-client -e c0:ff:ee:c0:ff:ee -n
>> test1 -t
>> /var/ai/test
>> create-client: Service does not exist: test1
>>
>> [Pathological cases]
>> --------------------
>> -n <existant service (but with invalid image_path SMF entry)>
>> jack at footest:~# installadm create-client -e c0:ff:ee:c0:ff:ee -n
>> test
>> [unchanged behavior]
>> create-client: Install image directory /var/ai/foobar does not
>> exist.
>>
>> -n <existant service (but with no image_path SMF entry)>
>> jack at footest:~# installadm create-client -e c0:ff:ee:c0:ff:ee -n
>> test1
>> create-client: Image-path record for service test1 is missing.
>>
>> -n <existant service> -t <existant but invalid dir>
>> [unchanged behavior]
>> root at jumprope:~# installadm create-client -e c0:ff:ee:c0:ff:ee -n
>> clay_ai_sparc -t /tmp/
>> create-client: /tmp//solaris.zlib does not exist. The specified image
>> is not an OpenSolaris image.
>>
>> -n <existant service (but with invalid image_path SMF entry)> -t <existant
>> dir>
>> [unchanged behavior]
>> jack at footest:~# installadm create-client -e c0:ff:ee:c0:ff:ee -n
>> test -t /var/ai/test
>> Setting up SPARC client...
>> Creating SPARC configuration file
>>
>> Detected that DHCP is not set up on this server.
>> If not already configured, please create a DHCP macro
>> named 01C0FFEEC0FFEE with:
>> Boot server IP (BootSrvA) : 172.20.24.42
>> Boot file (BootFile) :
>> http://172.20.24.42:5555/cgi-bin/wanboot-cgi
>> If you are running Sun's DHCP server, use the following
>> command to add the DHCP macro, 01C0FFEEC0FFEE:
>> /usr/sbin/dhtadm -g -A -m 01C0FFEEC0FFEE -d
>> :BootSrvA=172.20.24.42:BootFile=\
>> "http://172.20.24.42:5555/cgi-bin/wanboot-cgi\":
>>
>> Note: Be sure to assign client IP address(es) if needed
>> (e.g., if running Sun's DHCP server, run pntadm(1M)).
>>
>> On Wed, 18 Nov 2009, Keith Mitchell wrote:
>>
>>> Hi Clay,
>>>
>>> The new logic looks good to me. What error message will the user get if
>>> they don't specify image-path, and image-path is set improperly in the SMF
>>> service (either a non-existent directory, or a directory without a
>>> solaris.zlib file)? I think those may need to get updated.
>>>
>>> - Keith
>>>
>>> Clay Baenziger wrote:
>>>> Hi all,
>>>> I know Ethan's taken a peak at this code and if he would be able to
>>>> provide a further review, I've taken a stab at fixing 6774 (having
>>>> create-client not require the image-path to be handed in).
>>>> The webrev is posted at http://clayb.net/6774.
>>>> Thank you,
>>>> Clay
>>>> _______________________________________________
>>>> caiman-discuss mailing list
>>>> caiman-discuss at opensolaris.org
>>>> http://mail.opensolaris.org/mailman/listinfo/caiman-discuss
>>>
>