Solved

Solaris JET finish script confusion

Posted on 2008-06-15
5
1,444 Views
Last Modified: 2013-12-27
Hi

I have alot of confusion regarding the running of a finish script after a Sollaris JET install.
The Jet install works fine and the finish script runs but I do not understand if the script is running on the Jumpstart server or client and why the /a directory is empty.

I would like to copy some files from the Jumpstart server to the Jumpstart client but initially I would like to understand exactly what is mounted to what.

I am using JET, so a JET template
The template defines the finish script as:  custom_scripts_m="athena-finish.sh"
The actual script exists on the Jumpstart server under here: /opt/SUNWjet/Clients/athena/athena-finish.sh
The script runs ok but I can not seem to use the mounted /a directory and I am not sure which server is running the script - The Jumpstart  server or the client.

The finish script is this:
#!/bin/sh
BASE="/a"
CLIENT=athena
SERVER="192.168.1.140"
echo "******************************"
echo "***** FINISH SCRIPT **********"
echo "******************************"
echo "**** Check a dir"
ls -alp
ls -alp ${BASE}
echo "***** COPY 1 ****"
echo "***** Running on server"
cp /opt/SUNWjet/Clients/athena/hosts ${BASE}/etc/inet/hosts
cp /opt/SUNWjet/Clients/athena/.profile ${BASE}/.profile
echo "*** Running on client"
cp ${BASE}/opt/SUNWjet/Clients/athena/hosts /etc/inet/hosts
cp ${BASE}/opt/SUNWjet/Clients/athena/.profile /.profile

The output is this:

CUSTOM: Running 001.custom.002.athena-finish.sh
******************************
***** FINISH SCRIPT **********
******************************
**** Check a dir
total 1087
drwxr-xr-x  23 root     root         512 Jun 15 18:45 ./
drwxr-xr-x  23 root     root         512 Jun 15 18:45 ../
-rwxr-xr-x   1 root     other       4374 Jun 15 08:22 .profile
drwxr-xr-x   2 root     root         512 Jun 14 21:49 a/
drwxr-xr-x   3 root     root         512 Jun 14 21:42 apps/
lrwxrwxrwx   1 root     root           9 Jun 15 18:43 bin -> ./usr/bin/
drwxr-xr-x  17 root     sys         3584 Jun 15 18:45 dev/
drwxr-xr-x   5 root     sys          512 Jun 15 18:43 devices/
drwxr-xr-x  60 root     sys         3584 Jun 15 18:49 etc/
drwxr-xr-x   3 root     sys          512 Jun 15 18:43 export/
dr-xr-xr-x   1 root     root           1 Jun 15 18:49 home/
drwxr-xr-x  10 root     sys          512 Jun 15 18:43 kernel/
lrwxrwxrwx   1 root     root           9 Jun 15 18:43 lib -> ./usr/lib/
drwx------   2 root     root        8192 Jun 14 21:11 lost+found/
drwxr-xr-x   2 root     sys          512 Jun 14 21:12 mnt/
dr-xr-xr-x   1 root     root           1 Jun 15 18:49 net/
-rw-r--r--   1 root     root           0 Jun 15 18:44 noautoshutdown
drwxr-xr-x   4 root     sys          512 Jun 15 18:43 opt/
drwxr-xr-x  47 root     sys         2048 Jun 15 18:43 platform/
-rw-r--r--   1 root     other      26112 Jun 15 10:57 post-flash.tar
dr-xr-xr-x  36 root     root      480032 Jun 15 18:49 proc/
drwxr-xr-x   2 root     sys         1024 Jun 15 18:43 sbin/
drwxrwxrwt   3 root     sys          185 Jun 15 18:49 tmp/
drwxr-xr-x  37 root     sys         1024 Jun 15 18:43 usr/
drwxr-xr-x  34 root     sys          512 Jun 15 18:39 var/
dr-xr-xr-x   2 root     root         512 Jun 14 21:49 vol/
drwxr-xr-x   3 root     root         512 Jun 14 21:42 wkspace/
dr-xr-xr-x   1 root     root           1 Jun 15 18:49 xfn/
total 4
drwxr-xr-x   2 root     root         512 Jun 14 21:49 ./
drwxr-xr-x  23 root     root         512 Jun 15 18:45 ../
**** Check a dir
***** COPY 1 ****
***** Running on server
cp: cannot access /opt/SUNWjet/Clients/athena/hosts
cp: cannot access /opt/SUNWjet/Clients/athena/.profile
*** Running on client
cp: cannot access /a/opt/SUNWjet/Clients/athena/hosts
cp: cannot access /a/opt/SUNWjet/Clients/athena/.profile
501 Terminated

I do not understand why I do not have access to the a/opt/SUNWjet/Clients/athena directory ?

Thanks in advance

0
Comment
Question by:s2budd
  • 2
  • 2
5 Comments
 
LVL 38

Accepted Solution

by:
yuzh earned 50 total points
Comment Utility
It is for finishing your client's configurations.

Have a look at the following links to get more backgroud information:
http://jet.maui.co.uk/wiki/index.php/JETPrimer
http://www.sun.com/bigadmin/content/jet/
http://wikis.sun.com/display/JET/Home;jsessionid=792CB5BBE568C706B861479474AF8387
0
 

Author Comment

by:s2budd
Comment Utility
Hello
Thanks for your reply. Yes I know about the above references and I did look in them again before posting but I am still confused. I can find some information within the the Yahoo group that's about 25% relevant and the JET documentation needs an update but does include a finish script but with a Perl script that modifies Jumpstart which is a bit confusing.

Does the finish script in the above example from the JET template:  custom_scripts_m="athena-finish.sh"
actually run on the Jumpstart server or the jumpstart client?
I am about 70% sure that it runs on the client but do not know why the directory /a is empty. I thought that a/ whould contain one of the NFS shares from the Jumpstart server.
0
 
LVL 22

Assisted Solution

by:blu
blu earned 75 total points
Comment Utility
It definitely runs on the client.
0
 
LVL 22

Assisted Solution

by:blu
blu earned 75 total points
Comment Utility
When the finish script runs, the newly installed operating system is usually installed at /a, but it is possible that a different location is used. If that is what is happening to you, you can change your script to use the variable
$ROOTDIR where you have $BASE now, except you don't set it in the scrip of course.
0
 

Author Closing Comment

by:s2budd
Comment Utility
Thanks guys
Awarded points as:  50, 50, 25
And what do points make? Points make prizes.

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now