How to install a Linux application in cases when parallel launches of startup scripts are started or disabled?

We are developing a Linux application to work with various RedHat / SUSE distributions. It is expected that this application (namely, the daemon) will automatically start at startup, so we will place our script directory in the / etc / init.d / directory and create symbolic links in the runlevel directories (../rc.d/rc5. d /, for example). If a user uninstalls our application, our uninstallation script removes all our materials, including symbolic links. It works fine if the OS does not provide parallel script start . If parallel launch is enabled, we need a different solution. For example, in SLES 10 we have / etc / sysconfig / boot :

# Run all scripts or rather start/stop all services
# which are independent from each other in parallel.

RUN_PARALLEL="yes"

As far as we know, we need to register our script with the insserv utility . In this case, the system parses the script header and creates / removes symbolic links to its own. If so, how to organize the installation / uninstallation of our application to run a parallel and sequential script run? It looks like we should behave differently when parallel launch is disabled or enabled. In the first case, we must take care of symbolic connections. In the second case, we must delegate it to insserv. Is this the right approach? If this is true, should one analyze whether parallel running is allowed by checking / etc / sysconfig / boot? It looks unreliable because different Linux distributions may have a different location and different options.

/ Linux-, , ?

,

+3
1

chkconfig init RedHat SuSE.

0

Source: https://habr.com/ru/post/1728066/


All Articles