Hi, thanks for finding the errors. I applied your suggestions but the service still goes into respawn loop when the VM boots. Do you have any idea why this could happen?
Alex Kost <alez...@gmail.com> writes: > ng0 (2016-08-11 18:55 +0300) wrote: > >> ng0 <n...@we.make.ritual.n0.is> writes: >> >>> As I wrote yesterday in freenode, disregard this patch. I >>> succeeded and currently am debugging the VM. >> >> I had it working at some point, but only to find out that I am passing >> something wrong in the service. >> Can someone take a look at this service and help me out? > > Hi, I didn't try this service, but I see 2 mistakes in the code. > > [...] >> +(define (git-shepherd-service config) >> + "Return a <shepherd-service> for git with CONFIG." >> + (define git (git-configuration-git config)) >> + >> + (define git-command >> + #~(list >> + (string-append #$git "/bin/git") "daemon" "--syslog" >> + "--informative-errors" >> + "--port=" (number->string (git-configuration-port config)) >> + "--base-path=" (git-configuration-base-path config))) > > 1. This should be: > > "--port=" #$(number->string (git-configuration-port config)) > "--base-path=" #$(git-configuration-base-path config))) > > Note ‘#$’ before expressions. Without it, these expressions will stay > the same in the final making service code (see below). > >> + (define requires >> + '(networking syslogd)) >> + >> + (list (shepherd-service >> + (documentation "Git daemon server for git repositories") >> + (requirement requires) >> + (provision '(git)) >> + (start #~(make-forkexec-constructor #$@git-command)) > > 2. This should be: > > (start #~(make-forkexec-constructor #$git-command)) > > Note ‘#$@ → #$’. With #$@, the list (I mean git-command) is "spliced", > so the result in "/gnu/store/...-shepherd-git.scm" will be: > > (make <service> > ... > #:start > (make-forkexec-constructor list > (string-append "/gnu/store/…" "/bin/git") > "daemon" "--syslog" "--informative-errors" > "--port=" (number->string > (git-configuration-port config)) > "--base-path=" > (git-configuration-base-path config)) > ...) > > While it should be: (make-forkexec-constructor (list ...)) > > Also I have a question about the final command to start git daemon. It > would look like this: > > git daemon --syslog --informative-errors --port=9418 > --base-path=/var/git/repositories > > Is it intentional? I mean "/var/git/repositories" does not exist and > you don't create it at activation time, so the service (with the default > 'base-path') will fail anyway. > > But you create "/var/run/git-daemon". Is it really needed? I know > nothing about "git daemon", but IIUC it starts successfully without this > directory. > > -- > Alex -- ng0 For non-prism friendly talk find me on http://www.psyced.org