-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add gunicorn and uwsgi to init files
- Loading branch information
Showing
24 changed files
with
65 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[uwsgi] | ||
uid = st2 | ||
gid = st2 | ||
chmod-socket = 644 | ||
processes = 1 | ||
socket = /run/st2auth.sock | ||
threads = 10 | ||
vacuum = true | ||
wsgi-file = /usr/share/python/st2auth/lib/python2.7/site-packages/st2auth/wsgi.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
conf/uwsgi/st2auth.ini etc/uwsgi.d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[uwsgi] | ||
uid = st2 | ||
gid = st2 | ||
chmod-socket = 644 | ||
chown-socket = www-data:www-data | ||
processes = 1 | ||
socket = /run/st2auth.sock | ||
threads = 10 | ||
vacuum = true | ||
wsgi-file = /usr/share/python/st2/lib/python2.7/site-packages/st2auth/wsgi.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d8c29d8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @enykeev https://stackstorm.slack.com/archives/stackstorm/p1453377793029078 :)
That packaging stuff is really ...
awesome.
So same for me, once I dig into one thing, I need to read about another thing and then it goes to third thing I need to google/learn as fast as it possible, resulting 50+ opened tabs with no progress really.
The barrier to entry is not low if "doing things right", not doing dirty hacks here and there.
I'll probably need kind of 12 hours non-stop nirvana for several days in a row to dig into details: layer after layer, instead of trying to do something really quick (assuming several hours of time I currently have).
So hm, just 👍 to @dennybaa perseverance for learning all the packaging stuff, doing it right and understanding low-level alchemy.
Working on digging into these things too, tried different ways, sharing some thoughts.
For the moment several arguable & worrying things probably we'll need to resolve:
www-data:www-data
user verification and creationnginx:nginx
and relying onnginx
only is not flexibletouch $(DESTDIR)/var/run/st2auth.sock
and%attr(644, nginx, nginx) %{_localstatedir}/run/st2auth.sock
shouldn't be part of packaging logic, since socket should appear only by and only when service starts. Also,/run
and/var/run
doesn't persist across reboots./run
and/var/run
doesn't looks easy for non-privileged processes, since it's usually directory for root processes. Rather then creating socket as you already do before dropping privileges, - another point would be to save it in "app" directory. For example is/opt/stackstorm
an option? Or maybe/var/lib/st2
for sockets, I don't know, thinking about easy/standard solutions.There is some additional good info I found that helps in understanding the inner details:
RuntimeDirectory
mention for systemd. Also: http://uwsgi-docs.readthedocs.org/en/latest/Systemd.html#putting-sockets-in-run But that's only forsystemd
.d8c29d8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't matter, the file is a %ghost. Now that I think about it, we should probably remove
%attr
since it achieves nothing.Frankly, at that point I want to make something, anything that works end to end. Then, once we have it, we can tweak it as long as we like. Full disclosure, I have no idea what "standard" means in that context, I'm like this boy from the joke: "I'm not the real welder, just found the mask on construction site".