Procd respawn parameters

In the OpenWrt documentation for procd (see https://openwrt.org/docs/guide-developer/procd-init-scripts), the example script for procd respawn is shown as the following.

  # respawn automatically if something died, be careful if you have an alternative process supervisor
  # if process dies sooner than respawn_threshold, it is considered crashed and after 5 retries the service is stopped
  procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5}

Later on the same page, the respawn description is listed as

A series of three consecutive numbers which set the respawn threshold, the respawn timeout and the respawn retry respectively. The timeout specifies the amount of seconds to wait before a service restart attempt, the retry value controls how many restart attempts will be made before a service is considered crashed and the threshold value in seconds controls the time frame in which the restart attempts are counted towards the retry limit. For example a threshold of 300 with a retry value of 10 will cause procd to consider the service to be crashed if the associated UNIX process terminated more than 10 times within a time frame of 5 minutes. No further restart attempts will be made for such crashed services unless an explicit restart is performed. Setting the retry value to 0 will cause procd to try restarting the service indefinitely. The default value for respawn is 3600 5 5.

My question is why the sample init script is specifying the respawn parameters as negative values.

Thanks.

thats not negative... its syntax for if the named variable is not set... then use X number

Thanks. That explains it.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.