daemon icon indicating copy to clipboard operation
daemon copied to clipboard

service can not start

Open kakuilan opened this issue 7 years ago • 9 comments

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

kakuilan avatar Mar 06 '17 01:03 kakuilan

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

takama avatar Mar 10 '17 17:03 takama

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 avatar Apr 12 '17 21:04 hawavisi

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

Requires=dummy.service After=dummy.service

hawavisi avatar Apr 13 '17 10:04 hawavisi

@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?

xjiaj8 avatar Jul 13 '17 21:07 xjiaj8

@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)

lixianliang avatar Oct 24 '17 07:10 lixianliang

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

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

It might be helpful.

threeearcat avatar Aug 09 '18 08:08 threeearcat

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

rener172846 avatar Feb 14 '19 00:02 rener172846

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

jgbooks avatar May 16 '19 12:05 jgbooks

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.!

manwooo avatar Jul 02 '20 02:07 manwooo