无法启动 rtslib-fb-targetctl.service

无法启动 rtslib-fb-targetctl.service

我在 ubuntu 18.04 上通过 devstack 安装了 openstack。我卡在“无法启动 rtslib-fb-targetctl.service”,有人知道如何解决吗?

+functions-common:apt_get:1109             sudo DEBIAN_FRONTEND=noninteractive http_proxy= https_proxy= no_proxy= apt-get --option Dpkg::Options::=--force-confold --assume-yes install targetcli-fb
Reading package lists... Done
Building dependency tree       
Reading state information... Done
targetcli-fb is already the newest version (2.1.43-1).
The following package was automatically installed and is no longer required:
  python3-wheel
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 16 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up python3-rtslib-fb (2.1.71-0ubuntu1~cloud0) ...
Failed to start rtslib-fb-targetctl.service: Unit rtslib-fb-targetctl.service is not loaded properly: Exec format error.
See system logs and 'systemctl status rtslib-fb-targetctl.service' for details.
invoke-rc.d: initscript rtslib-fb-targetctl, action "start" failed.
● rtslib-fb-targetctl.service - Restore LIO kernel target configuration
   Loaded: error (Reason: Exec format error)
   Active: inactive (dead)

Apr 28 21:41:20 jun-VirtualBox systemd[1]: /lib/systemd/system/rtslib-fb-targetctl.service:9: Executable path is not absolute: mkdir -p /etc/rtslib-fb-target
Apr 28 21:41:20 jun-VirtualBox systemd[1]: /lib/systemd/system/rtslib-fb-targetctl.service:9: Executable path is not absolute: mkdir -p /etc/rtslib-fb-target
Apr 28 21:41:20 jun-VirtualBox systemd[1]: /lib/systemd/system/rtslib-fb-targetctl.service:9: Executable path is not absolute: mkdir -p /etc/rtslib-fb-target
Apr 28 21:41:59 jun-VirtualBox systemd[1]: /lib/systemd/system/rtslib-fb-targetctl.service:9: Executable path is not absolute: mkdir -p /etc/rtslib-fb-target
Apr 28 21:41:59 jun-VirtualBox systemd[1]: /lib/systemd/system/rtslib-fb-targetctl.service:9: Executable path is not absolute: mkdir -p /etc/rtslib-fb-target
Apr 28 21:41:59 jun-VirtualBox systemd[1]: /lib/systemd/system/rtslib-fb-targetctl.service:9: Executable path is not absolute: mkdir -p /etc/rtslib-fb-target
dpkg: error processing package python3-rtslib-fb (--configure):
 installed python3-rtslib-fb package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of targetcli-fb:
 targetcli-fb depends on python3-rtslib-fb; however:
  Package python3-rtslib-fb is not configured yet.

dpkg: error processing package targetcli-fb (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
 python3-rtslib-fb
 targetcli-fb
E: Sub-process /usr/bin/dpkg returned an error code (1)
+functions-common:apt_get:1                exit_trap
+./stack.sh:exit_trap:503                  local r=100
++./stack.sh:exit_trap:504                  jobs -p
+./stack.sh:exit_trap:504                  jobs=
+./stack.sh:exit_trap:507                  [[ -n '' ]]
+./stack.sh:exit_trap:513                  '[' -f '' ']'
+./stack.sh:exit_trap:518                  kill_spinner
+./stack.sh:kill_spinner:413               '[' '!' -z '' ']'
+./stack.sh:exit_trap:520                  [[ 100 -ne 0 ]]
+./stack.sh:exit_trap:521                  echo 'Error on exit'
Error on exit
+./stack.sh:exit_trap:523                  type -p generate-subunit
+./stack.sh:exit_trap:524                  generate-subunit 1619615804 1523 fail
+./stack.sh:exit_trap:526                  [[ -z /opt/stack/logs ]]
+./stack.sh:exit_trap:529                  /usr/bin/python3.6 /opt/stack/devstack/tools/worlddump.py -d /opt/stack/logs
World dumping... see /opt/stack/logs/worlddump-2021-04-28-134208.txt for details
+./stack.sh:exit_trap:538                  exit 100

这是 rtslib-fb-targetctl.service 的内容

root@jun-VirtualBox:/lib/systemd/system# cat rtslib-fb-targetctl.service
[Unit]
Description=Restore LIO kernel target configuration
Requires=sys-kernel-config.mount
After=sys-kernel-config.mount network.target local-fs.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=mkdir -p /etc/rtslib-fb-target
ExecStart=/usr/bin/targetctl restore
ExecStop=/usr/bin/targetctl clear
SyslogIdentifier=target

[Install]
WantedBy=multi-user.target

答案1

我只看到一件事是不正常的:你需要在服务中使用绝对路径,因此选择一个编辑器并更改mkdir/bin/mkdir

可以使用以下方法进行编辑:

sudo nano /lib/systemd/system/rtslib-fb-targetctl.service

(或 vi、vim 或 gedit)

然后使用以下方式检查服务

systemctl status rtslib-fb-targetctl.service

如果它有效,请重新加载或停止/启动它

相关内容