<div dir="ltr">I switched my Gentoo install over to systemd today and pretty much everything worked flawlessly. The only exception was CouchDB, which lacks systemd support in Portage, so I'm left writing my own service file.<div>

<br></div><div>I took a peak at the files for Fedora (<a href="http://pkgs.fedoraproject.org/cgit/couchdb.git/tree/couchdb.service">http://pkgs.fedoraproject.org/cgit/couchdb.git/tree/couchdb.service</a>) and Arch (<a href="https://projects.archlinux.org/svntogit/community.git/tree/trunk/couchdb.service?h=packages/couchdb">https://projects.archlinux.org/svntogit/community.git/tree/trunk/couchdb.service?h=packages/couchdb</a>) to get an idea of what it should look like. I copied the service from Arch, as it looked particularly appropriate:</div>

<div><br></div><div><br></div><div><pre style="padding:0px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);font-size:13px"><code>[Unit]
Description=CouchDB Server

[Service]
User=couchdb
Type=forking
PermissionsStartOnly=true
ExecStart=/usr/bin/couchdb -b -o /dev/null -e /dev/null
ExecStop=/usr/bin/couchdb -d

[Install]
WantedBy=multi-user.target</code></pre></div><div><br></div><div><br></div><div>However, there's a problem with this implementation. The original Gentoo init script created the folder /var/run/couchdb with the correct permissions for user couchdb at runtime using a helper function (checkpath). How can I do this with a systemd service?</div>

<div><br></div><div>The original Gentoo init (<a href="http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-db/couchdb/files/couchdb.init-4?view=markup">http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-db/couchdb/files/couchdb.init-4?view=markup</a>) and config (<a href="http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-db/couchdb/files/couchdb.conf-2?view=markup">http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-db/couchdb/files/couchdb.conf-2?view=markup</a>) files for reference.</div>

<div><br></div><div>Any help with this would be greatly appreciated.</div><div><br></div><div>Thanks,</div><div>Austin</div></div>