Re: [systemd-devel] Service name accessible in a unit file?

2011-07-26 Thread Jóhann B. Guðmundsson
On 07/26/2011 07:37 PM, Lennart Poettering wrote: On Tue, 26.07.11 09:28, Honza Horak (hho...@redhat.com) wrote: Hi, I wonder if a name of service can be accessed in service file somehow? Let's have the following script (e.g. part of a former SysV init script): thisname=`basename $0` . /etc/

Re: [systemd-devel] Service name accessible in a unit file?

2011-07-26 Thread Lennart Poettering
On Tue, 26.07.11 09:28, Honza Horak (hho...@redhat.com) wrote: > Hi, > > I wonder if a name of service can be accessed in service file somehow? > > Let's have the following script (e.g. part of a former SysV init script): > > thisname=`basename $0` > . /etc/$thisname > > If I'd like to create

Re: [systemd-devel] Service name accessible in a unit file?

2011-07-26 Thread Honza Horak
On 07/26/2011 09:28 AM, Honza Horak wrote: If I'd like to create the same behavior in systemd, e.g.: EnvironmentFile=/etc/${thisname} Is it possible? I found the answer myself, sorry for noise. We can get this by %p, %n, etc., more info in http://0pointer.de/public/systemd-man/systemd.unit.

[systemd-devel] Service name accessible in a unit file?

2011-07-26 Thread Honza Horak
Hi, I wonder if a name of service can be accessed in service file somehow? Let's have the following script (e.g. part of a former SysV init script): thisname=`basename $0` . /etc/$thisname If I'd like to create the same behavior in systemd, e.g.: EnvironmentFile=/etc/${thisname} Is it possib