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

service can not start #46

Open
kakuilan opened this issue Mar 6, 2017 · 9 comments
Open

service can not start #46

kakuilan opened this issue Mar 6, 2017 · 9 comments

Comments

@kakuilan
Copy link

kakuilan commented Mar 6, 2017

I follow the following steps to do, but can not start:
go build myservice.go
./myservice install
Install My Echo Service: [ OK ]
./myservice start
Starting My Echo Service: [FAILED]
Error: exit status 5

system is ubuntu.16.04

@takama
Copy link
Owner

takama commented Mar 10, 2017

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

@hawavisi
Copy link

I get the same error. On raspberry pi (debian jessie) I get error code 6.

$ go build
$ sudo ./myservice install
Install My Echo Service: [ OK ]
$ sudo ./myservice start
Starting My Echo Service: [FAILED]
Error: exit status 6

$ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

$ cat /proc/version
Linux version 4.9.11-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #971 SMP Mon Feb 20 20:44:55 GMT 2017

@hawavisi
Copy link

It was solved by removing the following two lines in /etc/systemd/system/myservice.service:

Requires=dummy.service
After=dummy.service

@xjiaj8
Copy link

xjiaj8 commented Jul 13, 2017

@hawavisi
I get the same env with you。
Do it your way:
./myservice start sucess,but can't auto restart after myservice abort.
Can you see the same question?

@lixianliang
Copy link

@hawavisi @takama
[letian@inf example]$ sudo ./myservice install
[sudo] password for letian:
Install My Echo Service: [ OK ]
[letian@inf example]$ sudo ./myservice status
Service is stopped
[letian@inf example]$ sudo ./myservice start
Starting My Echo Service: [FAILED]
Error: exit status 5
[letian@inf example]$ cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)

@threeearcat
Copy link

For those who see the same issue. Try to remove dummy.service in the line

var dependencies = []string{"dummy.service"}

It might be helpful.

@rener172846
Copy link

rener172846 commented Feb 14, 2019

@threeearcat I removed dummy.service and it works well on ubuntu 16.04. Thank you

@jgbooks
Copy link

jgbooks commented May 16, 2019

I get the same error
cat /etc/os-release

NAME="Ubuntu"
VERSION="16.04.5 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.5 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial

./myservice install
Install My Echo Service: [FAILED]
Error: Service has already been installed

/myservice remove
Removing My Echo Service: [FAILED]
Error: exit status 1

./myservice stop
Stopping My Echo Service: [FAILED]
Error: Service has already been stopped

@manwooo
Copy link

manwooo commented Jul 2, 2020

i solved this way..

  1. change your code.
    srv, err := daemon.New(name, description, dependencies...)
    =>
    srv, err := daemon.New(name, description)
  2. remove service
  3. install service
  4. start service
  5. ok... good.!

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

9 participants