Systemctl - 在步骤组生成失败
Systemctl - Failed at step Group spawning
我对自动 运行 服务有问题。我想 运行 用户登录后的脚本。一旦我成功了,但是当我试图将它自动化时,我遇到了一个错误,而且我找不到错误。
服务:
Description=Service desc
[Service]
Type=oneshot
Environment=DISPLAY=:0.0
Environment=XAUTHORITY=/home/albert/.Xauthority
Environment=HOME=/home/albert/
User=albert
Group=albert
RemainAfterExit=true
StandardOutput=journal
ExecStart=/home/albert/.startup-script.sh
[Install]
WantedBy=default.target
地点:
/home/albert/.config/systemd/user/startup-service.服务
权限:-rw-r--r-- 1 albert albert 306 Jan 2 14:49 startup-service.service
脚本
权限:-rwxr-x-r-x 1 albert albert 86 Jan 2 13:30 /home/albert/.startup-script.sh
日志
Jan 02 17:03:27 irpi-epsilon systemd[734]: Service desc
-- Subject: Unit UNIT has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit UNIT has begun starting up.
Jan 02 17:03:27 irpi-epsilon systemd[1025]: startup-script.service: Failed at step GROUP spawning /home/albert/.startup-script.sh: Operation not permitted
-- Subject: Process /home/albert/.startup-script.sh could not be executed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The process /home/albert/.startup-script.sh could not be executed and failed.
--
-- The error number returned by this process is 1.
Jan 02 17:03:27 irpi-epsilon systemd[734]: startup-script.service: Main process exited, code=exited, status=216/GROUP
Jan 02 17:03:27 irpi-epsilon systemd[734]: Service desc
-- Subject: Unit UNIT has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit UNIT has failed.
--
-- The result is failed.
Jan 02 17:03:27 irpi-epsilon systemd[734]: startup-script.service: Unit entered failed state.
Jan 02 17:03:27 irpi-epsilon systemd[734]: startup-script.service: Failed with result 'exit-code'.
我打过:
systemctl --user daemon-reload
systemctl --user enable startup-script.service
systemctl --user start startup-script
我正在尝试在 Raspberry Pi 3 上完成。
非常感谢您为我指明方向。
如果有人有类似的问题,请删除
服务文件中的用户和组。我不知道为什么,但没有它们它工作得很好。所以最终的工作服务描述是:
Description=Service desc
[Service]
Type=oneshot
Environment=DISPLAY=:0.0
Environment=XAUTHORITY=/home/albert/.Xauthority
Environment=HOME=/home/albert/
RemainAfterExit=true
StandardOutput=journal
ExecStart=/home/albert/.startup-script.sh
[Install]
WantedBy=default.target
我对自动 运行 服务有问题。我想 运行 用户登录后的脚本。一旦我成功了,但是当我试图将它自动化时,我遇到了一个错误,而且我找不到错误。
服务:
Description=Service desc
[Service]
Type=oneshot
Environment=DISPLAY=:0.0
Environment=XAUTHORITY=/home/albert/.Xauthority
Environment=HOME=/home/albert/
User=albert
Group=albert
RemainAfterExit=true
StandardOutput=journal
ExecStart=/home/albert/.startup-script.sh
[Install]
WantedBy=default.target
地点: /home/albert/.config/systemd/user/startup-service.服务
权限:-rw-r--r-- 1 albert albert 306 Jan 2 14:49 startup-service.service
脚本
权限:-rwxr-x-r-x 1 albert albert 86 Jan 2 13:30 /home/albert/.startup-script.sh
日志
Jan 02 17:03:27 irpi-epsilon systemd[734]: Service desc
-- Subject: Unit UNIT has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit UNIT has begun starting up.
Jan 02 17:03:27 irpi-epsilon systemd[1025]: startup-script.service: Failed at step GROUP spawning /home/albert/.startup-script.sh: Operation not permitted
-- Subject: Process /home/albert/.startup-script.sh could not be executed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The process /home/albert/.startup-script.sh could not be executed and failed.
--
-- The error number returned by this process is 1.
Jan 02 17:03:27 irpi-epsilon systemd[734]: startup-script.service: Main process exited, code=exited, status=216/GROUP
Jan 02 17:03:27 irpi-epsilon systemd[734]: Service desc
-- Subject: Unit UNIT has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit UNIT has failed.
--
-- The result is failed.
Jan 02 17:03:27 irpi-epsilon systemd[734]: startup-script.service: Unit entered failed state.
Jan 02 17:03:27 irpi-epsilon systemd[734]: startup-script.service: Failed with result 'exit-code'.
我打过:
systemctl --user daemon-reload
systemctl --user enable startup-script.service
systemctl --user start startup-script
我正在尝试在 Raspberry Pi 3 上完成。 非常感谢您为我指明方向。
如果有人有类似的问题,请删除 服务文件中的用户和组。我不知道为什么,但没有它们它工作得很好。所以最终的工作服务描述是:
Description=Service desc
[Service]
Type=oneshot
Environment=DISPLAY=:0.0
Environment=XAUTHORITY=/home/albert/.Xauthority
Environment=HOME=/home/albert/
RemainAfterExit=true
StandardOutput=journal
ExecStart=/home/albert/.startup-script.sh
[Install]
WantedBy=default.target