[systemd-devel] How to source a variable file using systemd

2015-10-27 Thread Soumya Koduri
Hi, We have a use-case where in we have to read an environment variable (say ${MY_ENV_FILE}) from a file (say /etc/myconfig) and source ${MY_ENV_FILE} to read yet another environment variable (say ${MY_ENV_VAR} in our systemd service file. I first tried out below --

Re: [systemd-devel] How to source a variable file using systemd

2015-10-27 Thread Soumya Koduri
Thanks Richard & Mantas. That did the trick. -Soumya On 10/27/2015 04:11 PM, Richard Maw wrote: On Tue, Oct 27, 2015 at 04:05:18PM +0530, Soumya Koduri wrote: EnvironmentFile=/etc/myconfig ExecStart=/bin/bash -c 'source ${MY_ENV_FILE} && echo ${MY_ENV_VAR}' Systemd als

Re: [systemd-devel] How to source a variable file using systemd

2015-10-28 Thread Soumya Koduri
Thank you so much for your inputs. -Soumya On 10/27/2015 05:49 PM, Lennart Poettering wrote: On Tue, 27.10.15 16:05, Soumya Koduri (skod...@redhat.com) wrote: Hi, We have a use-case where in we have to read an environment variable (say ${MY_ENV_FILE}) from a file (say /etc/myconfig

[systemd-devel] Query regarding "EnvironmentFile"

2015-12-09 Thread Soumya Koduri
Hi, I have created a systemd.unit(nfs-ganesha.service) file as below : [Unit] After=nfs-ganesha-config.service Requires=nfs-ganesha-config.service [Service] EnvironmentFile=-/run/sysconfig/ganesha ExecStart=/usr/bin/ganesha.nfsd $OPTIONS ${EPOCH} ... My intention is to

Re: [systemd-devel] Query regarding "EnvironmentFile"

2015-12-09 Thread Soumya Koduri
On 12/10/2015 01:16 AM, Lennart Poettering wrote: On Wed, 09.12.15 18:27, Soumya Koduri (skod...@redhat.com) wrote: Hi, I have created a systemd.unit(nfs-ganesha.service) file as below : [Unit] After=nfs-ganesha-config.service Requires=nfs-ganesha-config.service [Service