我无法运行 systemd 服务
[chris@alarmpi shellinabox]$ sudo systemctl status shellinaboxd
* shellinaboxd.service - Serve a login-terminal over http on port 80
Loaded: loaded (/usr/lib/systemd/system/shellinaboxd.service; enabled; vendor preset: disabled)
Active: inactive (dead)
Jul 24 22:20:57 alarmpi systemd[1]:[/usr/lib/systemd/system/shellinaboxd.service:3] Unknown lvalue 'Required' in section 'Unit'
Jul 24 22:22:10 alarmpi systemd[1]:[/usr/lib/systemd/system/shellinaboxd.service:3] Unknown lvalue 'Required' in section 'Unit'
Jul 24 22:24:55 alarmpi systemd[1]:[/usr/lib/systemd/system/shellinaboxd.service:3] Unknown lvalue 'Required' in section 'Unit'
这是服务:
[Unit]
Description=Serve a login-terminal over http on port 80
Required=sshd.service
After=sshd.service
[Service]
User=chris
Type=forking
EnvironmentFile=/etc/conf.d/shellinaboxd
ExecStart=/usr/bin/shellinaboxd $SHELLINABOXD_ARGS
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-abort
[Install]
WantedBy=multi-user.target
答案1
required 不是有效指令。你的意思可能是Requires
或者RequiredBy
。 systemd.directives(7) 的手册页中列出了这些指令。