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

Problem trying to start find as systemd service #56

Closed
Christoph-Wagner opened this issue Apr 20, 2016 · 2 comments
Closed

Problem trying to start find as systemd service #56

Christoph-Wagner opened this issue Apr 20, 2016 · 2 comments

Comments

@Christoph-Wagner
Copy link

Happens both when I compile from source or using the updated Binary.

System: Raspberry PI running raspbian jessie
go version go1.5.1 linux/arm

It works fine manually starting both.

Error log from the binary:

systemd[1]: Starting Find Server...                                                     
systemd[1]: Started Find Server.                                                        
find[16740]: panic: html/template: pattern matches no files: `templates/*`              
find[16740]: goroutine 1 [running]:                                                     
find[16740]: panic(0x4862e8, 0x10963000)                                                
find[16740]: C:/Go/src/runtime/panic.go:464 +0x330                                      
find[16740]: html/template.Must(0x0, 0x76e69000, 0x10963000, 0x76e69000)                
find[16740]: C:/Go/src/html/template/template.go:340 +0x4c                              
find[16740]: github.com/gin-gonic/gin.(*Engine).LoadHTMLGlob(0x10a25030, 0x520610, 0xb) 
find[16740]: C:/Users/ZNS/work/src/github.com/gin-gonic/gin/gin.go:129 +0x148           
find[16740]: main.main()                                                                
find[16740]: C:/cygwin64/home/ZNS/find2/server.go:71 +0x280                             
systemd[1]: find.service: main process exited, code=exited, status=2/INVALIDARGUMENT    
systemd[1]: Unit find.service entered failed state.                                     

My find.service file:

[Unit]
Description=Find Server
After=network.target

[Service]
Type=simple
User=root
ExecStart=/root/find/find
WorkingDirectory=/root/find

[Install]
WantedBy=multi-user.target

Tried it without the WorkingDirectory= part, made no difference.

@schollz
Copy link
Owner

schollz commented Apr 20, 2016

I think this is because I don't actually use the working directories to set the template and static files. That was a bug, and it is fixed now (hopefully) with this: ffd983f.

Can you try it and let me know if that works? I'm not familiar with systemd (I still do cron+/etc/init.d/ scripts).

@Christoph-Wagner
Copy link
Author

Working! 👍

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

No branches or pull requests

2 participants