lib/chef/provider/service/debian.rb
# Ancient Debian releases used run levels and priorities to manage dependencies ordering.
# Old syntax no longer works and new syntax does not support priorities. If Chef detects
# ancient update-rc.d it will prefer legacy syntax so priorities can be set correctly in
# case the host is in fact running SysVinit.
#
# Additional context: https://lists.debian.org/debian-devel/2013/05/msg01109.html
Ancient Debian releases used run levels and priorities to manage dependencies ordering.
Old syntax no longer works and new syntax does not support priorities. If Chef detects
ancient update-rc.d it will prefer legacy syntax so priorities can be set correctly in
case the host is in fact running SysVinit.


Ancient Debian releases used run levels and priorities to manage dependencies ordering . Old syntax no longer works and new syntax does not support priorities . If Chef detects ancient update - rc . d it will prefer legacy syntax so priorities can be set correctly in case the host is in fact running SysVinit .
def use_legacy_update_rc_d?
          @sysv_rc_version ||= shell_out!("dpkg-query -W --showformat '${Version}' sysv-rc").stdout.strip
          if @sysv_rc_version.empty?
            logger.trace("sysv-rc package is not installed. update-rc.d will use modern syntax")
            return false
          end
          if @sysv_rc_version.to_f < 2.88
            logger.trace("sysv-rc #{@sysv_rc_version} detected. update-rc.d will use legacy syntax")
            return true
          end
          if @sysv_rc_version.to_f == 2.88 && @sysv_rc_version[8..9].to_i < 42
            logger.trace("sysv-rc #{@sysv_rc_version} detected. update-rc.d will use legacy syntax")
            return true
          end
          false
        end
def use_legacy_update_rc_d? @sysv_rc_version ||= shell_out! ( "dpkg-query -W --showformat '${Version}' sysv-rc" ) . stdout . strip if @sysv_rc_version . empty? logger . trace ( "sysv-rc package is not installed. update-rc.d will use modern syntax" ) return false end if @sysv_rc_version . to_f < 2.88 logger . trace ( "sysv-rc #{@sysv_rc_version} detected. update-rc.d will use legacy syntax" ) return true end if @sysv_rc_version . to_f == 2.88 && @sysv_rc_version [ 8 .. 9 ] . to_i < 42 logger . trace ( "sysv-rc #{@sysv_rc_version} detected. update-rc.d will use legacy syntax" ) return true end false end
Ancient Debian releases used run levels and priorities to manage dependencies ordering.
Ancient Debian releases used run levels and priorities to manage dependencies ordering .
# sysv-rc is not installed therefore we're on modern Debian and legacy syntax does not work # sysv-rc is installed and update-rc.d is old enough to support legacy syntax and features # sysv-rc 2.88dsf-42 drops the legacy syntax # default to modern syntax