systemd在步骤EXEC生成脚本时失败:权限被拒绝


13

可以这么说,我正在尝试创建“ Hello World”服务。称为autologger.service,存储在/usr/lib/systemd/system/autologger.service

我尝试过sudo service autologger start,但systemctl返回了标准:

Job for autologger.service failed. See 'systemctl status
autologger.service' and 'journalctl -xn' for details.

当我检查时/var/log/messages,看到以下错误消息:

Failed at step EXEC spawning /opt/autologger/placeholder.sh: Permission denied

我的问题是:如何授予任何服务权限?

这是服务单元文件:

[Unit]
Description=Hello World
DefaultDependencies=no
Before=shutdown.target reboot.target halt.target


[Service]
Type=oneshot
ExecStart=/opt/autologger/placeholder.sh

placeholder.sh仅包含

#!/bin/bash
echo "Hello World"

Answers:


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.