<commit_before>define :monit_process, :enable=>false, :process_name=>nil, :pidfile=>nil, :start_cmd=>nil, :stop_cmd=>nil do

  if params[:enable]
    template "/etc/monit/conf.d/#{params[:process_name]}.conf" do
      cookbook 'monit'
      source "service.conf.erb"
      owner "root"
      group "root"
      mode "0755"
      variables(
        :process_name => params[:process_name],
        :pidfile => params[:pidfile],
        :start_cmd => params[:start_cmd], 
        :stop_cmd => params[:stop_cmd]
      )
      action :create
      not_if "test -e /etc/monit/conf.d/#{params[:process_name]}.conf"
      notifies :restart, "service[monit]"
    end
  else
    file "/etc/monit/conf.d/#{params[:process_name]}.conf" do
      backup 0
      action :delete
      only_if "test -e /etc/monit/conf.d/#{params[:process_name]}.conf"
      notifies :restart, "service[monit]"
    end
  end

  service "monit"
end<commit_msg>delaying restart to the end, when services are added<commit_after>define :monit_process, :enable=>false, :process_name=>nil, :pidfile=>nil, :start_cmd=>nil, :stop_cmd=>nil do

  if params[:enable]
    template "/etc/monit/conf.d/#{params[:process_name]}.conf" do
      cookbook 'monit'
      source "service.conf.erb"
      owner "root"
      group "root"
      mode "0755"
      variables(
        :process_name => params[:process_name],
        :pidfile => params[:pidfile],
        :start_cmd => params[:start_cmd], 
        :stop_cmd => params[:stop_cmd]
      )
      action :create
      not_if "test -e /etc/monit/conf.d/#{params[:process_name]}.conf"
      notifies :restart, "service[monit]", :delayed
    end
  else
    file "/etc/monit/conf.d/#{params[:process_name]}.conf" do
      backup 0
      action :delete
      only_if "test -e /etc/monit/conf.d/#{params[:process_name]}.conf"
      notifies :restart, "service[monit]", :delayed
    end
  end

  service "monit"
end
{'fraction_non_alphanumeric': 0.15138816134101624, 'fraction_numerical': 0.005238344683080147, 'mean_word_length': 2.9381443298969074, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1544105', 'n_tokens_mistral': 667, 'n_tokens_neox': 652, 'n_words': 133}