1836987 Members
2265 Online
110111 Solutions
New Discussion

Re: Rename a Package.

 
david_252
Frequent Advisor

Rename a Package.

Hi:

I Have just one package in a single node cluster. I have to rename the package from packageA to packageB. Please let me know what would be the steps to rename the package.

Thanks
David.
7 REPLIES 7
Rita C Workman
Honored Contributor

Re: Rename a Package.

Maybe someone else knows a better/quicker way. But I can't recall a command to 'change' a pkg name.

I would probably create a new package, then use the old package info and modify my new package. Then I would ensure that my /etc/host file reflects the new pkg info for IP resolution. When everything looks good, I'd just delete the old package.

Create:
cmmakepkg -s .cntl
cmmakepkg -p .conf

Modify scripts as mentioned.

Check new pkg:
cmcheckconf -v -p .conf

When all ok apply new pkg:
cmapplyconf -v -p .conf

Fix IP address...
Run new pkg:
cmrunpkg -v

If everything looks good then delete old pkg.
cmdeleteconf -v -p

Hope this helps,
Rita
Jeff Schussele
Honored Contributor

Re: Rename a Package.

Hi David,

Here you go:

1) Down the pkg
cmhaltpkg -v pkg_name

2) Down the cluster
cmhaltcl

3) If you want to keep the directory name consistent with the pkg name then create the new pkg dir
mkdir /etc/cmcluster/new_pkg_name

4) Copy the existing contents from the old pkg dir (optional)
cp /etc/cmcluster/old_pkg_name/* /etc/cmcluster/new_pkg_name

5) Rename the files in the new pkg dir to match the new pkg name (optional)

6)Edit the config file for the new pkg & set the new name in there. Specifically the PACKAGE_NAME, RUN_SCRIPT, HALT_SCRIPT

7) Edit the pkg control file IF you're using the PKGS_2_ALLOW field in there.

8) Check your new cluster configuration
cmcheckconf -C /etc/cmcluster/cluster_ascii_file -P /etc/cmcluster/new_pkg_name/pkg_ascii_file

9) If check is OK - apply the new config
cmapplyconf -fv -C /etc/cmcluster/cluster_ascii_file -P /etc/cmcluster/new_pkg_name/pkg_ascii_file

10) If that completes successfully - restart the cluster
cmruncl

11) Start the new pkg
cmrunpkg -v new_pkg_name

I don't think I forgot anything there, but someone will point it out if I did.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
david_252
Frequent Advisor

Re: Rename a Package.

Hi Rita/Jeff:

I just followed the first procedure (by rita) and when i do a checkconf it produces the foll. error

"-p" option specified. Opening packaging reference file: /etc/cmcluster/pkgb.conf
Parsing package file:

cmccheckconf : Nonexistent package ascii file:

I am not sure what is wrong? pl. Help.

Thanks

David
Jeff Schussele
Honored Contributor

Re: Rename a Package.

Hi (again) David,

IF you're specifying the pkg ascii file in the command - it's capital P ( -P )

If you're specifying a pkg reference file (Used if you have LOTS of pkgs) then it's lower case p ( -p ).
If you ARE using the reference file, you have to change the entry in that file to reflect the new pkg name & location.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Rajeev  Shukla
Honored Contributor

Re: Rename a Package.

Hi David and Jeff.

Note: For this you really dont have to halt the cluster.
So no down time is required just halt the package that should solve the purpose.
edit the package configuration file. Make the changes for new package name in the package configuration file.
Do cmcheckconf and then do cmapplyconf.
You'll have new package name in your cluster. delete the old package name using cmdeleteconf -p
Its so simple.....
Cheers
Rajeev
monasingh_1
Trusted Contributor

Re: Rename a Package.

This one should easy. Since you just have one node one package config.

01. save the existing /etc/cmcluster to .old

01. halt cluster by cmhaltcl -f
02. cmdeleteconf -c clustername

03. vgchange -c n cluster_VG

04. vgchange -a y cluster_VG

At this time you can assume that you are starting from scratch and there was no cluster installed earlier. Even though you are using backed up control and config files..

05. rename and edit the old package configure for new propossed name as needed.

06. run cmcheckconf and then cmapplyconf..

hope this helps.
Sridhar Bhaskarla
Honored Contributor

Re: Rename a Package.

Hi David,

Looks like you have already performed what you asked. *You neither have to halt the cluster not to do this*. You will only be dealing with the package.

#cmhaltpkg -v packageA
#cmdeleteconf -P packageA
#mv /etc/cmcluster/packageA /etc/cmcluster/packageB

Names can be different. For ex.,

packageA.conf = Your package configuration file
packageA.cntl = Your package control file
packageA.sh = Your package startup/shutdown script - optional

Rename the scripts packageA.conf, packageA.cntl and packageA.sh (if you have) to PackageB.* respectively

Edit packageA.conf and change the package name and the control script names.
Edit package.cntl and change wherever you mentioned packageA to packageB. Basically search for packageA and replace it with packageB. Look at packageB.sh and see if packageA has been hardcoded.

Once it is done, go ahead and add it to the cluster.

#cmapplyconf -P /etc/cmcluster/packageB/packageB.conf
#cmrunpkg -v packageB.conf

Look at /etc/cmcluster/packageB/packageB.cntl.log while the package comes up.

-Sri

PS: Monasingh - Looks like you are trying to answer the questions that are days old. It is alright but they will push the recent questions down. Most of the members look at the first page to respond to recent answers. So, this may cause inconvenience to the users that are waiting for quick responses.
You may be disappointed if you fail, but you are doomed if you don't try