FS#35775 - [tomcat6][tomcat7] Use EnvironmentFile in the systemd service file

Attached to Project: Arch Linux
Opened by Lukas Jirkovsky (6xx) - Thursday, 13 June 2013, 13:24 GMT
Last edited by Guillaume ALAUX (galaux) - Saturday, 15 June 2013, 13:04 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Guillaume ALAUX (galaux)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:
It would be neat if tomcat6 and tomcat7 used environment files to set the necessary environment instead of setting up the environment in the .service file directly. An example of package that uses EnvironmentFile is nfs-utils package (nfsd.service).
This task depends upon

Closed by  Guillaume ALAUX (galaux)
Saturday, 15 June 2013, 13:04 GMT
Reason for closing:  Not a bug
Comment by Guillaume ALAUX (galaux) - Friday, 14 June 2013, 12:33 GMT
This used to be done using EnvironmentFile but I moved away from this as it seems to be discouraged by upstream [0]

From [0]:
"Although environment files are easy to use, upstream systemd recommends a different approach. Their recommendation for administrators who need to reconfigure systemd .service files is to copy them from /lib/systemd/system to /etc/systemd/system and modify them there. Unit files in /etc/systemd/system override those in /lib/systemd/system if they otherwise carry the same name."

What is the purpose of splitting this service files into 2 files? Any particular reason? Just to be clear, files used in EnvironmentFile are not bash file and thus should not be used anywhere else.

Last thing: I read about systemd support of config files using a "conf.d/" dir which would look like this but cannot find it anymore.

[0] http://fedoraproject.org/wiki/Packaging:Systemd#EnvironmentFiles_and_support_for_.2Fetc.2Fsysconfig_files
Comment by Lukas Jirkovsky (6xx) - Saturday, 15 June 2013, 11:07 GMT
It has nothing to do with environment file (not) being a bash file. It's just that I think splitting the configuration to the environment file is cleaner in a way that when you edit service file, there's a ton of clutter that has nothing to do with the configuration itself. The configuration has always been in configuration files in /etc, this is more like editing rc script to achieve the same. It's not really important though, just food for thought.
Comment by Guillaume ALAUX (galaux) - Saturday, 15 June 2013, 11:49 GMT
> It has nothing to do with environment file (not) being a bash file.
What I meant by that is that files in /etc/conf.d are bash like config files. Putting systemd emvironment files in there seems odd. Also as users could be tricked into thinking these could be used by regular bash scripts.

> I think splitting the configuration to the environment file is cleaner in a way that when you edit service file, there's a ton of clutter that has nothing to do with the configuration itself
Don't get me wrong, I'm totally in favor of using separate config files but it just seems in systemd's way, these service files are precisely the config files. They are not sourced but read by systemd to get details on how to handle services.

> The configuration has always been in configuration files in /etc
Well it still is as systemd's way is to customize this service file in /etc/systemd/system/.
Comment by Lukas Jirkovsky (6xx) - Saturday, 15 June 2013, 12:28 GMT
I'm not going to argue with that. I guess it's a matter of personal taste. And there's nothing stopping me to create own service file that uses EnvironmentFile, muhahaha.

Loading...