我制作了一个 Bash 脚本,tsx 将 ts 文件作为 ubuntu 服务执行,但显示 code=exited, status=203/EXEC

问题描述 投票:0回答:1

我使用命令 bash /etc/systemd/system/tsx.sh ,结果没问题。 但无法作为 ubuntu 服务。 谢谢。 已加载:已加载(/etc/systemd/system/tsx.service;已启用;预设:已启用) 活动:失败(结果:退出代码)自 Sun 2024-10-27 06:18:53 UTC 起; 8 秒前 持续时间:3毫秒 进程:1604 ExecStart=/ect/systemd/system/tsx.sh(代码=已退出,状态=203/EXEC) 主PID:1604(代码=已退出,状态=203/EXEC) 我的 bash 脚本文件 tsx.sh /etc/systemd/system

#! /bin/bash

tsx /etc/myapp/teletrans/main.ts

我的 tsx.service 文件 /etc/systemd/system

    [Unit]
Description=tsx ts file
After=network.target
[Service]
Type=simple
ExecStart=/ect/systemd/system/tsx.sh
Restart=on-failure
[Install]
WantedBy=multi-user.target
typescript bash ubuntu service tsx
1个回答
0
投票

我已添加服务文件WorkingDirectory=/path/to/your/app

© www.soinside.com 2019 - 2024. All rights reserved.