Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 14.04 go run main.go install, wrong path #42

Open
hemc4 opened this issue Jan 9, 2017 · 2 comments
Open

Ubuntu 14.04 go run main.go install, wrong path #42

hemc4 opened this issue Jan 9, 2017 · 2 comments

Comments

@hemc4
Copy link

hemc4 commented Jan 9, 2017

Machine version

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 14.04.4 LTS
Release:	14.04
Codename:	trusty

go version
go version go1.5 linux/amd64

Well the generated config file is

ubuntu@workhorse-2:/etc/init$ cat myservice.conf
# myservice My Echo Service

description     "My Echo Service"
author          "Pichu Chen <pichu@tih.tw>"

start on runlevel [2345]
stop on runlevel [016]

#kill timeout 5

exec /tmp/go-build462925290/command-line-arguments/_obj/exe/main  >> /var/log/myservice.log 2>> /var/log/myservice.err

But there is no folder in /tmp by this id go-build462925290, there are folders by build462925291 and some more id's.
Logs from the service error file.

ubuntu@workhorse-2:/var/log$ tail -f myservice.err
/bin/sh: 1: exec: /tmp/go-build462925290/command-line-arguments/_obj/exe/main: not found
/bin/sh: 1: exec: /tmp/go-build462925290/command-line-arguments/_obj/exe/main: not found
/bin/sh: 1: exec: /tmp/go-build462925290/command-line-arguments/_obj/exe/main: not found
/bin/sh: 1: exec: /tmp/go-build462925290/command-line-arguments/_obj/exe/main: not found

so it should generate the path as /tmp/go-build462925291 /command-line-arguments/_obj/exe/main instead of /tmp/go-build462925290/command-line-arguments/_obj/exe/main

@takama
Copy link
Owner

takama commented Mar 10, 2017

I cant verify this in nearest time, but maybe somebody check who use ubuntu 14.04

@PichuChen
Copy link
Contributor

The template in that line is:
exec {{.Path}} {{.Args}} >> /var/log/{{.Name}}.log 2>> /var/log/{{.Name}}.err

and {{.Path}} should be executable binary, so use go build and run it, don't use go run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants