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

salt-bootstrap.sh [...] git v2014.1.11 on SmartOS base64 is broken #473

Closed
s1kbr0 opened this Issue Oct 3, 2014 · 7 comments

Comments

Projects
None yet
4 participants
@s1kbr0

s1kbr0 commented Oct 3, 2014

Reproduce

on SmartOS base64 14.2.0,

wget -O bootstrap-salt.sh bootstrap.saltstack.org

sh bootstrap-salt.sh git v2014.1.11

Error:

 * ERROR: salt-minion was not found running
 * ERROR: Failed to run daemons_running()!!!
 * ERROR: salt-minion was not found running. Pass '-D' to bootstrap-salt.sh when bootstrapping for additional debugging information...

Problem #1

bootstrap-salt.sh places Salt configuration in /etc/salt, the illumos SMF manifest salt-minion put in place by bootstrap-salt.sh expects the Salt configuration to reside in /opt/local/etc/salt

svccfg export salt-minion | grep -i etc
      <service_fmri value='file:///opt/local/etc/salt/minion'/>                                                                                                                               
      <propval name='config_dir' type='astring' value='/opt/local/etc/salt'/>                                                                                                                 
      <propval name='config_file' type='astring' value='/opt/local/etc/salt/minion'/> 

Fix #1

bootstrap-salt.sh should place Salt configuration in /opt/saltstack. Only the SmartOS base64 dataset files should be in /etc/ and /opt/local should be used only by pkgsrc which already has a Salt package ; see http://wiki.smartos.org/display/DOC/Working+with+Packages

Problem #2

py27-apache-libcloud is missing.

Fix #2

Add pkgin in py27-apache-libcloud

Problem #3

SMF salt-minion fails to start because required PATH= is missing.

Fix #3

Insert PATH= inside <method_context> in SMF for salt-minion and also SMF for salt-master

    <method_context>
      <method_environment>
        <envvar name='PATH' value='/usr/local/sbin:/usr/local/bin:/opt/local/sbin:/opt/local/bin:/usr/sbin:/usr/bin:/sbin'/>
      </method_environment>
    </method_context>
    <exec_method name='start' type='method' exec='/opt/local/bin/salt-minion -c %{config_dir}' timeout_seconds='60'/>
@kevpie

This comment has been minimized.

kevpie commented Jan 29, 2015

Using the latest develop 2015.2.0-299-g28b584a (Lithium) on SmartOS base64 14.3.0
The following problems to add to the above mix.

Problem 4

SmartOS sh doesn't seem to provide local.

install_salt.sh[1143]: local: not found [No such file or directory]
install_salt.sh[1145]: local: not found [No such file or directory]

Fix 4

Execute script using bash.
sudo bash install_salt.sh -D git develop works.

Problem 5

Git cleanup leaves behind empty /tmp/git/salt folder preventing further git installs.
Possibly needs a more robust clone, haven't investigated.

fatal: Not a git repository (or any parent up to mount point /tmp)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

Clean up
* DEBUG: Cleaning up the Salt Temporary Git Repository

Fix 5

delete /tmp/git/salt before attempting install using git

@BretFisher

This comment has been minimized.

Contributor

BretFisher commented Apr 14, 2015

Maybe if we break these out one at a time, fixes will happen faster. I've put in a issue for Problem 1, which is actually a salt repo issue, not bootstrap.

saltstack/salt#22634

@BretFisher

This comment has been minimized.

Contributor

BretFisher commented Jun 24, 2015

I can't replicate Problem 4 above on multiple fresh server attempts, so I won't try a fix for that. @kevpie can you reproduce with current version of salt-bootstrap.sh?

@kevpie

This comment has been minimized.

kevpie commented Jun 26, 2015

@BretFisher Using base-64-lts 14.4.2 sh now installs, but salt exits with an error

[root@c4ddec59-8b4a-c24f-a456-cd03bd98f334 ~]# salt --version
Traceback (most recent call last):
  File "/opt/local/bin/salt", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/opt/local/lib/python2.7/site-packages/pkg_resources.py", line 2872, in <module>
    working_set = WorkingSet._build_master()
  File "/opt/local/lib/python2.7/site-packages/pkg_resources.py", line 508, in _build_master
    ws.require(__requires__)
  File "/opt/local/lib/python2.7/site-packages/pkg_resources.py", line 817, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/opt/local/lib/python2.7/site-packages/pkg_resources.py", line 702, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: futures>=2.0

Using the smallest container on joyent's JPC 128m of ram, only allocates 128m of /tmp space.

[root@c4ddec59-8b4a-c24f-a456-cd03bd98f334 ~]# df -h
Filesystem                                  Size  Used Avail Use% Mounted on
zones/c4ddec59-8b4a-c24f-a456-cd03bd98f334  3.5G  677M  2.8G  20% /
/lib                                        263M  239M   24M  92% /lib
/lib/svc/manifest                           6.9T  796K  6.9T   1% /lib/svc/manifest
/usr                                        433M  368M   66M  85% /usr
swap                                        512M  160M  353M  32% /etc/svc/volatile
swap                                        128M  128M  8.0K 100% /tmp
swap                                        512M  160M  353M  32% /var/run

so I was able to run the install using an alter location for the checkout.
BS_SALT_GIT_CHECKOUT_DIR=/opt/salt/git sh bootstrap-salt.sh -D git develop

@s0undt3ch

This comment has been minimized.

Member

s0undt3ch commented Jun 27, 2015

We currently don't do any free-space detection, so what you did is the only real solution for now.

@BretFisher

This comment has been minimized.

Contributor

BretFisher commented Jul 23, 2015

OK I think this "mega bug fix list for SmartOS" is good to close, all fixes have been merged. I can now successfully use the one-liner install on a fresh SmartOS box to install, and also upgrade, git-based versions of Salt (2015.5 and newer):

@s0undt3ch

This comment has been minimized.

Member

s0undt3ch commented Jul 24, 2015

Awesome! Closing.

@s0undt3ch s0undt3ch closed this Jul 24, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment