Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 645200

Summary: sci-biology/foldingathome-7.4.4-r2: invalid quoting in systemd service file
Product: Gentoo Linux Reporter: Khumba <bog>
Component: Current packagesAssignee: Ian Stakenvicius (RETIRED) <axs>
Status: RESOLVED FIXED    
Severity: normal CC: sci-biology
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info

Description Khumba 2018-01-21 04:13:05 UTC
Created attachment 515544 [details]
emerge --info

The foldingathome ebuild creates a creates a foldingathome.service containing:

> ...
> [Service]
> WorkingDirectory="${EPREFIX}/opt/foldingathome"

This is unsupported syntax:

> # systemctl status foldingathome
> ● foldingathome.service - Folding@Home V7 Client
>    Loaded: error (Reason: Exec format error)
>    Active: inactive (dead)
>      Docs: https://folding.stanford.edu/home/the-software/
> 
> Jan 19 19:33:00 raph systemd[1]: /usr/lib/systemd/system/foldingathome.service:8: Working directory path '"/opt/foldingathome"' is not absolute.

The man pages don't make it clear to me what the required syntax is.  systemd.unit(5) talks about systemd-escape style escaping, specifically for generated unit names.  And systemd.service(5) talks about escaping (including double quotes) in the COMMAND LINES section, but that seems to be only for command lines.  Maybe quotes aren't necessary here, as in other fields like [Unit]/Description?
Comment 1 Khumba 2018-04-25 00:00:27 UTC
There's another issue with the service file.  The binaries specified by ExecStart=, ExecReload=, and ExecStop= must be absolute paths, see systemd.service(5):

> COMMAND LINES
>
> The command to execute must be an absolute path name. It may contain spaces, but control characters are not allowed.

Words in command lines *are* allowed to be quoted.
Comment 2 Larry the Git Cow gentoo-dev 2018-04-25 15:04:19 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=209abddaf0f7253cb29886cf5dba1d7ffcc14f5c

commit 209abddaf0f7253cb29886cf5dba1d7ffcc14f5c
Author:     Ian Stakenvicius <axs@gentoo.org>
AuthorDate: 2018-04-25 14:53:00 +0000
Commit:     Ian Stakenvicius <axs@gentoo.org>
CommitDate: 2018-04-25 14:54:31 +0000

    sci-biology/foldingathome: fix systemd unit
    
    This isn't a perfect fix since if the EPREFIX path contains characters that need
    to be quoted the paths will still fail, however when compared to a systemd
    unit that doesn't work at all this is significantly better than nothing.
    
    Bug: http://bugs.gentoo.org/645200
    Package-Manager: Portage-2.3.19, Repoman-2.3.6

 ...ingathome-7.4.4-r2.ebuild => foldingathome-7.4.4-r3.ebuild} | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)}
Comment 3 Ian Stakenvicius (RETIRED) gentoo-dev 2018-04-25 15:05:39 UTC
Thanks for looking into this Khumba!