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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

export supervisord: Improve process numbering #113

Closed

Conversation

msabramo
Copy link
Collaborator

More consistent with Foreman (see #109).

  1. Make numbering 1-based instead of 0-based.
  2. Include number in program name.

I also moved the append of num to full_name from the Python code to the template. I think that this is better, because it will allow folks to control whether or not it gets appended using a custom template (which is hopefully coming soon... 馃槃) (see issue #88; PR coming soon...)

Example:
[marca@marca-mac2 export_test]$ honcho export supervisord .
[marca@marca-mac2 export_test]$ cat export_test.conf
[program:export_test-ansvc-1]
command=/bin/sh -c 'bin/ansvc start'
autostart=true
autorestart=true
stopsignal=QUIT
stdout_logfile=/var/log/export_test/ansvc-1.log
stderr_logfile=/var/log/export_test/ansvc-1.error.log
user=marca
directory=/Users/marca/dev/git-repos/honcho/export_test
environment=PORT="5000"

[group:export_test]
programs=export_test-ansvc-1

We are getting closer to making honcho's output match foreman.

[marca@marca-mac2 export_test]$ ~/dev/git-repos/foreman/bin/foreman export -a export_test supervisord . && mv export_test.conf foreman.conf
[foreman export] writing: export_test.conf
[marca@marca-mac2 export_test]$ honcho export supervisord . && mv export_test.conf honcho.conf
[marca@marca-mac2 export_test]$ diff -u foreman.conf honcho.conf
diff --git a/foreman.conf b/honcho.conf
index 869012e..9371eae 100644
--- a/foreman.conf
+++ b/honcho.conf
@@ -1,11 +1,11 @@
 [program:export_test-ansvc-1]
-command=bin/ansvc start
+command=/bin/sh -c 'bin/ansvc start'
 autostart=true
 autorestart=true
 stopsignal=QUIT
 stdout_logfile=/var/log/export_test/ansvc-1.log
 stderr_logfile=/var/log/export_test/ansvc-1.error.log
-user=export_test
+user=marca
 directory=/Users/marca/dev/git-repos/honcho/export_test
 environment=PORT="5000"

The command discrepancy is handled by PR #110.
The user discrepancy is handled by PR #111.
Then we will have handled all of the differences mentioned in issue #109.

More consistent with Foreman (see nickstenning#109).

1. Make numbering 1-based instead of 0-based.
2. Include number in program name.

I also moved the append of `num` to `full_name` from the Python code to
the template. I think that this is better, because it will allow folks
to control whether or not it gets appended using a custom template
(which is hopefully coming soon... 馃槃)
@msabramo
Copy link
Collaborator Author

Rebased to fix merge conflict.

@msabramo
Copy link
Collaborator Author

msabramo commented Dec 1, 2014

@nickstenning, @slafs: How does this look?

@slafs
Copy link
Collaborator

slafs commented Dec 1, 2014

Looks OK. BTW is there any significant advantage in using multiple program sections over using numprocs=n option?

@nickstenning
Copy link
Owner

We can't use numprocs=n because of the rotation of the PORT environment variable.

And you really need to look at #119 first, otherwise all of these are going to be for nothing.

@slafs
Copy link
Collaborator

slafs commented Dec 1, 2014

Ah. Of course!

@msabramo
Copy link
Collaborator Author

msabramo commented Dec 4, 2014

We can close this if we merge #119, as I just checked that #119 is using 1-based numbering already.

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

Successfully merging this pull request may close these issues.

None yet

3 participants