Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 499120 - sci-mathematics/gimps - add systemd unit
Summary: sci-mathematics/gimps - add systemd unit
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Thomas Kahle (RETIRED)
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: install-systemd-unit
  Show dependency tree
 
Reported: 2014-01-24 13:16 UTC by Paolo Pedroni
Modified: 2014-02-15 12:22 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ebuild patch for systemd unit file (gimps-27.9-r2.ebuild.patch,1.13 KB, patch)
2014-01-24 13:16 UTC, Paolo Pedroni
Details | Diff
gimps systemd unit file (gimps.service,537 bytes, text/plain)
2014-01-24 13:17 UTC, Paolo Pedroni
Details
gimps systemd unit file (new version) (gimps.service,537 bytes, text/plain)
2014-01-24 13:33 UTC, Paolo Pedroni
Details
gimps systemd unit file (real new version) (gimps.service,575 bytes, text/plain)
2014-01-24 13:35 UTC, Paolo Pedroni
Details
ebuild patch for systemd unit file addition (gimps-27.9-r2.ebuild.patch,1.12 KB, patch)
2014-01-24 13:45 UTC, Paolo Pedroni
Details | Diff
Latest version of systemd unit (gimps.service,307 bytes, text/plain)
2014-01-27 13:54 UTC, Paolo Pedroni
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paolo Pedroni 2014-01-24 13:16:42 UTC
Created attachment 368616 [details, diff]
ebuild patch for systemd unit file

Since I am going to try to convert my main system to systemd shortly I tried to write a systemd unit file for gimps that duplicates all the functionality of current OpenRC /etc/init.d/gimps.

I have never written a systemd unit file before, so any correction is welcome. This is _not_ intended to be put in the tree as is (unless completely correct, of course).
Comment 1 Paolo Pedroni 2014-01-24 13:17:11 UTC
Created attachment 368618 [details]
gimps systemd unit file
Comment 2 Paolo Pedroni 2014-01-24 13:33:31 UTC
Created attachment 368620 [details]
gimps systemd unit file (new version)
Comment 3 Paolo Pedroni 2014-01-24 13:35:26 UTC
Created attachment 368622 [details]
gimps systemd unit file (real new version)

Oops!
Comment 4 Paolo Pedroni 2014-01-24 13:45:37 UTC
Created attachment 368624 [details, diff]
ebuild patch for systemd unit file addition
Comment 5 Paolo Pedroni 2014-01-27 13:20:15 UTC
This service file is not going to work as-is (I tried it today). If I set User and Group to nobody (important security-wise, since I'm executing a downloaded binary file, after all) I cannot execute the commands in the ExecStartPre statements, because they need to be run as root.

If I remove the ExecStartPre statements, on the other hand, I lose the flexibility to move the configuration directory around (which can be useful for dual boot installations).

For the moment being I'm taking the second option, but I'd really like some suggestion on how I can get all the flexibility of the openrc startup script with the systemd service unit.
Comment 6 Thomas Kahle (RETIRED) gentoo-dev 2014-01-27 13:23:22 UTC
(In reply to Paolo Pedroni from comment #5)
> For the moment being I'm taking the second option, but I'd really like some
> suggestion on how I can get all the flexibility of the openrc startup script
> with the systemd service unit.

I have no clue about this stuff.  Let's see if systemd@g.o steps up.  Alternatively, ask on IRC, etc.
Comment 7 Paolo Pedroni 2014-01-27 13:31:18 UTC
(In reply to Thomas Kahle from comment #6)
> (In reply to Paolo Pedroni from comment #5)
> > For the moment being I'm taking the second option, but I'd really like some
> > suggestion on how I can get all the flexibility of the openrc startup script
> > with the systemd service unit.
> 
> I have no clue about this stuff.  Let's see if systemd@g.o steps up. 
> Alternatively, ask on IRC, etc.

It doesn't work without ExecStartPre statements either, I always get:
gimps.service: main process exited, code=exited, status=217/USER

I don't have a clue. Let's hope that systemd@g.o sees this and helps.
Comment 8 Paolo Pedroni 2014-01-27 13:54:32 UTC
Created attachment 368868 [details]
Latest version of systemd unit

Bare bones systemd unit. The client is started as root (bleah!), you can control the configuration directory, but there is verification of its existence or the presence of local configuration.

I don't like this very much but it's a start. Let's hope that systemd@g.o can help us.
Comment 9 Pacho Ramos gentoo-dev 2014-02-15 12:22:37 UTC
+*gimps-28.3-r1 (15 Feb 2014)
+
+  15 Feb 2014; Pacho Ramos <pacho@gentoo.org> +files/gimps.service,
+  +files/gimps.tmpfiles, +gimps-28.3-r1.ebuild:
+  Add unit file (#499120 by Paolo Pedroni)
+