Details
-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
None
-
None
-
15188
Description
The /etc/init.d/lnet script should be supported on SLES machines. Currently, the lnet init script is only packaged when building for a RHEL distribution. It should be pretty straightforward to support the lnet init script on SLES as well. As far as I can tell, it doesn't do anything necessarily RHEL-specific.
Attachments
Activity
That's correct. The functions provided by RHEL in /etc/rc.d/init.d/functions are not the same as the functions provided by SLES in /etc/rc.status. However, I looked closely, and I don't see anything in /etc/init.d/lnet that uses any of those functions, so I'm not too worried about that.
The only thing the lnet init script uses out of /etc/sysconfig/network is the variable NETWORKING for this check:
# Source networking configuration and check that networking is up. [ -f /etc/sysconfig/network ] && . /etc/sysconfig/network && \ [ "${NETWORKING}" = "no" ] && exit 0
Yes, I'll test it on both a CentOS and a SLES machine and check for error messages.
We only have a need for the lnet init script, and the lustre one is massive, so I'd prefer not to get into that. Yes, they are packaged together based on the value of the automake conditional INIT_SCRIPTS:
if INIT_SCRIPTS initdir = $(sysconfdir)/init.d init_SCRIPTS = lnet if SERVER init_SCRIPTS += lustre endif endif
I could change it so that the lnet init script is packaged separately, so I can avoid making the lustre init script compatible with SLES.
Ryan,
I don't object in principle to you taking on the effort to craft truly general lnet & lustre init scripts. I think you've identified all the major areas that might be RHEL or SLES specific. I just worry that the rc.status include in SLES & functions include in RHEL might not be exactly equivalent in the primitives they provide to rc scripts. I also don't know in detail all the functions or global definitions used. I also don't know how much is provided by the /etc/sysconfig/network script in RHEL. It may be required for more than just ensuring that networking is already running. I agree it has no exact equivalent in SUSE, where /etc/sysconfig/network is a directory and not a script.
As far as I know you have called out the major diffs between SLES & RHEL rc frameworks that have an impact.
I would hope that whatever you do would be tested sufficiently in both SUSE & RHEL that it doesn't add noise in terms of extra warnings or errors at install time or boot time.
Do you plan to confine your efforts to just the lnet init script or take on the lustre one too? I think they are packaged together.
I should also address this comment:
I believe our policy on scripts was always to describe ours as examples and recommend users wanting to use them customize them as necessary in whatever site specific way was needed. I could be wrong, but that is my impression.
We would like an LNet init script for our usage on SLES nodes. There's not really anything site-specific about this lnet init script, so as long as I'm creating one that works for us, I'd like to contribute that change here.
Hi Bob.
I've done some further investigation to figure out just how RHEL specific the current lnet init script is.
This section at the beginning of the script sources two RHEL-specific files:
# Source function library. [ -f /etc/rc.d/init.d/functions ] && . /etc/rc.d/init.d/functions # Source networking configuration and check that networking is up. [ -f /etc/sysconfig/network ] && . /etc/sysconfig/network && \ [ "${NETWORKING}" = "no" ] && exit 0
For /etc/rc.d/init.d/functions, there is a similar SLES alternative, /etc/rc.status. However, as far as I can tell, nothing from /etc/rc.d/init.d/functions is being used by the lnet script anyway. Am I missing something?
For /etc/sysconfig/network, there is apparently no SUSE equivalent. I'm not sure how to address that. We could probably ignore that check on whether NETWORKING is enabled.
Another compatibility issue is the use of the file /var/lock/subsys/lnet. Here is what SUSE says about /var/lock/subsys (source: http://en.opensuse.org/openSUSE:Packaging_checks ):
/var/lock/subsys is neither used nor supported on openSUSE. Other distributions use it to mark that an init script has run. There is no equivalent on openSUSE. So in most cases refereces to /var/lock/subsys can be removed without replacement.
Since there is no SUSE equivalent, we'll just remove that for SLES.
With respect to the rigid conventions about comment headers in rc scripts, I don't believe those conventions are specific to SLES. I think it is an LSB thing. See the description here: https://refspecs.linuxbase.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/initscrcomconv.html
I think this means it would be okay, and even desirable, to include such a comment header in the init script for RHEL and SLES.
I can see a couple of ways to achieve lnet init script support for SLES. One would be to create two init scripts like you suggested, one for each distro. However, we could also do something like this and use just a single init script for both:
if [ -f /etc/rc.d/init.d/functions ] ; then
# define RHEL-specific {start,stop,...} functions
elif [ -f /etc/rc.status ]; then
# define SLES-specific {start,stop,...} functions
fi
That's probably the way I would prefer to proceed. Do you have any thoughts on this plan? Did I miss anything that's RHEL specific in the LNET init script?
I don't think your description is at all accurate. I see a bunch of things in the lnet script as it exists now that are very RHEL specific.
In addition to those I believe in SLES rc scripts there are quite rigid conventions about comment headers in rc scripts that help specify dependencies and order of execution. Pretty sure the existing script doesn't conform at all. Would probably need a more SLES specific script and Makefile support to package the right ones for each distro. Or maybe that's one possible approach.
I believe our policy on scripts was always to describe ours as examples and recommend users wanting to use them customize them as necessary in whatever site specific way was needed. I could be wrong, but that is my impression.
This is related to LU-4707 since the change that fixed that bug stopped the packaging of /etc/init.d/lnet on SLES.
I did a quick scan of the lustre init script, and it actually looks like very little is dependent on RHEL-specific functionality. It sources /etc/rc.d/init.d/functions, but it doesn't look like it uses anything from that file. It also sources /etc/sysconfig/network, and it uses the NETWORKING definition to see if networking is enabled. It does not actually touch any files under /var/lock/subsys, so no work would need to be done there.
We don't use the lustre init script, so I'm not sure how to use it and test it. We also don't run Lustre servers on SLES, so I would have to figure out how to test that. I'd prefer to just port the lnet init script to SLES, but the lustre init script could potentially be ported if necessary.