FS#41156 - [fluidsynth] systemd service file with environment file

Attached to Project: Arch Linux
Opened by Leonard de Ruijter (leonardder) - Thursday, 10 July 2014, 07:46 GMT
Last edited by Ray Rashif (schivmeister) - Thursday, 10 July 2014, 17:40 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Ray Rashif (schivmeister)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

In the current fluidsynt package, a systemd service file is included which requires manual tweaking in order to work. To me, this feels a bit ugly.
I have the following suggestion:
* add /etc/default/fluidsynth to the package which contains SOUNDFONT=""
* Add "EnvironmentFile=/etc/default/fluidsynth" to the [service] section for the systemd service
* change "ExecStart=/usr/bin/fluidsynth -is -a alsa -m alsa_seq -r 48000 # append soundfont path here" to "ExecStart=/usr/bin/fluidsynth -is -a alsa -m alsa_seq -r 48000 $SOUNDFONT"
This way, the systemd service doesn't have to be changed. IN any case, /usr/lib/systemd/system should be used for static systemd services, not for services which require patching before working.
This task depends upon

Closed by  Ray Rashif (schivmeister)
Thursday, 10 July 2014, 17:40 GMT
Reason for closing:  Fixed
Comment by Ray Rashif (schivmeister) - Thursday, 10 July 2014, 16:45 GMT
Thanks for reporting. You are absolutely right -- I had this in my TODO for a while. Note that you are not supposed to edit the unit in place, but copy it to /etc (in the relevant target) and make your changes. However, EnvironmentFile is certainly the only right way to go about this.

Anyway, the configuration will happen in /etc/conf.d as per convention, so basically I'm just going to bring back the old init-style conf with OPTS and a SOUNDFONT variable.
Comment by Ray Rashif (schivmeister) - Thursday, 10 July 2014, 17:22 GMT
Please test and confirm everything works as expected.
Comment by Leonard de Ruijter (leonardder) - Thursday, 10 July 2014, 17:33 GMT
It seems to do, thanks for the quick assistance

Loading...