1

我尝试将 Plone 与基于 systemctl 的启动集成(在 openSUSE 12.3 上)

作为第一次尝试,我有一个非常简单的 plone.service 文件

[Unit]
Description=Plone content management system
After=network.target

[Service]
Type=simple
ExecStart=/srv/plone/zeocluster/bin/plonectl start

[Install]
WantedBy=multi-user.target

检查 systemclt status plone 我看到进程已启动,但它们立即再次消失。我也试过Type=Daemon,但结果是一样的。有什么提示是我的错误吗?

该服务实际上成功地找到/执行了 plonectl 脚本,只是进程很快死亡

linux-wezo:/etc/systemd/system # systemctl start plone.service
linux-wezo:/etc/systemd/system # systemctl status plone.service
plone.service - Plone content management system
          Loaded: loaded (/etc/systemd/system/plone.service; disabled)
          Active: inactive (dead) since Mon, 2013-03-18 22:00:50 CET; 1s ago
         Process: 25494 ExecStart=/srv/plone/zeocluster/bin/plonectl start (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/plone.service

Mar 18 22:00:42 linux-wezo.site systemd[1]: Starting Plone content management system...
Mar 18 22:00:42 linux-wezo.site systemd[1]: Started Plone content management system.
Mar 18 22:00:43 linux-wezo.site plonectl[25494]: zeoserver: .
Mar 18 22:00:43 linux-wezo.site plonectl[25494]: daemon process started, pid=25502
Mar 18 22:00:46 linux-wezo.site plonectl[25494]: client1: .
Mar 18 22:00:46 linux-wezo.site plonectl[25494]: daemon process started, pid=25507
Mar 18 22:00:49 linux-wezo.site plonectl[25494]: client2: .
Mar 18 22:00:49 linux-wezo.site plonectl[25494]: daemon process started, pid=25522

我确实有一个 SysV 风格的初始化脚本,它通过 systemctl 工作,但我认为拥有一个服务文件会很棒,因为它应该比各种浮动的初始化脚本更通用。

4

2 回答 2

0

问题是程序 plonectl 不是守护程序,它是启动 Zope 的包装脚本。您需要将类型更改为分叉,并可能告诉 systemd 在哪里可以找到 PID 文件。

于 2013-03-22T09:02:23.420 回答
0

Plonectl fork 守护进程。在 plone.service 中试试这个:

[Unit]
Description=Plone content management system
After=network.target
ConditionPathExists=/srv/plone/zeocluster/bin/plonectl

[Service]
Type=forking
ExecStart=/srv/plone/zeocluster/bin/plonectl start
ExecStop=/srv/plone/zeocluster/bin/plonectl stop
ExecReload=/srv/plone/zeocluster/bin/plonectl restart

[Install]
WantedBy=multi-user.target
于 2020-08-29T19:02:08.920 回答