ubuntu16.04でupstartを利用して、golangをシステムに組み込んで起動させようと設定したいのですが、うまくいきません。
こちらを参考にさせていただいて設定してます。
http://twinbird-htn.hatenablog.com/entry/2017/04/26/150018
// upstart設定
sudo apt install upstart
hello.go
package main import ( "net/http" "fmt" ) func main() { http.HandleFunc("/", helloHandler) http.ListenAndServe(":8080", nil) } func helloHandler(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello\n") }
vi /etc/init/hello-svr.conf
description "Hello Server" author "com.ubuntu.Upstart<mail@ubuntu.jp>" start on runlevel [235] stop on runlevel [016] chdir /usr/local/bin/hello-svr exec ./hello respawn
ubuntu@ip-10-0-1-97:~$ initctl reload-configuration initctl: Name "com.ubuntu.Upstart" does not exist
というふうにcom.ubuntu.Upstartが存在しませんというエラーが出てうまくいきません。
ご教授の方お願いします。
回答1件
あなたの回答
tips
プレビュー