我试图将xsp4作为systemd服务运行,以便在Ubuntu16.04上托管WebAPI 2应用程序。这是我的服务文件:
[Unit]
Description=myapp xsp4 WebAPI 2
Wants=network.target
[Service]
Type=simple
User=www-data
Group=www-data
EnvironmentFile=/etc/myapp/env
ExecStart=/usr/bin/xsp4 --appconfigdir /etc/xsp4/ --root /var/www/myapp.com/server --address 127.0.0.1
Restart=on-failure
[Install]
WantedBy=multi-user.targetExecStart中的命令在shell中运行时运行良好(作为root用户)。当我通过系统开始时,我得到:
root@ubuntu-512mb-ams3-01:/etc/systemd/system# sctl status myapp.service
● myapp.service - myapp xsp4 WebAPI 2
Loaded: loaded (/etc/systemd/system/myapp.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Oct 07 14:32:00 ubuntu-512mb-ams3-01 systemd[1]: myapp.service: Start request repeated too quickly.
Oct 07 14:32:00 ubuntu-512mb-ams3-01 systemd[1]: Failed to start myapp xsp4 WebAPI 2.
Oct 07 14:59:12 ubuntu-512mb-ams3-01 systemd[1]: Stopped myapp xsp4 WebAPI 2.
Oct 07 14:59:16 ubuntu-512mb-ams3-01 systemd[1]: Started myapp xsp4 WebAPI 2.
Oct 07 14:59:19 ubuntu-512mb-ams3-01 xsp4[26490]: xsp4
Oct 07 14:59:19 ubuntu-512mb-ams3-01 xsp4[26490]: Listening on address: 127.0.0.1
Oct 07 14:59:19 ubuntu-512mb-ams3-01 xsp4[26490]: Root directory: /var/www/myapp.com/server
Oct 07 14:59:19 ubuntu-512mb-ams3-01 xsp4[26490]: Listening on port: 9000 (non-secure)
Oct 07 14:59:19 ubuntu-512mb-ams3-01 xsp4[26490]: Hit Return to stop the server.
Oct 07 14:59:19 ubuntu-512mb-ams3-01 xsp4[26490]: [0x7f24851e9700:] EXCEPTION handling: System.Threading.ThreadAbortException:在shell中运行时不会出现System.Threading.ThreadAbortException。实际错误是“启动请求重复得太快”。因为我将mono配置为输出所有异常,即使被捕获-因此此异常不是退出的原因。
有什么建议吗?
发布于 2019-10-23 05:12:57
我会补充答案,因为我自己正在寻找。
服务
TimeoutStartSec=100
ExecStart=/usr/bin/xsp4 4 --appconfigdir /etc/xsp4 4/-root /var/www/myapp.com/server -地址127.0.0.1 --不间断
https://stackoverflow.com/questions/39920426
复制相似问题