我的服务在RHEL 7.5上运行得很好,现在我升级到了RHEL 8,同样的服务也失败了,情况如下:
Service.service - LSB: Web Server
Loaded: loaded (/etc/rc.d/init.d/Service; generated)
Active: failed (Result: protocol) since Mon 2020-04-06 12:02:21 IST; 38min ago
Docs: man:systemd-sysv-generator(8)
Process: 403 ExecStart=/etc/rc.d/init.d/Service start (code=exited, status=0/SUCCESS)
Apr 06 12:02:21 localhost.localdomain systemd[1]: Starting LSB: Web Server...
Apr 06 12:02:21 localhost.localdomain Service[403]: httpd (pid 29434) already running
Apr 06 12:02:21 localhost.localdomain systemd[1]: Service.service: Refusing to accept PID outside of service control group, acquired through unsafe symlink chain:
/usr/local/apache/logs/Service.pid
Apr 06 12:02:21 localhost.localdomain systemd[1]: Service.service: Refusing to accept PID outside of service control group, acquired through unsafe symlink chain:
/usr/local/apache/logs/Service.pid
Apr 06 12:02:21 localhost.localdomain systemd[1]: Service.service: Failed with result 'protocol'.
Apr 06 12:02:21 localhost.localdomain systemd[1]: Failed to start LSB: Web ServerTHis是我的服务单元,放在/etc/init.d/Service下面,对于RHEL7.5也是这样,但是在RHEL 8中,这个服务是工作的,而不是。这里还有一件事要注意的是,web服务器正在按预期工作,尽管这给了我这个错误。
#!/bin/sh
#
# chkconfig: 345 97 03
# description:Web Server
# processname: httpd
# config: /usr/local/Test/apache/conf/httpd.conf
# pidfile: /usr/local/Test/apache/logs/httpd.pid
### BEGIN INIT INFO
# Provides: Service
# Required-Start: $remote_fs $network $syslog
# Should-Start:
# Required-Stop:
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6`enter code here`
# Short-Description: Web Server
# Description: Web Server
### END INIT INFO
LANG=en_US.iso88591
export LANG
BASEDIR=/usr/local/Test/apache
PATH=$BASEDIR/bin:/usr/bin:/bin
export PATH
LD_LIBRARY_PATH=$BASEDIR/lib
export LD_LIBRARY_PATH
inst=/usr/local/Test
MIBDIRS=$inst/mibs
export MIBDIRS
case $1 in
start)
apachectl start
;;
stop)
apachectl stop
;;
restart)
apachectl restart
;;
*)
echo "usage: $0 { start | stop | restart }"
;;
esac请帮我解决这个问题。
发布于 2020-04-07 23:26:58
如果你在日记里看到:
Refusing to accept PID outside of service control group, acquired through unsafe symlink chain:7.5中的systemd版本没有检查服务的pid是否在systemd单元的cgroup之外的附加检查。
如果要将7.5系统更新为7.7或更高版本,也会发生同样的错误。
如果将sysv init脚本转换为真正的systemd服务单元,您可能会更幸运。
https://unix.stackexchange.com/questions/578410
复制相似问题