尽管已启用,但服务xampp.service
并未自动启动。似乎 systemd 在成功启动后将其终止(?)。
它位于 /etc/systemd/system/ 下,包含以下内容
[Unit]
Description=XAMPP
[Service]
ExecStart=/opt/lampp/lampp start
[Install]
WantedBy=multi-user.target
systemctl --failed
返回:
UNIT LOAD ACTIVE SUB DESCRIPTION
● xampp.service loaded failed failed XAMPP
systemctl status xampp.service
返回:
● xampp.service - XAMPP
Loaded: loaded (/etc/systemd/system/xampp.service; enabled; vendor preset: disabled)
Active: failed (Result: timeout) since Mo 2016-11-21 02:04:10 CET; 4min 56s ago
Process: 459 ExecStart=/opt/lampp/lampp start (code=exited, status=0/SUCCESS)
Main PID: 459 (code=exited, status=0/SUCCESS)
Nov 21 02:02:40 tangboshi lampp[459]: XAMPP: Starting Apache...ok.
Nov 21 02:02:40 tangboshi lampp[459]: XAMPP: Starting MySQL...ok.
Nov 21 02:02:40 tangboshi proftpd[600]: tangboshi - ProFTPD 1.3.4c (maint) (built Fri Aug 26 2016 11:19:40 CEST) standalone mode STARTUP
Nov 21 02:02:40 tangboshi lampp[459]: XAMPP: Starting ProFTPD...ok.
Nov 21 02:02:40 tangboshi proftpd[600]: tangboshi - ProFTPD killed (signal 15)
Nov 21 02:04:10 tangboshi systemd[1]: xampp.service: State 'stop-sigterm' timed out. Killing.
Nov 21 02:04:10 tangboshi systemd[1]: xampp.service: Killing process 576 (mysqld_safe) with signal SIGKILL.
Nov 21 02:04:10 tangboshi systemd[1]: xampp.service: Killing process 737 (mysqld) with signal SIGKILL.
Nov 21 02:04:10 tangboshi systemd[1]: xampp.service: Unit entered failed state.
Nov 21 02:04:10 tangboshi systemd[1]: xampp.service: Failed with result 'timeout'.
答案1
这里没有足够的信息来确定,但我猜想它lamp start
会在后台运行各个组件服务,并在它们全部启动后退出。但是,默认服务类型很简单,其中由 systemd 启动的进程应该停留在前台。当启动脚本退出时,假设服务已死亡/退出,系统会清理在该上下文中运行的其他进程。如果您Type=forking
在服务部分中添加,systemd 将做正确的事情。有关更多详细信息,请参阅systemd.service 手册页