Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

service[spark]: unable to locate the init.d script! #1

Open
anishdevasia opened this issue Nov 12, 2014 · 5 comments
Open

service[spark]: unable to locate the init.d script! #1

anishdevasia opened this issue Nov 12, 2014 · 5 comments

Comments

@anishdevasia
Copy link

Hi,

Script throws exception "service[spark]: unable to locate the init.d script!"

is there any way to resolve this.

Regards,
Anish

@gwik
Copy link
Owner

gwik commented Nov 12, 2014

weird. Could you add the complete error log ?
What OS and Chef version do you use ?

If you haven't modified the attributes try run :

sudo -u spark -- sh -c 'cd /opt/local/spark && ./sbin/start-all.sh'

@anishdevasia
Copy link
Author

Complete log for "sudo chef-client" is given below

[2014-11-12T12:55:16+00:00] WARN:
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
SSL validation of HTTPS requests is disabled. HTTPS connections are still
encrypted, but chef is not able to detect forged replies or man in the middle
attacks.

To fix this issue add an entry like this to your configuration file:

  # Verify all HTTPS connections (recommended)
  ssl_verify_mode :verify_peer

  # OR, Verify only connections to chef-server
  verify_api_cert true

To check your SSL configuration, or troubleshoot errors, you can use the
`knife ssl check` command like so:

  knife ssl check -c /etc/chef/client.rb

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Starting Chef Client, version 11.16.4
resolving cookbooks for run list: ["chef-client::config", "spark::master"]
Synchronizing Cookbooks:
  - chef-client
  - cron
  - logrotate
  - chef_handler
  - windows
  - scala
  - spark
  - ark
  - java
  - 7-zip
Compiling Cookbooks...
Converging 32 resources
Recipe: chef-client::config
  * directory[/var/run/chef] action create (up to date)
  * directory[/var/cache/chef] action create (up to date)
  * directory[/var/lib/chef] action create (up to date)
  * directory[/var/log/chef] action create (up to date)
  * directory[/etc/chef] action create (up to date)
  * template[/etc/chef/client.rb] action create (up to date)
  * directory[/etc/chef/client.d] action create (up to date)
  * ruby_block[reload_client_config] action nothing (skipped due to action :noth
ing)
Recipe: java::openjdk
  * package[java-1.6.0-openjdk] action install (up to date)
  * package[java-1.6.0-openjdk-devel] action install (up to date)
  * java_alternatives[set-java-alternatives] action set (up to date)
Recipe: java::set_java_home
  * ruby_block[set-env-java-home] action run
    - execute the ruby block set-env-java-home
  * directory[/etc/profile.d] action create (up to date)
  * file[/etc/profile.d/jdk.sh] action create (up to date)
Recipe: ark::default
  * package[libtool] action install (up to date)
  * package[autoconf] action install (up to date)
  * package[unzip] action install (up to date)
  * package[rsync] action install (up to date)
  * package[make] action install (up to date)
  * package[gcc] action install (up to date)
Recipe: scala::default
  * ark[scala] action install
    * directory[/usr/local/scala-2.11.1] action create (up to date)
    * remote_file[/var/chef/cache/scala-2.11.1.tgz] action create (up to date)
    * execute[unpack /var/chef/cache/scala-2.11.1.tgz] action nothing (skipped d
ue to action :nothing)
    * execute[set owner on /usr/local/scala-2.11.1] action nothing (skipped due
to action :nothing)
    * link[/usr/local/scala] action create (up to date)
    * template[/etc/profile.d/scala.sh] action create (up to date)
    * ruby_block[adding '/usr/local/scala-2.11.1/bin' to chef-client ENV['PATH']
] action run
      - execute the ruby block adding '/usr/local/scala-2.11.1/bin' to chef-clie
nt ENV['PATH']

  * template[/etc/profile.d/scala_home.sh] action create (up to date)
Recipe: spark::default
  * remote_file[/var/chef/cache/spark.tar.gz] action create (up to date)
  * directory[/opt/local] action create (up to date)
  * group[spark] action create (up to date)
  * user[spark] action create (up to date)
  * bash[install_spark] action run (skipped due to not_if)
  * template[spark-env.sh] action create (up to date)
  * directory[/opt/local/spark/.ssh] action create (up to date)
Recipe: spark::master
  * file[/opt/local/spark/.ssh/id_rsa] action create (up to date)
  * file[/opt/local/spark/conf/slaves] action create (up to date)
  * service[spark] action start
    * service[spark]: unable to locate the init.d script!
    ============================================================================
====
    Error executing action `start` on resource 'service[spark]'
    ============================================================================
====

    Chef::Exceptions::Service
    -------------------------
    service[spark]: unable to locate the init.d script!

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/spark/recipes/master.rb

     22: service "spark" do
     23:   start_command <<-BASH
     24:     sudo -u '#{spark_user}' -- sh -c 'cd #{spark_path} && ./sbin/start-
all.sh'
     25:   BASH
     26:   stop_command <<-BASH
     27:     sudo -u '#{spark_user}' -- sh -c 'cd #{spark_path} && ./sbin/stop-a
ll.sh'
     28:   BASH
     29:   action :start
     30: end
     31:

    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/spark/recipes/master.rb:22:in `from_
file'

    service("spark") do
      action [:start]
      supports {:restart=>false, :reload=>false, :status=>true}
      retries 0
      retry_delay 2
      guard_interpreter :default
      service_name "spark"
      pattern "spark"
      start_command "    sudo -u 'spark' -- sh -c 'cd /opt/local/spark && ./sbin
/start-all.sh'\n"
      stop_command "    sudo -u 'spark' -- sh -c 'cd /opt/local/spark && ./sbin/
stop-all.sh'\n"
      cookbook_name "spark"
      recipe_name "master"
    end


Running handlers:
[2014-11-12T12:55:33+00:00] ERROR: Running exception handlers
Running handlers complete
[2014-11-12T12:55:33+00:00] ERROR: Exception handlers complete
[2014-11-12T12:55:33+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-sta
cktrace.out
Chef Client failed. 3 resources updated in 16.462706559 seconds
[2014-11-12T12:55:33+00:00] ERROR: service[spark] (spark::master line 22) had an
 error: Chef::Exceptions::Service: service[spark]: unable to locate the init.d s
cript!
[2014-11-12T12:55:33+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef ru
n process exited unsuccessfully (exit code 1)

@anishdevasia
Copy link
Author

OS : Centos-6.5
chef client : 11.16.4

Using below command on shell works fine and starts master and slaves.

sudo -u spark -- sh -c 'cd /opt/local/spark && ./sbin/start-all.sh'

@gwik
Copy link
Owner

gwik commented Nov 12, 2014

supports {:restart=>false, :reload=>false, :status=>true}
problem may be from here.

try to add

supports {:status => false}

in the service declaration at the end of spark::master.

@gwik
Copy link
Owner

gwik commented Nov 12, 2014

BTW do not run start command on slaves. Master connects via ssh and start them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants