/etc/systemd/system/webapp.service에 이 서비스를 만들었습니다.
안에:
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
내용은 다음과 같습니다.
[Unit]
Description=webapp daemon
[Service]
Type=simple
ExecStart=/usr/local/bin/start-webapp.sh
ExecStop=/usr/local/bin/stop-webapp.sh
ExecReload=/usr/local/bin/reload-webapp.sh
[Install]
WantedBy=multi-user.target
다음을 사용하여 서비스를 시작하려고 합니다.
sudo systemctl start webapp.service
하지만 내가 할 때
sudo systemctl status webapp.service
다음 오류가 발생합니다.
● webapp.service - webapp daemon
Loaded: loaded (/etc/systemd/system/webapp.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Jun 01 11:31:48 localhost systemd[1]: /etc/systemd/system/webapp.service:8: Missing '='.
Jun 01 11:31:52 localhost systemd[1]: /etc/systemd/system/webapp.service:8: Missing '='.
Jun 01 11:35:21 localhost systemd[1]: /etc/systemd/system/webapp.service:8: Missing '='.
Jun 01 11:35:31 localhost systemd[1]: /etc/systemd/system/webapp.service:8: Missing '='.
그리고
admin@localhost:/etc/systemd/system$ cat -vetn webapp.service
1 [Unit]$
2 Description=webapp daemon$
3 [Service]$
4 Type=simple$
5 ExecStart=/usr/local/bin/start-webapp.sh$
6 ExecStop=/usr/local/bin/stop-webapp.sh$
7 ExecReload=/usr/local/bin/reload-webapp.sh$
8 [Install]$
9 WantedBy=multi-user.target$