We develop a Linux application to work on different RedHat/SUSE distributions. This application (namely, daemon) is expected to be automatically run at startup so we place our startup script in /etc/init.d/ directory and create symlinks in runlevel directories (../rc.d/rc5.d/, for instance). If a user removes our application, our uninstall script removes all our stuff including symlinks. It works fine if OS doesn't provide parallel script running. If parallel running is enabled, we need another solution. For instance, in SLES 10, we have in /etc/sysconfig/boot:

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


As far as we understand, we have to register our script with insserv utility. In this case, the system analyzes a script header and creates/removes symlinks on it's own. If it's true, how to organize installation/uninstallation of our application to cover both parallel and sequential startup script running? It looks like we should behave differently when parallel running is disabled or enabled. In first case, we should care about symlinks ourselves. In second case, we should delegate it to insserv. Is this right approach? If it's true, should we analyze whether parallel running is enabled by checking /etc/sysconfig/boot? It looks unreliable because in different Linux distributionsit could be different location and different parameter.

What's the best practice for installation/uninstallation Linux application that covers both parallel and sequential system startup?



let insserv create the symlinks for you. when using insserv, you can also add dependencies to your script header so insserv knows when to start and stop your script in a special runlevel. this is necessary for sequential and parallel execution. try to be compatible to lsb. here is a short example:

# Following lines are in conformance with LSB 1.2 spec
# Provides:            your shoort app name here
# Required-Start:      what should start before your app, e.g. network
# Required-Stop:       what should stop before your app stops
# Default-Start:       2 3 4 5
# Default-Stop:        0 1 6
# Description:         longer about 
| improve this answer | |
  • 1
    Yes, it's clear but should I analyze whether run_parallel is enabled? Or should I use insserv in both cases (parallel and sequential execution)? – user31462 Jan 12 '10 at 12:05
  • IIRC, rpm runs insserv for you on package install. – Tobu Jan 12 '10 at 13:21
  • use insserv for both modes. – Christian Jan 12 '10 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.