0

The apparmour profile for ejabberd is broken. With startup of ejabberd: sudo systemctrl (re)start ejabberd the process hangs and in the reason is that erlang is unable to communicate with systemd with it's notify hook fails with:

2022-06-01 09:12:46.211457+03:00 [error] <0.356.0>@ejabberd_systemd:handle_info/2:135 Cannot ping watchdog: {badmatch,{error,eacces}}

There is path problem most likely in it or right issue. Funny thing is that with exactly same config on other server works.... Anyone?

2 Answers2

1

This systemd Unit file from 20.04 solves the problem:

Description=A distributed, fault-tolerant Jabber/XMPP server
Documentation=https://www.process-one.net/en/ejabberd/docs/
After=epmd.service network.target
Requires=epmd.service

[Service] Type=forking User=ejabberd Group=ejabberd LimitNOFILE=65536 Restart=on-failure RestartSec=5 ExecStart=/bin/sh -c '/usr/sbin/ejabberdctl start && /usr/sbin/ejabberdctl started' ExecStop=/bin/sh -c '/usr/sbin/ejabberdctl stop && /usr/sbin/ejabberdctl stopped' ExecReload=/bin/sh -c '/usr/sbin/ejabberdctl reload_config' PrivateTmp=true ProtectHome=true ProtectSystem=full TimeoutSec=300

[Install] WantedBy=multi-user.targe

Place here: /lib/systemd/system/ejabberd.service

0

Works like a charm, watchgog error no longer present and starting the service is no longer hanged What is different compared to the original ejabberd.service: -WatchdogSec=30 (no longer present) -NotifyAccess=all (no longer present) -PrivateDevices=true (no longer present) -AmbientCapabilities=CAP_NET_BIND_SERVICE (no longer present)

  • ExecStart=/bin/sh -c '/usr/sbin/ejabberdctl foreground' (replaced with)
  • ExecStart=/bin/sh -c '/usr/sbin/ejabberdctl start && /usr/sbin/ejabberdctl started'
sigma
  • 1