[csw-maintainers] addition to CSWcommon?

Maciej (Matchek) Blizinski maciej at opencsw.org
Thu Dec 30 02:50:46 CET 2010


No dia 30 de Dezembro de 2010 01:32, Maciej (Matchek) Blizinski
<maciej at opencsw.org> escreveu:
> No dia 15 de Dezembro de 2010 17:03, Ben Walton <bwalton at opencsw.org> escreveu:
>> I'm bootstrapping a new box (the first in a long time) and I just
>> discovered that /etc/opt/csw/init.d is not created by anything (in an
>> early set of packages), which breaks the install of CSWossh.
>
> Perhaps cswinitsmf could be updated to create the base directory if
> it's missing?

Example implementation:

If the base directory doesn't exist, create it.  It should protect
installations of packages where base directories of init files don't exist.
---
 .../trunk/files/CSWcswclassutils.i.cswinitsmf      |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswinitsmf
b/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswinitsmf
index d712a19..2abb808 100644
--- a/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswinitsmf
+++ b/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswinitsmf
@@ -87,6 +87,15 @@ do
     daemon=yes
   fi

+  # Create the base directory if not present.
+  # http://lists.opencsw.org/pipermail/maintainers/2010-December/013456.html
+  base_dir=`/usr/bin/dirname ${dest}`
+  if [ -r "${base_dir}" ]; then
+  	:
+  else
+  	mkdir -p "${base_dir}"
+  fi
+
   if [ "$smf" = "yes" ]; then
     # Copy the service script
     /usr/bin/cp $src $dest || exit 2
-- 
1.7.3


More information about the maintainers mailing list