【发布时间】:2021-06-21 11:14:50
【问题描述】:
这应该很容易,但我完全迷路了。我的 /etc/systemd/system 目录中有一个脚本来启动 IBM HTTP Server: ihs.服务
[Unit]
Description=IBM HTTP Server
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/appl/ihs/logs/httpd.pid
ExecStart=/appl/ihs/bin/apachectl start
ExecStop=/appl/ihs/bin/apachectl graceful-stop
ExecReload=/appl/ihs/bin/apachectl graceful
PrivateTmp=true
LimitNOFILE=infinity
[Install]
WantedBy=multi-user.target
-rw-r--r--。 1根根355 Jun 21 13:06 ihs.service
-rwxr-xr-x。 1 wasusr wasgrp 3414 5 月 12 日 14:02 /appl/ihs/bin/apachectl
systemctl start ihs.service 在日志中给出了一个错误:
Jun 21 12:34:21 (myhostname) systemd[2814762]: ihs.service: 执行: /appl/ihs/bin/apachectl start 6 月 21 日 12:34:21 (myhostname) systemd[2814762]: ihs.service: 无法执行命令:权限被拒绝 6 月 21 日 12:34:21 (myhostname) systemd[2814762]: ihs.service: 执行步骤执行失败 /appl/ihs/bin/apachectl: 权限被拒绝 -- 主题:无法执行进程 /appl/ihs/bin/apachectl -- 定义者:systemd -- 支持:https://access.redhat.com/support
--进程/appl/ihs/bin/apachectl无法执行失败。
-- 该进程返回的错误号为13。
systemd 怎么可能在拥有所需权限时报告该进程无法执行? 从命令行运行相同的命令可以完美运行。 pid文件目录也存在
【问题讨论】: