在Arch Linux中创建服务“ Unit xxx的单元文件设置错误” [关闭]

问题描述 投票:-1回答:1

tl; dr尝试将简单脚本作为服务运行

我试图摆脱在Manjaro终端开放时启动脚本的懒惰,所以我试图将自己的精力投入服务并将其创建为练习/介绍。我尝试启动该服务,但出现了此错误消息,尽管我没有走运发现它的含义:

● default.service - A simple startup script    Loaded: bad-setting (Reason: Unit default.service has a bad unit file setting.)    Active: inactive (dead)

我尝试运行的脚本只是分配监视器位置和墙纸。

我可以手动运行它,这很好,所以我相信这是我错误地创建服务的方法。

编辑-供参考,由于我有点have,我可能需要设置一个环境,这是我的上下文脚本。

#!/bin/bash

#xrandr --output DP1 -- mode 1920x1080 --pos 0x0 --output DP2 --mode 1920x1080 --pos 0x1 --rotate normal --output DP3 --off --output HDMI1 --primary --mode 1920x1080 --pos 0x2 --rotate normal --output HDMI2 --off --output HDMI3 --off --output VIRTUAL1 --off
#xrandr --output DP1 --auto --pos 0x0 --output DP1 --auto --pos 0x --output HDMI1 --auto --pos 0x2
#xrandr --auto --output DP1 --auto --right-of HDMI1 --left-of DP2
xrandr --output DP1 --auto --output DP2 --auto --right-of DP1 --output HDMI1 --auto --right-of DP2

nitrogen --restore &
service archlinux manjaro
1个回答
-1
投票
[Unit]
Description=A simple startup script

[Service]
Type=simple
ExecStart=/bin/bash /usr/bin/default.sh

[Install]
WantedBy=multi-user.target

我在ExecStart中缺少大写字母S。

因此,这是对大家的一个教训,通常是PEBCAK的问题。

© www.soinside.com 2019 - 2024. All rights reserved.