1

カテゴリー: 学習  閲覧数:318 配信日:2018-05-04 13:05


$ sudo go build -o /opt/go/a1 a1.go
$ sudo go build -o /opt/go/a2 a2.go
$ sudo -s
# vi /etc/systemd/system/goa1.service
[Unit]
Description = go web start

[Service]
ExecStart = /opt/go/a1
Restart = always
Type = simple

[Install]
WantedBy = multi-user.target


# vi /etc/systemd/system/goa2.service
[Unit]
Description = go web start

[Service]
ExecStart = /opt/go/a2
Restart = always
Type = simple

[Install]
WantedBy = multi-user.target


# systemctl restart goa1.service
# systemctl restart goa2.service


http://go-demo.w4c.work/demo/a1.go
http://go-demo.w4c.work/demo/a2.go