Sorry, the first had a copy/paste mistake, but actually, it can be much reduced:

# Get the default config
. /etc/opt/csw/csw.conf
# Get the specific config
. /etc/opt/csw/mysql5rc

# If MYSQLD_ARCH is set to something, use that
# architecture name

MYSQLD_SAFE=${BINDIR}/${MYSQLD_ARCH}/mysqld_safe


After all, if the variable is empty, // is not very elegant, but perfectly valid :-)

Or if keeping the if clause:

[...]
  # Else just use the minimal 32-bit default
  MYSQLD_SAFE=${BINDIR}/mysqld_safe
[...]

Laurent

On 02/07/2012 18:27, Laurent Blume wrote:
On 07/02/12 17:44, Dagobert Michelsen wrote:
The downside for (2) is you need to manually select the tools from
either /opt/csw/bin
or /opt/csw/bin/64 for your selected data model. We had this for
OpenLDAP at it is not
easy to understand for users.

I don't think it's necessarily a problem.

You can set a proper default by:
   - use the minimal default (32) and tell the user he can set his own
   - use the kernel default (isainfo -k) and let the user override it if
he wants something else


In the first case, it would be something like:

# Get the default config
. /etc/opt/csw/csw.conf
# Get the specific config
. /etc/opt/csw/mysql5rc

# If MYSQLD_ARCH is set to something, use that
# architecture name
if [ -n "$MYSQLD_ARCH" ]; then
   MYSQLD_SAFE=${BINDIR}/${MYSQLD_ARCH}/mysqld_safe
else
   # Else just use the minimal 32-bit default
   MYSQLD_SAFE=${BINDIR}/${MYSQLD_ARCH}/mysqld_safe
fi


In the second case:

# Get the default config
. /etc/opt/csw/csw.conf
# Get the specific config
. /etc/opt/csw/mysql5rc

# If MYSQLD_ARCH is not set, use the kernel architecture as default
if [ -z "$MYSQLD_ARCH" ]; then
   MYSQLD_ARCH=$(isainfo -k)
fi

MYSQLD_SAFE=${BINDIR}/${MYSQLD_ARCH}/mysqld_safe


I believe both cases could be easily applied to other daemons.
In the first, the 32 bit version could simply be put in bin/.
In the second, it's probably better to default it to bin/1386/, but it
could be in bin/ if it's easier to keep compatibility or not bother to
change recipes.
Of course, some additional tests (existence of directories, of binaries)
can be added, but that's pretty much trivial as well.

I tend to believe that completely moving to 64 bit would be
best (with 32 bit libraries available also).

Certainly agree on that. It would be good for me.

Laurent
_______________________________________________
users mailing list
[email protected]
https://lists.opencsw.org/mailman/listinfo/users


_______________________________________________
users mailing list
[email protected]
https://lists.opencsw.org/mailman/listinfo/users

Reply via email to