ogom / cookbook-gitlab

Chef's Cookbook for GitLab
33 stars 15 forks source link

Error in gitlab recipe #9

Closed schlamar closed 11 years ago

schlamar commented 11 years ago
================================================================================
Error executing action `start` on resource 'service[gitlab]'
================================================================================

Errno::ENOENT
-------------
No such file or directory - /etc/init.d/gitlab start

Resource Declaration:
---------------------
# In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/gitlab/recipes/gitlab.rb

211: service "gitlab" do
212:   supports :start => true, :stop => true, :restart => true, :status => true
213:   action :enable
214: end
215:

Compiled Resource:
------------------
# Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/gitlab/recipes/gitlab.rb:211:in `from_file'

service("gitlab") do
  action [:enable]
  updated true
  supports {:start=>true, :stop=>true, :restart=>true, :status=>true}
  retries 0
  retry_delay 2
  service_name "gitlab"
  enabled true
  pattern "gitlab"
  startup_type :automatic
  cookbook_name :gitlab
  recipe_name "gitlab"
end
schlamar commented 11 years ago

The file actually exists and sudo /etc/init.d/gitlab start just works...

ogom commented 11 years ago

Platform Ubuntu or CentOS ?

schlamar commented 11 years ago

Ubuntu

ogom commented 11 years ago

vagrant destroy and vagrant up, but is not an error.

schlamar commented 11 years ago

Doesn't help. BTW, creating the service and looks good:

[2013-09-06T07:04:01+00:00] INFO: template[/etc/init.d/gitlab] created file /etc/init.d/gitlab
[2013-09-06T07:04:01+00:00] INFO: template[/etc/init.d/gitlab] updated file contents /etc/init.d/gitlab
[2013-09-06T07:04:01+00:00] INFO: template[/etc/init.d/gitlab] mode changed to 755
[2013-09-06T07:04:01+00:00] INFO: service[gitlab] enabled
[2013-09-06T07:04:01+00:00] INFO: file[/home/git/.gitlab_start] created file /home/git/.gitlab_start
[2013-09-06T07:04:01+00:00] INFO: file[/home/git/.gitlab_start] owner changed to 1000
[2013-09-06T07:04:01+00:00] INFO: file[/home/git/.gitlab_start] group changed to 1001
...
[2013-09-06T07:04:07+00:00] INFO: template[/etc/postfix/main.cf] sending restart action to service[postfix] (delayed)
[2013-09-06T07:04:10+00:00] INFO: service[postfix] restarted
[2013-09-06T07:04:10+00:00] INFO: file[/home/git/.gitlab_start] sending start action to service[gitlab] (delayed)
schlamar commented 11 years ago

What's the reason for .gitlab_start file anyway?

schlamar commented 11 years ago
vagrant@vm-gitlab:~$ ls /etc/init.d/gitlab
/etc/init.d/gitlab
vagrant@vm-gitlab:~$ service gitlab start
env: /etc/init.d/gitlab: No such file or directory
schlamar commented 11 years ago

Oh man. initd.erb has Windows line endings. http://www.linuxquestions.org/questions/ubuntu-63/error-env-etc-init-d-snortd-no-such-file-or-directory-trying-to-start-service-922358/

schlamar commented 11 years ago

Looks like some tool set git autocrlf to true. Sorry for the noise.