5

In case when a process specified in /etc/inittab crashes init says:

INIT: Id "x1" respawning too fast: disabled for 5 minutes

Why is it doing it? What can be done during these 5 minutes if crash happens at boot? And even if it doesn't happen at boot, why pausing an action? Is it supposed to save resources?

2 Answers2

3

Because a process that dies (crashes, presumably) soon after starting is broken, and has to be fixed. Wasting resources on it makes no sense (and the crashing process could do damage, like leaving mangled files behind).

vonbrand
  • 18,253
  • ok, but why does init pause it for 5 minutes instead of aborting bootup? What can a user do in 5 minutes if the machine does not boot? – user1042840 Jan 24 '16 at 00:27
  • @user1042840 init(8) is just a dumb program, it doesn't care if the crashed program is critical for boot. Besides, if it did care, unless it somehow could fill in for the missing piece, the boot fails anyway. – vonbrand Jan 24 '16 at 00:38
  • 2
    @user1042840 If init aborted bootup, what then? Should it power off the machine? Should it reboot… and have the sequence repeat over and over? – Gilles 'SO- stop being evil' Jan 24 '16 at 22:58
2

Processes started by init are generally supposed to be long-lived daemons, that only restart when their configuration has been changed or when they've been upgraded, or login programs that restart when a console user logs out. If a process started by init is exiting (and being respawned by init) very fast, that indicates that something is going wrong, typically that the program is misconfigured and crashes during its startup sequence. This isn't a mathematical certainty, but it's a good heuristic.

Rather than permanently spend resources to keep launching a program that doesn't do anything useful, init stops after a while and gives a bit of time for the administrator time to repair the system, or for a subsystem that the program depends on to become online.