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).
Created attachment 368618 [details] gimps systemd unit file
Created attachment 368620 [details] gimps systemd unit file (new version)
Created attachment 368622 [details] gimps systemd unit file (real new version) Oops!
Created attachment 368624 [details, diff] ebuild patch for systemd unit file addition
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.
(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.
(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.
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.
+*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) +