Operating System - HP-UX
1825747 Members
2411 Online
109687 Solutions
New Discussion

Building SW products--where to lay files?

 
SOLVED
Go to solution
Michael Furnanz
Occasional Contributor

Building SW products--where to lay files?

Hi;

I'm finalizing the script kit build for a product we will eventually ship on HP-UX and looking for some general guidelines/help:

1) Where's the best place to lay the files-- /opt ? I'll link to them from the typical location such as /usr/bin, etc.

2) Does the directory option in the PSF actually work for a subdirectory such as /opt, or is in intended for use at the filesystem level? I tried directory=/opt in my PSF, but it doesn't actually put the files there during installation.

(sorry if this, my 2nd posting appears twice...can't even find the one I submitted yesterday. Yep, a newbie)

Thanks and Regards,
Mike
3 REPLIES 3
Jeff Schussele
Honored Contributor

Re: Building SW products--where to lay files?

Hi Mike,

1) /opt is OK for smaller utils & pkgs. If it's a large pkg a dedicated FS would be desirable

2) Entries in the psf file should look like

directory /opt
file file1
file file2

and so forth when you want to source them from /opt when building the pkg AND you want them in /opt when installed.

If you want to shift them around, the entries will look like

directory /opt=/new_dir
file file1
file file2

This sources them from /opt when built, but will lay them down in /new_dir during install

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Christopher Caldwell
Honored Contributor
Solution

Re: Building SW products--where to lay files?

There used to be a document around HP called the SYS V filesystem definition which gave great explanations of laying out applications. Amazingly enough, it's still around:
http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/5963-8942/5963-8942_top.html&con=/hpux/onlinedocs/5963-8942/00/00/1-con.html&toc=/hpux/onlinedocs/5963-8942/00/00/1-toc.html&searchterms=10.0%7cFile%7cSystem%7cLayout%7cHP-UX&queryid=20030318-165532

We've ammended the definition to deal with our environment which has some peculiarities that probably weren't considered when the SYS V file system definition was written:

1) if an application should fail in ServiceGuard, we make a strong, simple provision for portability [i.e. everything will be installed from a single mount point] (e.g. /opt/myapp).

2) we've made provisions for versioning, regardless of availability (e.g. /opt/myapp1.1, /opt/myapp1.2) so we can deal with parallel installs.

A notable exception is for "system" related things (e.g. custom sendmail, custom ftp, custom bind). In the case of system apps, we're more likely to distribute code (/opt, /usr/sbin, /etc/opt, /var/opt) in the more traditional SYS V layout.

Sridhar Bhaskarla
Honored Contributor

Re: Building SW products--where to lay files?

Mike,

If it is a third party product that developed for HP, then you would go with /opt. The standard configuration that I have been seeing is to place binaries, libs under /opt/your_product, configuration into /etc/opt/your_product and temporary storage into /var/opt/your_product. But I would suggest to keep everything under /opt/product so that it will be easy for the OS migrations. Also compile your programs with relative paths instead absolute paths so that your product can be installed anywhere.

Directory option does work.

An example is

...

directory /opt/product
file *

directory /opt/product/etc
file file1
file file2
directory /opt/product/lib
file *
directory /opt/product/bin

..

-Sri

You may be disappointed if you fail, but you are doomed if you don't try