Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#60506 - [matrix-appservice-irc] add a systemd service file
Attached to Project:
Community Packages
Opened by Damjan Georgievski (damjan) - Saturday, 20 October 2018, 15:47 GMT
Last edited by David Runge (dvzrv) - Tuesday, 17 March 2020, 17:25 GMT
Opened by Damjan Georgievski (damjan) - Saturday, 20 October 2018, 15:47 GMT
Last edited by David Runge (dvzrv) - Tuesday, 17 March 2020, 17:25 GMT
|
Detailsit would be nice of the package would come out of the box with a .service file. This is the current one I use:
[Unit] After=network.target Description=Matrix IRC gateway appservice [Service] Type=simple DynamicUser=yes Restart=always ExecStart=/usr/bin/matrix-appservice-irc -c /etc/synapse/appservice-irc-config.yaml -f /etc/synapse/appservice-irc-registration.yaml -p 9009 LogsDirectory=matrix-irc StateDirectory=matrix-irc IPAccounting=on [Install] WantedBy=synapse.service |
This task depends upon
Closed by David Runge (dvzrv)
Tuesday, 17 March 2020, 17:25 GMT
Reason for closing: Implemented
Additional comments about closing: Added service file in 0.16.0-1
Tuesday, 17 March 2020, 17:25 GMT
Reason for closing: Implemented
Additional comments about closing: Added service file in 0.16.0-1
That being said, we could still provide a default with a list of hardening bits enabled.
```
[Unit]
Description=Matrix IRC Bridge
After=network.target synapse.service
[Service]
Type=simple
User=synapse
Group=synapse
ExecStart=/usr/bin/matrix-appservice-irc -c /etc/synapse/irc.config.yaml -f /etc/synapse/irc.registration.yaml -p 9999
Restart=on-failure
[Install]
WantedBy=multi-user.target
```
Hardening would be required. ExecStart is likely to be overridden by user as stated above.
Ex:
[Unit]
Description=Matrix IRC Bridge
After=network.target synapse.service
[Service]
Type=simple
User=synapse
Group=synapse
WorkingDirectory=/usr/lib/node_modules/matrix-appservice-irc/
ExecStart=/usr/bin/matrix-appservice-irc -c /etc/synapse/matrix-appservice-irc/config-%i.yaml \
-f /etc/synapse/matrix-appservice-irc/registration-%i.yaml
Restart=on-failure
[Install]
WantedBy=multi-user.target
@bobpaul and @damjan: I've just pushed matrix-appservice-irc 0.16.0 to [community-testing]. Please give it a spin.
Note: I've removed a lot of clutter from the package (and I hope I didn't accidentally break anything). I currently sadly have no setup to test this with, so it would be very awesome, if you could report back on any issues you might have!
Make sure to backup any configuration files/services files you are currently using before running the service!
matrix-appservice-irc is now run as its own user/group. The configuration files are installed 0640 to /etc/matrix-appservice-irc/ and I've added many hardening options to the service file.
Please report back on any problems, that you run into with the service or the package itself!
Last, but not least: I have not added synapse.service to After=, as there is the use-case of running the bridge on a host, that is not running synapse. If you require it, you can of course add it in an override.
I don't mind that, although After=synapse.service only has any effect if both services *are* enqueued to start on the same host. Otherwise it's a noop (in other words, After/Before only specifies ordering, not dependencies).
I'll test the package soon.
Oh, you are right! Didn't think clearly. Definitely worth adding back...
Thanks for the feedback!
I've pushed a new version to [community-testing] (also with small changes to the service). Please try again!
btw, why did you add CapabilityBoundingSet=CAP_NET_BIND_SERVICE ?
That doesn't add a capability (if you had that in mind) - and since it's a non-root user it doesn't have any capabilities. you maybe wanted to use AmbientCapabilities=
It can be removed altogether.
Thanks again for all the great feedback!