# File lib/daemons/application.rb, line 170
    def start_load
      unless options[:ontop]
        Daemonize.daemonize(output_logfile, @group.app_name)
      else
        Daemonize.simulate(output_logfile)
      end

      @pid.pid = Process.pid

      # We need this to remove the pid-file if the applications exits by itself.
      # Note that <tt>at_exit</tt> will only be run if the applications exits by calling
      # <tt>exit</tt>, and not if it calls <tt>exit!</tt> (so please don't call <tt>exit!</tt>
      # in your application!
      #
      at_exit do
        begin; @pid.cleanup; rescue ::Exception; end

        # If the option <tt>:backtrace</tt> is used and the application did exit by itself
        # create a exception log.
        if options[:backtrace] && !options[:ontop] && !$daemons_sigterm
          begin; exception_log; rescue ::Exception; end
        end

      end

      # This part is needed to remove the pid-file if the application is killed by
      # daemons or manually by the user.
      # Note that the applications is not supposed to overwrite the signal handler for
      # 'TERM'.
      #
      $daemons_stop_proc = options[:stop_proc]
      trap(SIGNAL) do
        begin
          if $daemons_stop_proc
            $daemons_stop_proc.call
          end
          rescue ::Exception
        end

        begin; @pid.cleanup; rescue ::Exception; end
        $daemons_sigterm = true

        if options[:hard_exit]
          exit!
        else
          exit
        end
      end

      # Now we really start the script...
      $DAEMONS_ARGV = @controller_argv
      ENV['DAEMONS_ARGV'] = @controller_argv.join(' ')

      ARGV.clear
      ARGV.concat @app_argv if @app_argv

      started
      # TODO: exception logging
      load script
    end