Modifying the environment for Linux

This topic contains the documentation of the procedure that is required to adapt your environment for Linux. You must set dependencies for the initialization scripts sapinit and autofs so that they are started and stopped in the correct order.

sapinit needs a start dependency to autofs and autofs needs a start dependency to ospfd/zebra. Therefore, in the sapinit script under /etc/init.d at the end of the # Required-Start line, add the autofs:

# Copyright (c) 1995-2005 SAP AG Walldorf, Germany.
#
# /etc/init.d/sapinit
#
# chkconfig: 345 90 10
# description: Start sapstartsrv
#

### BEGIN INIT INFO
Provides: ospfd, zebra, ...
# Required-Start: $network $syslog $remote_fs $time autofs

Also, you must set dependencies for the ospfd, zebra, and autofs services under SLES and the frr and autofs services under RHEL so that they are started and stopped in the correct order. Make sure that you have installed the autofs package and additionally the nfs-utils package under RHEL 8.x.

systemd adaption:

As a root user, perform the following to adapt the autofs script:

  1. Adapt start-dependency of autofs service:
    cp /usr/lib/systemd/system/autofs.service /etc/systemd/system
    chmod 664 /etc/systemd/system/autofs.service
    

    In /etc/systemd/system/autofs.service, change from:

    SLES 12.x:

    After=network.target remote-fs.target nss-lookup.target nss-user-lookup.target

    to:

    After=network.target remote-fs.target nss-lookup.target nss-user-lookup.target zebra.service ospfd.service

    RHEL 8.x:

    After=network.target ypbind.service sssd.service network-online.target remote-fs.target rpc-statd.service rpcbind.service

    to:

    After=network.target ypbind.service sssd.service network-online.target remote-fs.target rpc-statd.service rpcbind.service frr.service

    Then, check with command: systemd-delta systemd/system.

  2. As you need to wait until the NFS server VIPA can be pinged before you can mount the SAP global file systems, we provide a sample testNFS.sh script, which is part of the zSAP_BusinessContinuity<nn>.zip package. The testNFS.sh script waits up to three minutes until the NFS server VIPA can be pinged. Copy the testNFS.sh script with correct permissions into the correct directory (in the example the target directory is /root) and provide the virtual NFS server host name as an script argument (in the example it is sapnfsv). You need to execute that testNFS.sh script before autofs.

    Create and save the file /etc/systemd/system/beforeafs.service (664 permissions), which contains:

    [Unit]
    Before=autofs.service
    [Service]
    Type=oneshot
    RemainAfterExit=true
    ExecStart=/bin/sh -c ’/root/testNFS.sh sapnfsv’
    # beware, executable is run directly, not through a shell, check the man pages
    # systemd.service and systemd.unit for full syntax
    [Install]
    # target in which to start the service
    WantedBy=multi-user.target
    #WantedBy=graphical.target
    

    Then, run systemctl daemon-reload.

    Check whether the beforeafs.service is enabled and active (running) with the command: systemctl status beforeafs.service.

    If beforeafs.service is not enabled or active, then run:

    systemctl enable beforeafs.service
    systemctl start beforeafs.service
    

    Additionally, in the same way check if autofs.service is enabled and active.

  3. Adapt start-dependency of dynamic routing daemons
    SLES 12.x:

    It is necessary to have the zebra and ospfd services started after all wicked managed network interfaces are up. Therefore, as root user, do the following:

    Create and save the file /etc/systemd/system/zebra.service (664 permissions), which contains:

    [Unit]
    Description=GNU Zebra routing manager
    Wants=network.target
    After=network.target
    ConditionPathExists=/etc/quagga/zebra.conf
    [Service]
    Type=forking
    PIDFile=/run/quagga/zebra.pid
    EnvironmentFile=-/etc/sysconfig/quagga
    ExecStartPre=/sbin/ip route flush proto zebra
    ExecStart=/usr/sbin/zebra -d $ZEBRA_OPTS -f /etc/quagga/zebra.conf
    Restart=on-abort
    [Install]
    WantedBy=multi-user.target
    
    Then, run:
    systemctl daemon-reload
    With the following command, check if the zebra service is enabled and active (running):
    systemctl status zebra.service
    If the zebra service is enabled and active (running), then restart the ospfd service:
    systemctl restart ospfd.service
    If the zebra service is not enabled or active, then run:
    systemctl enable zebra.service
    systemctl start zebra.service
    systemctl restart ospfd.service
    
    RHEL 8.x:

    In order to start at boot time the FRR after the network is up, we did the following adaptions. First copy /usr/lib/systemd/system/frr.service to /etc/systemd/system/frr.service. Then, change the copied frr.services file. Here is the output of the diff command of both files (after the adaptions) in order to allow you to redo the changes in your copied frr.services file:

    diff /usr/lib/systemd/system/frr.service /etc/systemd/system/frr.service
    4,5c4,6
    < After=network-pre.target systemd-sysctl.service
    < Before=network.target
    ---
    > #After=network-pre.target systemd-sysctl.service
    > #Before=network.target
    > After=network-online.target
    

    Restart the FRR service.

Very Important Note: NFSv4 client for Linux on IBM Z or Linux on System x is not recommended in a high availability setup with a z/OS NFS server movable between LPARs.

Read SAP Note 2099374 for further information.