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

/tmp/install-chef.sh called with -c but lacks #!/bin/sh #494

Open
hh opened this issue Feb 1, 2016 · 0 comments · May be fixed by #495
Open

/tmp/install-chef.sh called with -c but lacks #!/bin/sh #494

hh opened this issue Feb 1, 2016 · 0 comments · May be fixed by #495

Comments

@hh
Copy link
Contributor

hh commented Feb 1, 2016

During the laydown of /tmp/chef-install.sh, the file doesn't contain the requisite #!/path/to/interpreter and we call sh -c /tmp/chef-install.sh.

This results in an exit code of 126, due to chef-install.sh not being a valid stand alone command.

We either need to update the content of chef-install.sh (in mixlib-installer?), or call the sh script directly as input to sh rather than attempting to call an invalid script.

[2016-02-01T09:56:34-05:00] INFO: Completed stat -c '%a %U %G %n' /tmp/chef-install.sh on [email protected]: exit status 0
[2016-02-01T09:56:34-05:00] INFO: Executing sudo chmod 755 /tmp/chef-install.sh on [email protected]
[2016-02-01T09:56:34-05:00] INFO: Completed chmod 755 /tmp/chef-install.sh on [email protected]: exit status 0
    - [awsusw2-test] change mode of /tmp/chef-install.sh on awsusw2-test from 0 to 755
[2016-02-01T09:56:34-05:00] INFO: Executing sudo sh -c /tmp/chef-install.sh on [email protected]
[2016-02-01T09:56:34-05:00] INFO: Completed chmod 755 /tmp/chef-install.sh on [email protected]: exit status 0
[2016-02-01T09:56:35-05:00] INFO: Completed sh -c /tmp/chef-install.sh on [email protected]: exit status 126

To verify the chef-install.sh manually:

ec2-user@ip-10-113-68-9:/tmp$ sh -c /tmp/chef-install.sh
sh: 1: /tmp/chef-install.sh: Permission denied
ec2-user@ip-10-113-68-9:/tmp$ echo $?
126
ec2-user@ip-10-113-68-9:/tmp$ ls -la /tmp/chef-install.sh 
-rwxr-xr-x 1 ec2-user ec2-user 5270 Feb  1 14:56 /tmp/chef-install.sh
ec2-user@ip-10-113-68-9:/tmp$ id
uid=1000(ec2-user) gid=1000(ec2-user) groups=1000(ec2-user),4(adm),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),102(netdev)

As a simple fix, I suggest removing -c from the sh command so that the content is interpreted as sh.

ec2-user@ip-10-113-68-9:/tmp$ sh /tmp/chef-install.sh 
-----> Chef Omnibus installation detected (11.16.4)
@hh hh linked a pull request Feb 1, 2016 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant