<div dir="ltr">there is already <b>Type=forking </b>in the service section</div><div class="gmail_extra"><br><br><div class="gmail_quote">2014/1/23 Mathieu Bridon <span dir="ltr"><<a href="mailto:bochecha@fedoraproject.org" target="_blank">bochecha@fedoraproject.org</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, 2014-01-23 at 10:51 +0100, Marwan Rabbâa wrote:<br>
> that is not very useful for me. /var/www/gitlab/script/sidekiq is just<br>
> a litle startup script for sidekiq<br>
> ********************************************<br>
> #!/usr/bin/env sh<br>
><br>
><br>
> cd /var/www/gitlab<br>
> /usr/local/bin/bundle exec sidekiq -q<br>
> post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e production -P /var/run/gitlab-sidekiq.pid -d -L /var/www/gitlab/log/sidekiq.log >> /var/www/gitlab/log/sidekiq.log 2>&1<br>

> ********************************************<br>
><br>
> When I run this script in a tty, I have a 0 exit code, I presume it<br>
> works (the process behind is started).<br>
<br>
</div>The way sidekiq is started, it forks itself as a daemon, and the parent<br>
process exits.<br>
<br>
Because you didn't specify the Type= option in the<br>
gitlab-sidekiq.service file, systemd assumes the default: Type=simple<br>
<br>
This means that systemd expects the main process to just start, and keep<br>
running forever. (systemd handles the forking)<br>
<br>
So when the parent process exits after forking, systemd assumes that the<br>
service failed.<br>
<br>
To fix this, you should use Type=forking in your gitlab-sidekiq.service<br>
file.<br>
<br>
I recommend you look at the systemd.service(5) manual page for more<br>
details.<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
Mathieu<br>
<br>
</font></span></blockquote></div><br></div>