Ticket #738 (closed enhancement: fixed)
systemd support
| Reported by: | vmiklos@… | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | BitlBee | Version: | 3.0.1 |
| Keywords: | Cc: | ||
| IRC client+version: | Client-independent | Operating System: | Public server |
| OS version/distro: |
Description
The attached patch enables systemd support in BitlBee. The changes are fully backwards-compatible, the only difference is that when using --systemdsystemunitdir=<something>, systemd files are installed by make install.
See http://0pointer.de/public/systemd-man/daemon.html#id370425
Attachments
Change History
comment:1 Changed 17 months ago by vmiklos@…
Based on commits from #bitlbee and #systemd, here is an updated patch.
Changes:
- sbindir != /usr/sbin is handled
- if no --systemdsystemunitdir is used but the systemd .pc file is there, it's used
- it listens on 127.0.0.1 by default
- no longer runs as root in "inetd-mode"
comment:2 Changed 17 months ago by vmiklos@…
v3: drop '-i 127.0.0.1' in daemon mode since that can be set from bitlbee.conf
Changed 17 months ago by vmiklos@…
-
attachment
0003-systemd-install-systemd-unit-files.patch
added
v3
comment:3 Changed 14 months ago by wilmer
- Status changed from new to closed
- Resolution set to fixed
Sorry for keeping you waiting!
comment:4 Changed 10 months ago by mcepl@…
- Status changed from closed to reopened
- Resolution fixed deleted
Changed 10 months ago by mcepl@…
-
attachment
bitlbee-systemd.patch
added
updated version of the patch
comment:6 follow-up: ↓ 7 Changed 10 months ago by wilmer
Uh? Why 1-process daemon mode instead of ForkDaemon? Not a good idea - although I suppose systemd at least monitors its daemons and restarts them when necessary?
comment:7 in reply to: ↑ 6 Changed 10 months ago by mcepl@…
Replying to wilmer:
Uh? Why 1-process daemon mode instead of ForkDaemon? Not a good idea - although I suppose systemd at least monitors its daemons and restarts them when necessary?
Mostly because of SELinux. We would have to make bitlbee SELinux policy more complicated in ForkDaemon mode. Although I was never persuaded about advantages of ForkDaemon mode anyway. And yes, systemd can be certainly persuaded to start new instances of daemon when one crashes (although I am not sure whether bitlbee is right now configured for that).
comment:8 Changed 10 months ago by mcepl@…
From systemd.service(5):
Restart=
Configures whether the main service process shall be restarted when
it exits. Takes one of no, on-success, on-failure, on-abort or
always. If set to no (the default) the service will not be
restarted when it exits. If set to on-success it will be restarted
only when it exited cleanly, i.e. terminated with an exit code of
0. If set to on-failure it will be restarted only when it exited
with an exit code not equalling 0, or when terminated by a signal.
If set to on-abort it will be restarted only if it exits due to
reception of an uncaught signal. If set to always the service will
be restarted regardless whether it exited cleanly or not, or got
terminated abnormally by a signal.
I guess we want Restart=always, right?
comment:9 Changed 10 months ago by wilmer
- Status changed from reopened to closed
- Resolution set to fixed
That's what you'd want for daemon mode yes.
But I'm definitely not going to accept this patch. ForkDaemon is the supported mode of BitlBee. Although the codebase is fairly stable now and daemon mode should be pretty safe, there are still cases of blocking I/O in BitlBee (especially DNS) that also make it less suitable for serving all users from one process.
I'll leave it up to you what you choose for your packages (but yes, please do enable automatic restarting), but not going to change this upstream..
