0

在他们说配置为用户 ejabberd 的文档中,但他们是指系统用户还是普通用户。我不知道为什么,但如果我这样做,它有时会在 $HOME/.erlang.cookie 中创建一个 erlang.cookie,有时在 $HOME/ejabberd/.erlang.cookie 中创建一个,我不知道为什么。当我将构建配置为使用我的用户名时,一切正常。

(这些步骤已使用系统用户和普通用户 ejabberd 进行了尝试,但没有在步骤 3 之前创建主目录)

step 1: ./configure  --enable-user=ejabberd --disable-stun --enable-sqlite
step 2: make
step 3: sudo make install
step 4: copy the service file to systemd/system directory and starting the service
step 5: receiving the error that the erlang.cookie can't be created because of no
        permisson for /home/ or because /home/ejabberd does not exist

指向应该在 /var/lib/ejabberd/.erlang.cookie [ Docs ]中创建 cookie 的文档

如果你能帮助我,那就太好了!

4

1 回答 1

0

在他们说配置为用户 ejabberd 的文档中,但他们是指系统用户还是普通用户。

普通用户!ejabberd 不需要任何特权或 root 访问权限即可工作(仅用于 ACME 证书更新的端口 80,但端口转发就足够了)。

指向应该在 /var/lib/ejabberd/.erlang.cookie [ Docs ] 中创建 cookie 的文档

在过去,HOME 设置为 SPOOLDIR(文档仍然这么说),但在 https://github.com/processone/ejabberd/commit/40ef406ec7412f7a81240d1e7567953ca11ffe43#diff-58efbd248a3f69bc63a62926359bbcb142a2719L1039b8c45d6中进行了更改

因此,Docs 和 ejabberdctl.template 在这部分是错误的,需要更新:运行 ejabberd 的用户需要一个 HOME,因为 cookie 存储在那里。

当我将构建配置为使用我的用户名时,一切正常。

对,因为您的个人帐户有一个 HOME,erlang 可以在其中创建 cookie 文件。

这对我有用:

❯ sudo adduser ejacount3
S'està afegint l'usuari «ejacount3»…
S'està afegint el grup nou ejacount3 (1006)…
S'està afegint el nou usuari ejacount3 (1005) amb grup ejacount3…
S'està creant el directori personal «/home/ejacount3»…
...

❯ ./autogen.sh; ./configure --enable-user=ejacount3
allow this system user to start ejabberd: ejacount3
...

❯ make
...

❯ sudo make install
...

❯ sudo su ejacount3 ejabberdctl live
2021-10-06 11:23:53.400422+02:00 [info] ejabberd 21.07.62 is started in the node ejabberd@localhost in 5.35s
...

也可以使用 systemd:

❯ vim ejabberd.service
User=ejacount3
Group=ejacount3

❯ sudo cp ejabberd.service /etc/systemd/system/

❯ sudo systemctl daemon-reload 

❯ sudo systemctl enable ejabberd.service

❯ sudo systemctl start ejabberd         

❯ sudo systemctl status ejabberd
● ejabberd.service - XMPP Server
   Loaded: loaded (/etc/systemd/system/ejabberd.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2021-10-06 11:30:31 CEST; 1min 21s ago
...

❯ sudo su ejacount3 ejabberdctl status
The node ejabberd@localhost is started with status: started
ejabberd 21.07.62 is running in that node
于 2021-10-06T10:12:56.217 回答