I have checked again and again on terminal and ./go.sh both working but not able to start as service. I know i am doing it wrong but not sure what.
/root/go.sh
#!/usr/bin/env bash
export PATH=/sbin:/usr/sbin:/bin:/usr/bin
/root/goweb/bin/echoip -t=/root/goweb/bin/index.html
And
/lib/systemd/system/goweb.service
[Unit]
Description=goweb
[Service]
Type=forking
Restart=always
RestartSec=5s
ExecStart=/root/go.sh
[Install]
WantedBy=multi-user.target
I dont know what happen now the service starting and stopped and starting and stopped
Here is the status
goweb.service - goweb
Loaded: loaded (/lib/systemd/system/goweb.service; enabled; vendor preset: en
Active: activating (start) since Sun 2020-01-19 19:39:52 UTC; 36s ago
Cntrl PID: 1259 (bash)
Tasks: 6 (limit: 1151)
CGroup: /system.slice/goweb.service
├─1259 bash /root/go.sh
└─1268 /root/goweb/bin/echoip -t=/root/goweb/bin/index.html
Jan 19 19:39:52 ip systemd[1]: goweb.service: Service hold-off time over, schedu
Jan 19 19:39:52 ip systemd[1]: goweb.service: Scheduled restart job, restart cou
Jan 19 19:39:52 ip systemd[1]: Stopped goweb.
Jan 19 19:39:52 ip systemd[1]: Starting goweb...
Jan 19 19:39:52 ip go.sh[1259]: echoip: Listening on http://0.0.0.0:8080