Systemd services #13
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "systemd"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Here's a start to provide some basic systemd service files. There are a few issues still needing to be addressed, but let's open it up for discussion to see how to address them:
User
: Currently there is no standard matrix/bridge users for synapse or dendrite servers. Some concerns are if there is a common user for both the server and bridges, is there a risk of interfering with each other or any security concerns.line-chrome.target
should wait for whenline-chrome.service
is starting to listen. Currentlyline.service
fails becauseline-chrome.target
is activated too fast. Not sure how to achieve that yet.systemctl start/stop
interact as they're supposed to:line-chrome.service
can be start independentlystart line.service
triggersstart line-chrome.service
restart line.service
does not restartline-chrome.service
: Failsstop line-chrome.service
stopsline.service
restart line-chrome.service
restartsline.service
stop line.service
stopsline-chrome.service
Link to thematrix homeserver
service with similar logic as aboveDiscussion:
line.service
orline-chrome.service
be made into socket? As I understand when we make a socket, it can be automatically started and stopped when required to listen. For theline-chrome
that might be unproductive because it would require to re-login unless the status can be saved in between sessions, but also it would not be able to recieve updates.setup.py
. Are there any standard template formats we can use? I like the ones ingithub.com/smallstep/certificate
line-chrome.service
might have to be aliased, i.e.line-chrome@.service
, and somehow allowed to be controlled byline.service
user viasudoer
.Slight rant:
Currently I don't think there is a stadndard synapse/bridge service infrastructure, and ideally the bridges and plugins should be designed so they can be invoked and editted as something like
matrix-bridges@.service
, but that's a discussion for the core matrix community later on, e.g. if they can provide amatrix-server.target
that we can later link to add dependencies and so on.Thanks for this!
Some comments:
User
: it's probably enough to have a commented-outUser
(as you already did) to not break default installs, while still suggesting the best-practice of running with a system user.line-chrome.service
, maybeline.service
can just useRestart=always
to make it keep trying to connect to the socket until it succeeds. Or better yet, the Python module itself can poll for a socket connection instead of erroring out on first failure.That would indeed be preferred. A n time retry with a few seconds time-out should do. If possible I would prefer to avoid
Restart=always
because it might hide some underlying errors down the line.Agree, would be nice to have something standardized from the matrix dev team, but until then it is not necessary. Also it should be able to be run with external server in the future like via
Dimension
or the other pluggable method, so I steadily come to think that it is uneccessary, at least for bridges and such.If node could manage that it would be ideal. One problem with using systemd socket is that it has to be fast to start and persistent. Probably the only place it makes sense to have is on the
line.service
, but the effect there would be minimal?Also how about the locations? It would be easy to create these from a template when setting up the database.
Should check github.com/matrix-org/synapse#9803 for seucrity hardening tips and tools like
systemd-analyze security
from this blogUpdate: with this change,
line-chrome
is active only when the initialization is finished by node.There might be a depandancy on
systemd
is there any check to see if it still works without it? Maybe thesd.notify
will just send commands to the void so it might still work.9c09285045
toea56f82f51
WIP: Systemd servicesto Systemd servicesRuntimeDirectory
for sockets 9d4f2dafacThe only other options to set are setting
Restart
options, which I don't know if it should be added atm or later, and hardening the service files, which is quite a slog to do. Will make a separate file in this branch afterwards.Should be ok to merge like this, but check the
yarn
settings on your end as well.RuntimeDirectory
for sockets 91885245f1968832545e
to9d4f2dafac
9d4f2dafac
to3c0dd15616
Merged to new
systemd
branch.Pull request closed