4 ms·
Units are not simple. I spent several hours to find out the proper combination of arcanes to run uwsgi and systemd. Same with gunicorn. Turns out you need to f
by sametmax 10y ago
Units are not simple. I spent several hours to find out the proper combination of arcanes to run uwsgi and systemd. Same with gunicorn.
Turns out you need to figure out After, KillSignal, pidfile, and some options in uwsgi configuration itself. Oh, and "Type=simple" doesn't work, you need forking.
And this is poorly documented, it's hard to find materials en the web to help you and you are reduced to make many trial and errors with systemd itself giving you few clues of what's going wrong.
It's, however, easier that bash scripts, so it's an improvement.
- pmontra 10y agoSeconded. I had to do trial and error several times to understand why systemd didn't start the programs I could start with the same arguments on the command line. The documentation is not that bad but declaring with configuration what you programmed with a script has some limits. Basically you have to learn another language on the top of the scripting one that you still have to use in other parts of the system. Nevertheless I found that past that point it's easier to read a short configuration file than a long init script. I didn't run in big problems so far, but that systemctl reenable is wierd. Why can't it figure it out by itself?
- samtoday 10y ago> Oh, and "Type=simple" doesn't work, you need forking. Why would you not use type=simple?
- sametmax 10y agoI don't know. I just know If I do, wsgi doesn't start.
- minitech 10y agoIt is extremely well documented in `man systemd.service` and `man systemd.unit`. Read the option descriptions in the section pertaining to what you want to do of each, look at the examples, and you should be good to go.
- sametmax 10y agoAnytime somebody mention a man file as "good documentation", I feel the same as somebody pointing assembly code as "easy to understand". The simple medium make it not "easy". Yes, it's great to have a good man file if you have nothing else, just like it's nice to have a wooden wheel if you don't have a rubber tire, but come on.
- minitech 10y agoDid I say it was good documentation because it was in a simple format? No. It’s good documentation because it’s thorough, well-organized, and comes with lots of examples. That it’s a man page has nothing to do with it (except for the convenience of getting `man systemd.<tab>` autocomplete).
- JdeBP 10y agoActually, it's fairly mediocre doco; and manual pages are reference doco, not tutorials or user guides. That said, two of us have already pointed out in this discussion where other doco exists for the subject at hand, outwith reference manual pages.
- ChoHag 10y agoIf you get rid of all the shite people like to stuff in them, even sysv-style init scripts can be short and readable.
- digi_owl 10y agoAs seen over at BSD...
- justinsaccount 10y ago> Turns out you need to figure out After, KillSignal, pidfile, and some options in uwsgi configuration itself. Oh, and "Type=simple" doesn't work, you need forking. You could have also just copy/pasted the examples from the uwsgi documentation. http://uwsgi-docs.readthedocs.io/en/latest/Systemd.html http://uwsgi-docs.readthedocs.io/en/latest/Systemd.html
- JdeBP 10y agoForking is wrong, and there most definitely are materials on the WWW about this. * http://unix.stackexchange.com/a/242860/5132 http://unix.stackexchange.com/a/242860/5132
- viraptor 10y agoBoth uwsgi and gunicorn can run with type simple. Actually it's easier if they do, because you don't need pidfiles anymore. But this is not systemd specific. You need to understand the difference in behaviour, regardless which init you're using. In sysv using the wrong type basically means you're blocking the startup. Not understanding how the daemon forking works is not the same as systemd being complicated.
- sametmax 10y agoHaving to understand the whole system just to start a command is being complicated.
- viraptor 10y agoHow do you imagine it working otherwise? You have to understand the difference between forking and simple type even if you start commands in your shell. Otherwise you'll end up saying "this command doesn't even work, I run it and nothing happens". This is basic knowledge. It's a "you must be this tall to run services on Linux" benchmark.