ubuntu 开机启动脚本

vim /etc/systemd/system/frpc.service

```

[Unit]

Description=FRP Client Service

[Service]

ExecStart=/bin/bash /usr/local/frp/frpc_run.sh

[Install]

WantedBy=multi-user-target

```

In the .service file, I needed to add /bin/bash before the path to the script.

For example, for backup.service:

ExecStart=/bin/bash /home/user/.scripts/backup.sh

As opposed to:

ExecStart=/home/user/.scripts/backup.sh

```

sudo systemctl enable frpc

sudo service frpc start

```

```

sudo systemctl daemon-reload

```


```

$ sudo systemctl list-units |grep frpc

```

Problem:

Failed to execute operation: Invalid argument

https://askubuntu.com/questions/814/how-to-run-scripts-on-start-up

https://haoyu.love/blog521.html

https://stackoverflow.com/questions/45776003/fixing-a-systemd-service-203-exec-failure-no-such-file-or-directory

树莓派设置frpc开机启动

你可能感兴趣的:(ubuntu 开机启动脚本)