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:
- Adapt start-dependency of
autofsservice:cp /usr/lib/systemd/system/autofs.service /etc/systemd/system chmod 664 /etc/systemd/system/autofs.serviceIn
/etc/systemd/system/autofs.service,change from:- SLES 12.x:
-
After=network.target remote-fs.target nss-lookup.target nss-user-lookup.targetto:
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.serviceto:
After=network.target ypbind.service sssd.service network-online.target remote-fs.target rpc-statd.service rpcbind.service frr.serviceThen, check with command:
systemd-delta systemd/system.
- 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.shscript, which is part of thezSAP_BusinessContinuity<nn>.zippackage. ThetestNFS.shscript waits up to three minutes until the NFS server VIPA can be pinged. Copy thetestNFS.shscript 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 issapnfsv). You need to execute thattestNFS.shscript beforeautofs.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.targetThen, run
systemctl daemon-reload.Check whether the
beforeafs.serviceis enabled and active (running) with the command:systemctl status beforeafs.service.If
beforeafs.serviceis not enabled or active, then run:systemctl enable beforeafs.service systemctl start beforeafs.serviceAdditionally, in the same way check if
autofs.serviceis enabled and active. - 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.targetThen, run:systemctl daemon-reloadWith the following command, check if the zebra service is enabled and active (running):systemctl status zebra.serviceIf the zebra service is enabled and active (running), then restart the ospfd service:systemctl restart ospfd.serviceIf 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.serviceto/etc/systemd/system/frr.service. Then, change the copiedfrr.servicesfile. 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 copiedfrr.servicesfile: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.targetRestart the FRR service.
Read SAP Note 2099374 for further information.