Modify

#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 (4)

0001-systemd-install-systemd-unit-files.patch (4.3 KB) - added by vmiklos@… at 2010-12-27T16:25:14Z.
0002-systemd-install-systemd-unit-files.patch (4.9 KB) - added by anonymous at 2010-12-27T19:12:30Z.
0003-systemd-install-systemd-unit-files.patch (4.9 KB) - added by vmiklos@… at 2010-12-27T20:15:51Z.
v3
bitlbee-systemd.patch (411 bytes) - added by mcepl@… at 2011-07-25T17:58:26Z.
updated version of the patch

Download all attachments as: .zip

Change History (13)

comment:1 Changed at 2010-12-27T19:11:54Z 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 at 2010-12-27T20:15:19Z by vmiklos@…

v3: drop '-i 127.0.0.1' in daemon mode since that can be set from bitlbee.conf

comment:3 Changed at 2011-03-18T00:58:26Z by wilmer

Resolution: fixed
Status: newclosed

changeset:devel,770.

Sorry for keeping you waiting!

comment:4 Changed at 2011-07-25T17:57:52Z by mcepl@…

Resolution: fixed
Status: closedreopened

Changed at 2011-07-25T17:58:26Z by mcepl@…

Attachment: bitlbee-systemd.patch added

updated version of the patch

comment:5 Changed at 2011-07-25T20:03:38Z by lkraav <leho@…>

following

comment:6 Changed at 2011-07-27T21:54:49Z 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 at 2011-07-27T23:55:08Z 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 at 2011-07-28T07:51:54Z 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 at 2011-07-28T21:40:48Z by wilmer

Resolution: fixed
Status: reopenedclosed

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..

Modify Ticket

Action
as closed The ticket will remain with no owner.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.