tips/Systemd unitgit-annexhttp://git-annex.branchable.com/tips/Systemd_unit/git-annexikiwiki2017-04-05T15:44:58Zautostart and foreground together doesn't seem to workhttp://git-annex.branchable.com/tips/Systemd_unit/comment_1_06399a293f08401032bef1b94f05547c/oberix2017-03-30T10:43:18Z2017-03-30T10:43:18Z
<p>With systemd using <code>--autostart --foreground</code> either ignore foreground or quit immediatelly.</p>
<p>I managed to have the process stay alive with <code>RemainAfterExit=on</code>:</p>
<pre><code>[Service]
User=%i
ExecStart=/usr/bin/git-annex assistant --autostart --foreground
ExecStop=/usr/bin/git-annex assistant --autostop
RemainAfterExit=on
Restart=on-failure
RestartSec=5
</code></pre>
<p>but git-annex processes does not maintain the <code>--foreground</code> option which is causing a lot of zombies in the long period (not totally clear why).</p>
<p>My current solution is to have a service for each annex repository and avoid <code>--autosart</code> but this is annoying because it require to pass the path as <code>%I</code> and wrap git-annex in bash script to get the repo owner as the user.</p>
comment 2http://git-annex.branchable.com/tips/Systemd_unit/comment_2_389a2b36c3115eb3342429b0b68ddef2/joey2017-04-05T15:44:58Z2017-04-05T15:43:21Z
<p>@oberix, the --autostart --foreground combination is only supported
properly since git-annex version 6.20170214. Before that, the --forground
was ignored when using --autostart.</p>