4 ms·
I'm not sure why systemD is needed for restarting a process what about a simple loop with an if statement? Process isolation to run a go binary on a presumably
by soheil 6y ago
I'm not sure why systemD is needed for restarting a process what about a simple loop with an if statement? Process isolation to run a go binary on a presumably dedicated web server? Privileged sockets, not even sure what those might be.
The point of this post is to not complicate things, but what I hear is even more complicated be it via a docker alternative.
- bostonsre 6y agoSystemd config files are fairly simple and straightforward. It gives a simple interface to start/stop/restart processes and lets you do things like automatically start a process on server boot.
- CameronNemo 6y agosystemd unit files are cleaner than some init scripts, but they only have one implementation, which works on one libc and one kernel. uf.
- yjftsjthsd-h 6y ago> only have one implementation, which works on one libc and one kernel I agree overall, but apparently systemd supports musl. No clue why or who uses it, but it's a thing.
- CameronNemo 6y agoNot according to several people who maintain patches outside of systemd explicitly for musl compatibility. Did this change recently? Last I heard, systemd maintainers explicitly rejected attempts to support alternate libc implementations.
- viraptor 6y ago> I'm not sure why systemD is needed for restarting a process what about a simple loop with an if statement? It's not needed, but that's why a lot of older apps have their very custom solution to deal with that issue. (For example MySQL) Each with their custom exit condition handling, cleanup, backoff, etc. A simple loop also won't cleanup processes forked from the main server. This 1kLoC script https://github.com/mysql/mysql-server/blob/8.0/scripts/mysqld_safe.sh https://github.com/mysql/mysql-server/blob/8.0/scripts/mysql... can be almost entirely replaced with a few lines of systemd.service config. (with fairly logical names for each setting) Now we can replace those with "Restart=always". If you want to be fancy, you could even add a watchdog. > Process isolation to run a go binary on a presumably dedicated web server? 1. "presumably" 2. Apparently a web server which gets SSH sessions from devs - nice place to check for forwarded keys or collect passwords. > Privileged sockets, not even sure what those might be. Ports below 1024 (or whatever your local threshold is) > but what I hear is even more complicated It really isn't. Just unfamiliar to you.
- jfoutz 6y agoif you go down the Restart=always route, please take a long look at StartLimitIntervalSec, RestartSec, StartLimitBurst. in some failure modes always isn't quite always always.
- soheil 6y agoYeah it really is complicated, probably just very familiar to you. I Google systemD the first result has 160 sections just in the documentation table of contents alone [0]. [0] https://www.freedesktop.org/wiki/Software/systemd/ https://www.freedesktop.org/wiki/Software/systemd/
- viraptor 6y agoThe linked page is not a documentation ToC. Why would you claim that? For day to day usage there are two man pages which should be enough for reference: https://www.freedesktop.org/software/systemd/man/systemd.exec.html https://www.freedesktop.org/software/systemd/man/systemd.exe... and https://www.freedesktop.org/software/systemd/man/systemd.service.html https://www.freedesktop.org/software/systemd/man/systemd.ser... Or you could start with one of the blog posts linked in the page you referenced.
- SSLy 6y agoBy his peculiar capitalization you can tell he's a hater that still hasn't come to terms with it, 10 years later.
- soheil 6y agoUsing camel case means I'm a hater?
- CameronNemo 6y agoOr is tired of systemd being auto corrected to systems.
- soheil 6y ago
- gary_0 6y ago> I'm not sure why systemD is needed for restarting a process You need a systemd unit file that starts your daemon properly when the server boots anyways (most common distros use systemd for init), and it's only a few more lines to make sure it gets restarted if it dies.