小编jas*_*eUK的帖子

systemd Exec 格式错误

我有一个 java 文件,我正在尝试将其安装为服务。但我收到错误。以下是我的文件和错误的内容。我正在运行 Debian 8。

[Unit]
Description=App1Manager
After=syslog.target

[Service]
ExecStart=/usr/bin/jsvc -user root -cp /usr/share/java/commons-daemon.jar:/usr/local/myapp/bin/Manager.jar -pidfile /var/run/app1manager.pid

Type=forking

[Install]
WantedBy=multi-user.target
Run Code Online (Sandbox Code Playgroud)

使用以下任一方法,我都会收到以下错误:

SYSTEMD_LOG_LEVEL=debug /lib/systemd/system/myapp1 
SYSTEMD_LOG_LEVEL=debug /etc/init.d/myapp1 

/etc/init.d/myapp1: line 1: [Unit]: command not found
/etc/init.d/myapp1: line 6: [Service]: command not found
/etc/init.d/myapp1: line 7: -user: command not found
/etc/init.d/myapp1: line 10: [Install]: command not found


Aug 12 12:04:39 debian systemd[3903]: Failed at step EXEC spawning /etc/init.d/myapp1: Exec format error
-- Subject: Process /etc/init.d/myapp1 could not be executed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel …
Run Code Online (Sandbox Code Playgroud)

debian systemd

7
推荐指数
1
解决办法
3万
查看次数

标签 统计

debian ×1

systemd ×1