2023年11月27日发(作者:)

systemctl⾃定义service执⾏shell脚本时报错codeexitedstat

。。

过程:

写了⼀个⾃定义systemctl的service,很简单,就是执⾏⼀个脚本去配置IP。

/etc/systemd/system/e

[Unit]

Description=configip service

[Service]

ExecStart=/home/root/

ExecReload=/home/root/

ExecStop=

StandardOutput=tty

在/home/root/脚本的开头加上#!/bin/sh

#!/bin/sh