Re: [systemd-devel] Is it possible to load unit files from paths other than default paths ?

2016-09-27 Thread Kai Krakow
Am Tue, 27 Sep 2016 06:33:40 +0300
schrieb Andrei Borzenkov :

> 27.09.2016 05:10, Kai Krakow пишет:
> > Am Mon, 26 Sep 2016 14:30:37 +0530
> > schrieb "Raghavendra. H. R" :
> >   
> >> Andrei,
> >>
> >> How to set SYSTEMD_UNIT_PATH in Systemd ?  
> > 
> > Maybe try "systemctl set-environment"? You may need to run
> > "systemctl daemon-reload" after this for the new unit files to pick
> > up. 
> 
> No, that does not work. It was already discussed previously. This is
> environment for services that are started by systemd, while you need
> to set it before starting systemd. This is challenging for something
> that runs as the very first process ever ... :)

If that stuff needs to run so isolated, one could try packaging it as
an nspawn container...


-- 
Regards,
Kai

Replies to list-only preferred.


___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Is it possible to load unit files from paths other than default paths ?

2016-09-26 Thread Andrei Borzenkov
27.09.2016 05:10, Kai Krakow пишет:
> Am Mon, 26 Sep 2016 14:30:37 +0530
> schrieb "Raghavendra. H. R" :
> 
>> Andrei,
>>
>> How to set SYSTEMD_UNIT_PATH in Systemd ?
> 
> Maybe try "systemctl set-environment"? You may need to run "systemctl
> daemon-reload" after this for the new unit files to pick up.
> 

No, that does not work. It was already discussed previously. This is
environment for services that are started by systemd, while you need to
set it before starting systemd. This is challenging for something that
runs as the very first process ever ... :)

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Is it possible to load unit files from paths other than default paths ?

2016-09-26 Thread Kai Krakow
Am Mon, 26 Sep 2016 14:30:37 +0530
schrieb "Raghavendra. H. R" :

> Andrei,
> 
> How to set SYSTEMD_UNIT_PATH in Systemd ?

Maybe try "systemctl set-environment"? You may need to run "systemctl
daemon-reload" after this for the new unit files to pick up.

BTW: Please stop top-posting... It's very inconvenient to follow your
messages with an NNTP reader.


> I checked about systemd source code in github. Please see this link
> 
> https://github.com/search?q=org%3Asystemd+systemd_unit_path=Code
> 
> Even in these source files they are doing getenv and setenv for
> SYSTEMD_UNIT_PATH. I dont see any conf file using which we can
> configure the environment variable.
> 
> 
> Regards,
> Raghu.
> 
> 
> --
> Regards,
> 
> Raghavendra. H. R
> (Raghu)
> 
> On Mon, Sep 26, 2016 at 1:59 PM, Andrei Borzenkov
>  wrote:
> 
> > On Mon, Sep 26, 2016 at 10:59 AM, Raghavendra. H. R
> >  wrote:  
> > > These are instructions which I tried.
> > >
> > > mkdir -p /BingoDast
> > > mount -t nfs -o nolock
> > > :/tftpboot/raghu/BingoDast /BingoDast
> > >
> > > export PATH=$PATH:/BingoDast/bin
> > > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/BingoDast/lib
> > > export SYSTEMD_UNIT_PATH=/BingoDast/units
> > > echo $SYSTEMD_UNIT_PATH
> > > /BingoDast/units
> > >
> > > systemctl start bingod.service
> > > Failed to start bingod.service: Unit bingod.service failed to
> > > load: No  
> > such  
> > > file or directory.
> > >  
> >
> > SYSTEMD_UNIT_PATH has to be set in environment of systemd, not
> > systemctl. 
> > > Other options which I tried for setting SYSTEMD_UNIT_PATH are
> > > given  
> > below.  
> > >
> > > 1. Just gave the environment variable directly on the console
> > >  SYSTEMD_UNIT_PATH=/BingoDast/units
> > >
> > > 2. Gave the environment variable along with DefaultEnvinronment
> > > tag DefaultEnvironment=SYSTEMD_UNIT_PATH=/BingoDast/units
> > >
> > >
> > > Regards,
> > > Raghu
> > >
> > >
> > > --
> > > Regards,
> > >
> > > Raghavendra. H. R
> > > (Raghu)
> > >
> > > On Mon, Sep 26, 2016 at 1:07 PM, Andrei Borzenkov
> > >  wrote:  
>  [...]  
> > raghuh...@gmail.com>  
>  [...]  
>  [...]  
> > this  
>  [...]  
>  [...]  
>  [...]  
> > arvidj...@gmail.com>  
>  [...]  
>  [...]  
>  [...]  
>  [...]  
>  [...]  
>  [...]  
>  [...]  
> > path  
>  [...]  
> > library.  
>  [...]  
>  [...]  
>  [...]  
> > the  
>  [...]  
>  [...]  
> > case  
>  [...]  
>  [...]  
>  [...]  
> > >
> > >  
> >  
> 



-- 
Regards,
Kai

Replies to list-only preferred.

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Is it possible to load unit files from paths other than default paths ?

2016-09-26 Thread Zbigniew Jędrzejewski-Szmek
On Wed, Sep 21, 2016 at 04:56:52PM +0530, Raghavendra. H. R wrote:
> Hi,
> I would like to create a service under a customized path Eg:/mnt and
> systemd should be able to pick my unit file from this.

Use 'systemctl link /opt/BingoGast/whatever.service'. This will create
a symlink that will tell systemd about your service file. You should
be able to do 'systemctl start whatever.service' after that.

Zbyszek
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Is it possible to load unit files from paths other than default paths ?

2016-09-26 Thread Andrei Borzenkov
On Mon, Sep 26, 2016 at 12:00 PM, Raghavendra. H. R  wrote:
> Andrei,
>
> How to set SYSTEMD_UNIT_PATH in Systemd ?
>

I already answered this in one of earlier replies.

> I checked about systemd source code in github. Please see this link
>
> https://github.com/search?q=org%3Asystemd+systemd_unit_path=Code
>
> Even in these source files they are doing getenv and setenv for
> SYSTEMD_UNIT_PATH. I dont see any conf file using which we can configure the
> environment variable.
>
>
> Regards,
> Raghu.
>
>
> --
> Regards,
>
> Raghavendra. H. R
> (Raghu)
>
> On Mon, Sep 26, 2016 at 1:59 PM, Andrei Borzenkov 
> wrote:
>>
>> On Mon, Sep 26, 2016 at 10:59 AM, Raghavendra. H. R 
>> wrote:
>> > These are instructions which I tried.
>> >
>> > mkdir -p /BingoDast
>> > mount -t nfs -o nolock :/tftpboot/raghu/BingoDast /BingoDast
>> >
>> > export PATH=$PATH:/BingoDast/bin
>> > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/BingoDast/lib
>> > export SYSTEMD_UNIT_PATH=/BingoDast/units
>> > echo $SYSTEMD_UNIT_PATH
>> > /BingoDast/units
>> >
>> > systemctl start bingod.service
>> > Failed to start bingod.service: Unit bingod.service failed to load: No
>> > such
>> > file or directory.
>> >
>>
>> SYSTEMD_UNIT_PATH has to be set in environment of systemd, not systemctl.
>>
>> > Other options which I tried for setting SYSTEMD_UNIT_PATH are given
>> > below.
>> >
>> > 1. Just gave the environment variable directly on the console
>> >  SYSTEMD_UNIT_PATH=/BingoDast/units
>> >
>> > 2. Gave the environment variable along with DefaultEnvinronment tag
>> >  DefaultEnvironment=SYSTEMD_UNIT_PATH=/BingoDast/units
>> >
>> >
>> > Regards,
>> > Raghu
>> >
>> >
>> > --
>> > Regards,
>> >
>> > Raghavendra. H. R
>> > (Raghu)
>> >
>> > On Mon, Sep 26, 2016 at 1:07 PM, Andrei Borzenkov 
>> > wrote:
>> >>
>> >> On Mon, Sep 26, 2016 at 10:06 AM, Raghavendra. H. R
>> >> 
>> >> wrote:
>> >> > But SYTEMD_UNIT_PATH isn't working. I added my executables path for
>> >> > this
>> >> > env
>> >> > variable but whatever I add isn't reflected for this variable. If I
>> >> > do
>> >> > echo
>> >>
>> >> Repeating this 100 times won't make it more clear. I already asked you
>> >> to paste exact commands and their output that you used to "add your
>> >> path for this env variable".
>> >>
>> >> > of $SYSTEMD_UNIT_PATH. Its all empty. My executables are not able to
>> >> > find
>> >> > the path and it is not running.
>> >> >
>> >> > --
>> >> > Regards,
>> >> >
>> >> > Raghavendra. H. R
>> >> > (Raghu)
>> >> >
>> >> > On Thu, Sep 22, 2016 at 12:26 PM, Andrei Borzenkov
>> >> > 
>> >> > wrote:
>> >> >>
>> >> >> On Thu, Sep 22, 2016 at 9:18 AM, Raghavendra. H. R
>> >> >> 
>> >> >> wrote:
>> >> >> > Thank you for the suggestions.
>> >> >> > But with this suggestion i.e., generator file, I again need to
>> >> >> > add/modify
>> >> >> > some files.
>> >> >> >
>> >> >>
>> >> >> You need to add/modify some files to implement your service anyway.
>> >> >> I
>> >> >> do not see how one more file is a problem so far.
>> >> >>
>> >> >> > All I'm looking into is I mount my binaries and unit files under
>> >> >> > /mnt.
>> >> >> > By
>> >> >> > setting any environment variable like SYSTEMD_UNIT_PATH, systemd
>> >> >> > should
>> >> >> > pick
>> >> >> > the unit files from /mnt and execute my binaries as per the
>> >> >> > instructions
>> >> >> > given in unit file.
>> >> >> >
>> >> >>
>> >> >> Which is exactly what it does. You just need to set variable in
>> >> >> environment of systemd.
>> >> >>
>> >> >> > In normal init.d systems, we have environment variables like PATH
>> >> >> > &
>> >> >> > LD_LIBRARY_PATH.
>> >> >> > No matter where I place my new executable or library, adding new
>> >> >> > path
>> >> >> > into
>> >> >> > these environment variables is enough to execute or link the
>> >> >> > library.
>> >> >> >
>> >> >> > Probably this kind of facility is not available in Systemd init
>> >> >> > systems.
>> >> >> >
>> >> >> > --
>> >> >> > Regards,
>> >> >> >
>> >> >> > Raghavendra. H. R
>> >> >> > (Raghu)
>> >> >> >
>> >> >> > On Wed, Sep 21, 2016 at 10:40 PM, Andrei Borzenkov
>> >> >> > 
>> >> >> > wrote:
>> >> >> >>
>> >> >> >> 21.09.2016 14:26, Raghavendra. H. R пишет:
>> >> >> >> > Hi,
>> >> >> >> >
>> >> >> >> > I'm newbie with systemd boot system and I need help in
>> >> >> >> > resolving
>> >> >> >> > one
>> >> >> >> > issue.
>> >> >> >> >
>> >> >> >> > I would like to create a service under a customized path
>> >> >> >> > Eg:/mnt
>> >> >> >> > and
>> >> >> >> > systemd should be able to pick my unit file from this.
>> >> >> >> >
>> >> >> >> > I tried by setting *Environment=SYSTEMD_UNIT_PATH=/mnt *from
>> >> >> >> > the
>> >> >> >> > console
>> >> >> >>
>> >> >> >> This should be set in environment of srarted systemd, which in
>> >> >> >> case
>> >> >> >> of
>> >> >> >> systemwide init effectively 

Re: [systemd-devel] Is it possible to load unit files from paths other than default paths ?

2016-09-26 Thread Raghavendra. H. R
Andrei,

How to set SYSTEMD_UNIT_PATH in Systemd ?

I checked about systemd source code in github. Please see this link

https://github.com/search?q=org%3Asystemd+systemd_unit_path=Code

Even in these source files they are doing getenv and setenv for
SYSTEMD_UNIT_PATH. I dont see any conf file using which we can configure
the environment variable.


Regards,
Raghu.


--
Regards,

Raghavendra. H. R
(Raghu)

On Mon, Sep 26, 2016 at 1:59 PM, Andrei Borzenkov 
wrote:

> On Mon, Sep 26, 2016 at 10:59 AM, Raghavendra. H. R 
> wrote:
> > These are instructions which I tried.
> >
> > mkdir -p /BingoDast
> > mount -t nfs -o nolock :/tftpboot/raghu/BingoDast /BingoDast
> >
> > export PATH=$PATH:/BingoDast/bin
> > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/BingoDast/lib
> > export SYSTEMD_UNIT_PATH=/BingoDast/units
> > echo $SYSTEMD_UNIT_PATH
> > /BingoDast/units
> >
> > systemctl start bingod.service
> > Failed to start bingod.service: Unit bingod.service failed to load: No
> such
> > file or directory.
> >
>
> SYSTEMD_UNIT_PATH has to be set in environment of systemd, not systemctl.
>
> > Other options which I tried for setting SYSTEMD_UNIT_PATH are given
> below.
> >
> > 1. Just gave the environment variable directly on the console
> >  SYSTEMD_UNIT_PATH=/BingoDast/units
> >
> > 2. Gave the environment variable along with DefaultEnvinronment tag
> >  DefaultEnvironment=SYSTEMD_UNIT_PATH=/BingoDast/units
> >
> >
> > Regards,
> > Raghu
> >
> >
> > --
> > Regards,
> >
> > Raghavendra. H. R
> > (Raghu)
> >
> > On Mon, Sep 26, 2016 at 1:07 PM, Andrei Borzenkov 
> > wrote:
> >>
> >> On Mon, Sep 26, 2016 at 10:06 AM, Raghavendra. H. R <
> raghuh...@gmail.com>
> >> wrote:
> >> > But SYTEMD_UNIT_PATH isn't working. I added my executables path for
> this
> >> > env
> >> > variable but whatever I add isn't reflected for this variable. If I do
> >> > echo
> >>
> >> Repeating this 100 times won't make it more clear. I already asked you
> >> to paste exact commands and their output that you used to "add your
> >> path for this env variable".
> >>
> >> > of $SYSTEMD_UNIT_PATH. Its all empty. My executables are not able to
> >> > find
> >> > the path and it is not running.
> >> >
> >> > --
> >> > Regards,
> >> >
> >> > Raghavendra. H. R
> >> > (Raghu)
> >> >
> >> > On Thu, Sep 22, 2016 at 12:26 PM, Andrei Borzenkov <
> arvidj...@gmail.com>
> >> > wrote:
> >> >>
> >> >> On Thu, Sep 22, 2016 at 9:18 AM, Raghavendra. H. R
> >> >> 
> >> >> wrote:
> >> >> > Thank you for the suggestions.
> >> >> > But with this suggestion i.e., generator file, I again need to
> >> >> > add/modify
> >> >> > some files.
> >> >> >
> >> >>
> >> >> You need to add/modify some files to implement your service anyway. I
> >> >> do not see how one more file is a problem so far.
> >> >>
> >> >> > All I'm looking into is I mount my binaries and unit files under
> >> >> > /mnt.
> >> >> > By
> >> >> > setting any environment variable like SYSTEMD_UNIT_PATH, systemd
> >> >> > should
> >> >> > pick
> >> >> > the unit files from /mnt and execute my binaries as per the
> >> >> > instructions
> >> >> > given in unit file.
> >> >> >
> >> >>
> >> >> Which is exactly what it does. You just need to set variable in
> >> >> environment of systemd.
> >> >>
> >> >> > In normal init.d systems, we have environment variables like PATH &
> >> >> > LD_LIBRARY_PATH.
> >> >> > No matter where I place my new executable or library, adding new
> path
> >> >> > into
> >> >> > these environment variables is enough to execute or link the
> library.
> >> >> >
> >> >> > Probably this kind of facility is not available in Systemd init
> >> >> > systems.
> >> >> >
> >> >> > --
> >> >> > Regards,
> >> >> >
> >> >> > Raghavendra. H. R
> >> >> > (Raghu)
> >> >> >
> >> >> > On Wed, Sep 21, 2016 at 10:40 PM, Andrei Borzenkov
> >> >> > 
> >> >> > wrote:
> >> >> >>
> >> >> >> 21.09.2016 14:26, Raghavendra. H. R пишет:
> >> >> >> > Hi,
> >> >> >> >
> >> >> >> > I'm newbie with systemd boot system and I need help in resolving
> >> >> >> > one
> >> >> >> > issue.
> >> >> >> >
> >> >> >> > I would like to create a service under a customized path Eg:/mnt
> >> >> >> > and
> >> >> >> > systemd should be able to pick my unit file from this.
> >> >> >> >
> >> >> >> > I tried by setting *Environment=SYSTEMD_UNIT_PATH=/mnt *from
> the
> >> >> >> > console
> >> >> >>
> >> >> >> This should be set in environment of srarted systemd, which in
> case
> >> >> >> of
> >> >> >> systemwide init effectively means either you need to use some
> >> >> >> wrapper
> >> >> >> to
> >> >> >> set it and exec systemd or hack initrd.
> >> >> >>
> >> >> >> Also SYSTEMD_UNIT_PATH does not really play nicely with priorities
> >> >> >> of
> >> >> >> unit locations (run-time vs. sysadmin vs. shipped).
> >> >> >>
> >> >> >> May be it is simpler to install generator that copies your unit
> >> >> >> definition in standard location. This 

Re: [systemd-devel] Is it possible to load unit files from paths other than default paths ?

2016-09-26 Thread Andrei Borzenkov
On Mon, Sep 26, 2016 at 10:59 AM, Raghavendra. H. R  wrote:
> These are instructions which I tried.
>
> mkdir -p /BingoDast
> mount -t nfs -o nolock :/tftpboot/raghu/BingoDast /BingoDast
>
> export PATH=$PATH:/BingoDast/bin
> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/BingoDast/lib
> export SYSTEMD_UNIT_PATH=/BingoDast/units
> echo $SYSTEMD_UNIT_PATH
> /BingoDast/units
>
> systemctl start bingod.service
> Failed to start bingod.service: Unit bingod.service failed to load: No such
> file or directory.
>

SYSTEMD_UNIT_PATH has to be set in environment of systemd, not systemctl.

> Other options which I tried for setting SYSTEMD_UNIT_PATH are given below.
>
> 1. Just gave the environment variable directly on the console
>  SYSTEMD_UNIT_PATH=/BingoDast/units
>
> 2. Gave the environment variable along with DefaultEnvinronment tag
>  DefaultEnvironment=SYSTEMD_UNIT_PATH=/BingoDast/units
>
>
> Regards,
> Raghu
>
>
> --
> Regards,
>
> Raghavendra. H. R
> (Raghu)
>
> On Mon, Sep 26, 2016 at 1:07 PM, Andrei Borzenkov 
> wrote:
>>
>> On Mon, Sep 26, 2016 at 10:06 AM, Raghavendra. H. R 
>> wrote:
>> > But SYTEMD_UNIT_PATH isn't working. I added my executables path for this
>> > env
>> > variable but whatever I add isn't reflected for this variable. If I do
>> > echo
>>
>> Repeating this 100 times won't make it more clear. I already asked you
>> to paste exact commands and their output that you used to "add your
>> path for this env variable".
>>
>> > of $SYSTEMD_UNIT_PATH. Its all empty. My executables are not able to
>> > find
>> > the path and it is not running.
>> >
>> > --
>> > Regards,
>> >
>> > Raghavendra. H. R
>> > (Raghu)
>> >
>> > On Thu, Sep 22, 2016 at 12:26 PM, Andrei Borzenkov 
>> > wrote:
>> >>
>> >> On Thu, Sep 22, 2016 at 9:18 AM, Raghavendra. H. R
>> >> 
>> >> wrote:
>> >> > Thank you for the suggestions.
>> >> > But with this suggestion i.e., generator file, I again need to
>> >> > add/modify
>> >> > some files.
>> >> >
>> >>
>> >> You need to add/modify some files to implement your service anyway. I
>> >> do not see how one more file is a problem so far.
>> >>
>> >> > All I'm looking into is I mount my binaries and unit files under
>> >> > /mnt.
>> >> > By
>> >> > setting any environment variable like SYSTEMD_UNIT_PATH, systemd
>> >> > should
>> >> > pick
>> >> > the unit files from /mnt and execute my binaries as per the
>> >> > instructions
>> >> > given in unit file.
>> >> >
>> >>
>> >> Which is exactly what it does. You just need to set variable in
>> >> environment of systemd.
>> >>
>> >> > In normal init.d systems, we have environment variables like PATH &
>> >> > LD_LIBRARY_PATH.
>> >> > No matter where I place my new executable or library, adding new path
>> >> > into
>> >> > these environment variables is enough to execute or link the library.
>> >> >
>> >> > Probably this kind of facility is not available in Systemd init
>> >> > systems.
>> >> >
>> >> > --
>> >> > Regards,
>> >> >
>> >> > Raghavendra. H. R
>> >> > (Raghu)
>> >> >
>> >> > On Wed, Sep 21, 2016 at 10:40 PM, Andrei Borzenkov
>> >> > 
>> >> > wrote:
>> >> >>
>> >> >> 21.09.2016 14:26, Raghavendra. H. R пишет:
>> >> >> > Hi,
>> >> >> >
>> >> >> > I'm newbie with systemd boot system and I need help in resolving
>> >> >> > one
>> >> >> > issue.
>> >> >> >
>> >> >> > I would like to create a service under a customized path Eg:/mnt
>> >> >> > and
>> >> >> > systemd should be able to pick my unit file from this.
>> >> >> >
>> >> >> > I tried by setting *Environment=SYSTEMD_UNIT_PATH=/mnt *from the
>> >> >> > console
>> >> >>
>> >> >> This should be set in environment of srarted systemd, which in case
>> >> >> of
>> >> >> systemwide init effectively means either you need to use some
>> >> >> wrapper
>> >> >> to
>> >> >> set it and exec systemd or hack initrd.
>> >> >>
>> >> >> Also SYSTEMD_UNIT_PATH does not really play nicely with priorities
>> >> >> of
>> >> >> unit locations (run-time vs. sysadmin vs. shipped).
>> >> >>
>> >> >> May be it is simpler to install generator that copies your unit
>> >> >> definition in standard location. This guarantees it is available
>> >> >> before
>> >> >> systemd starts.
>> >> >
>> >> >
>> >
>> >
>
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Is it possible to load unit files from paths other than default paths ?

2016-09-26 Thread Raghavendra. H. R
These are instructions which I tried.

mkdir -p /BingoDast
mount -t nfs -o nolock :/tftpboot/raghu/BingoDast /BingoDast

export PATH=$PATH:/BingoDast/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/BingoDast/lib
export SYSTEMD_UNIT_PATH=/BingoDast/units
echo $SYSTEMD_UNIT_PATH
/BingoDast/units

systemctl start bingod.service
*Failed to start bingod.service: Unit bingod.service failed to load: No
such file or directory.*

Other options which I tried for setting SYSTEMD_UNIT_PATH are given below.

1. Just gave the environment variable directly on the console
 SYSTEMD_UNIT_PATH=/BingoDast/units

2. Gave the environment variable along with DefaultEnvinronment tag
 DefaultEnvironment=SYSTEMD_UNIT_PATH=/BingoDast/units


Regards,
Raghu


--
Regards,

Raghavendra. H. R
(Raghu)

On Mon, Sep 26, 2016 at 1:07 PM, Andrei Borzenkov 
wrote:

> On Mon, Sep 26, 2016 at 10:06 AM, Raghavendra. H. R 
> wrote:
> > But SYTEMD_UNIT_PATH isn't working. I added my executables path for this
> env
> > variable but whatever I add isn't reflected for this variable. If I do
> echo
>
> Repeating this 100 times won't make it more clear. I already asked you
> to paste exact commands and their output that you used to "add your
> path for this env variable".
>
> > of $SYSTEMD_UNIT_PATH. Its all empty. My executables are not able to find
> > the path and it is not running.
> >
> > --
> > Regards,
> >
> > Raghavendra. H. R
> > (Raghu)
> >
> > On Thu, Sep 22, 2016 at 12:26 PM, Andrei Borzenkov 
> > wrote:
> >>
> >> On Thu, Sep 22, 2016 at 9:18 AM, Raghavendra. H. R  >
> >> wrote:
> >> > Thank you for the suggestions.
> >> > But with this suggestion i.e., generator file, I again need to
> >> > add/modify
> >> > some files.
> >> >
> >>
> >> You need to add/modify some files to implement your service anyway. I
> >> do not see how one more file is a problem so far.
> >>
> >> > All I'm looking into is I mount my binaries and unit files under /mnt.
> >> > By
> >> > setting any environment variable like SYSTEMD_UNIT_PATH, systemd
> should
> >> > pick
> >> > the unit files from /mnt and execute my binaries as per the
> instructions
> >> > given in unit file.
> >> >
> >>
> >> Which is exactly what it does. You just need to set variable in
> >> environment of systemd.
> >>
> >> > In normal init.d systems, we have environment variables like PATH &
> >> > LD_LIBRARY_PATH.
> >> > No matter where I place my new executable or library, adding new path
> >> > into
> >> > these environment variables is enough to execute or link the library.
> >> >
> >> > Probably this kind of facility is not available in Systemd init
> systems.
> >> >
> >> > --
> >> > Regards,
> >> >
> >> > Raghavendra. H. R
> >> > (Raghu)
> >> >
> >> > On Wed, Sep 21, 2016 at 10:40 PM, Andrei Borzenkov <
> arvidj...@gmail.com>
> >> > wrote:
> >> >>
> >> >> 21.09.2016 14:26, Raghavendra. H. R пишет:
> >> >> > Hi,
> >> >> >
> >> >> > I'm newbie with systemd boot system and I need help in resolving
> one
> >> >> > issue.
> >> >> >
> >> >> > I would like to create a service under a customized path Eg:/mnt
> and
> >> >> > systemd should be able to pick my unit file from this.
> >> >> >
> >> >> > I tried by setting *Environment=SYSTEMD_UNIT_PATH=/mnt *from the
> >> >> > console
> >> >>
> >> >> This should be set in environment of srarted systemd, which in case
> of
> >> >> systemwide init effectively means either you need to use some wrapper
> >> >> to
> >> >> set it and exec systemd or hack initrd.
> >> >>
> >> >> Also SYSTEMD_UNIT_PATH does not really play nicely with priorities of
> >> >> unit locations (run-time vs. sysadmin vs. shipped).
> >> >>
> >> >> May be it is simpler to install generator that copies your unit
> >> >> definition in standard location. This guarantees it is available
> before
> >> >> systemd starts.
> >> >
> >> >
> >
> >
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Is it possible to load unit files from paths other than default paths ?

2016-09-26 Thread Andrei Borzenkov
On Mon, Sep 26, 2016 at 10:06 AM, Raghavendra. H. R  wrote:
> But SYTEMD_UNIT_PATH isn't working. I added my executables path for this env
> variable but whatever I add isn't reflected for this variable. If I do echo

Repeating this 100 times won't make it more clear. I already asked you
to paste exact commands and their output that you used to "add your
path for this env variable".

> of $SYSTEMD_UNIT_PATH. Its all empty. My executables are not able to find
> the path and it is not running.
>
> --
> Regards,
>
> Raghavendra. H. R
> (Raghu)
>
> On Thu, Sep 22, 2016 at 12:26 PM, Andrei Borzenkov 
> wrote:
>>
>> On Thu, Sep 22, 2016 at 9:18 AM, Raghavendra. H. R 
>> wrote:
>> > Thank you for the suggestions.
>> > But with this suggestion i.e., generator file, I again need to
>> > add/modify
>> > some files.
>> >
>>
>> You need to add/modify some files to implement your service anyway. I
>> do not see how one more file is a problem so far.
>>
>> > All I'm looking into is I mount my binaries and unit files under /mnt.
>> > By
>> > setting any environment variable like SYSTEMD_UNIT_PATH, systemd should
>> > pick
>> > the unit files from /mnt and execute my binaries as per the instructions
>> > given in unit file.
>> >
>>
>> Which is exactly what it does. You just need to set variable in
>> environment of systemd.
>>
>> > In normal init.d systems, we have environment variables like PATH &
>> > LD_LIBRARY_PATH.
>> > No matter where I place my new executable or library, adding new path
>> > into
>> > these environment variables is enough to execute or link the library.
>> >
>> > Probably this kind of facility is not available in Systemd init systems.
>> >
>> > --
>> > Regards,
>> >
>> > Raghavendra. H. R
>> > (Raghu)
>> >
>> > On Wed, Sep 21, 2016 at 10:40 PM, Andrei Borzenkov 
>> > wrote:
>> >>
>> >> 21.09.2016 14:26, Raghavendra. H. R пишет:
>> >> > Hi,
>> >> >
>> >> > I'm newbie with systemd boot system and I need help in resolving one
>> >> > issue.
>> >> >
>> >> > I would like to create a service under a customized path Eg:/mnt and
>> >> > systemd should be able to pick my unit file from this.
>> >> >
>> >> > I tried by setting *Environment=SYSTEMD_UNIT_PATH=/mnt *from the
>> >> > console
>> >>
>> >> This should be set in environment of srarted systemd, which in case of
>> >> systemwide init effectively means either you need to use some wrapper
>> >> to
>> >> set it and exec systemd or hack initrd.
>> >>
>> >> Also SYSTEMD_UNIT_PATH does not really play nicely with priorities of
>> >> unit locations (run-time vs. sysadmin vs. shipped).
>> >>
>> >> May be it is simpler to install generator that copies your unit
>> >> definition in standard location. This guarantees it is available before
>> >> systemd starts.
>> >
>> >
>
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Is it possible to load unit files from paths other than default paths ?

2016-09-26 Thread Raghavendra. H. R
But SYTEMD_UNIT_PATH isn't working. I added my executables path for this
env variable but whatever I add isn't reflected for this variable. If I do
echo of $SYSTEMD_UNIT_PATH. Its all empty. My executables are not able to
find the path and it is not running.

--
Regards,

Raghavendra. H. R
(Raghu)

On Thu, Sep 22, 2016 at 12:26 PM, Andrei Borzenkov 
wrote:

> On Thu, Sep 22, 2016 at 9:18 AM, Raghavendra. H. R 
> wrote:
> > Thank you for the suggestions.
> > But with this suggestion i.e., generator file, I again need to add/modify
> > some files.
> >
>
> You need to add/modify some files to implement your service anyway. I
> do not see how one more file is a problem so far.
>
> > All I'm looking into is I mount my binaries and unit files under /mnt. By
> > setting any environment variable like SYSTEMD_UNIT_PATH, systemd should
> pick
> > the unit files from /mnt and execute my binaries as per the instructions
> > given in unit file.
> >
>
> Which is exactly what it does. You just need to set variable in
> environment of systemd.
>
> > In normal init.d systems, we have environment variables like PATH &
> > LD_LIBRARY_PATH.
> > No matter where I place my new executable or library, adding new path
> into
> > these environment variables is enough to execute or link the library.
> >
> > Probably this kind of facility is not available in Systemd init systems.
> >
> > --
> > Regards,
> >
> > Raghavendra. H. R
> > (Raghu)
> >
> > On Wed, Sep 21, 2016 at 10:40 PM, Andrei Borzenkov 
> > wrote:
> >>
> >> 21.09.2016 14:26, Raghavendra. H. R пишет:
> >> > Hi,
> >> >
> >> > I'm newbie with systemd boot system and I need help in resolving one
> >> > issue.
> >> >
> >> > I would like to create a service under a customized path Eg:/mnt and
> >> > systemd should be able to pick my unit file from this.
> >> >
> >> > I tried by setting *Environment=SYSTEMD_UNIT_PATH=/mnt *from the
> >> > console
> >>
> >> This should be set in environment of srarted systemd, which in case of
> >> systemwide init effectively means either you need to use some wrapper to
> >> set it and exec systemd or hack initrd.
> >>
> >> Also SYSTEMD_UNIT_PATH does not really play nicely with priorities of
> >> unit locations (run-time vs. sysadmin vs. shipped).
> >>
> >> May be it is simpler to install generator that copies your unit
> >> definition in standard location. This guarantees it is available before
> >> systemd starts.
> >
> >
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Is it possible to load unit files from paths other than default paths ?

2016-09-26 Thread Raghavendra. H. R
I will explain you my problem statement.

I want to provide a piece of executable to my third party. Folder structure
of my output is something like this.
 /BingoDast
 |___
/BingoDast/bin/   ---> this contains exectuables
 |___
/BingoDast/lib/ > this contains required libraries.
 |___
/BingoDast/Units/  > this contains unit files which runs my
executables

Now my third party don't want anything else apart from this package. And he
doesn't want to add any other files like generator files or they dont want
to modify any unit files existing.

Thirdparty is expecting is a commands like

export PATH=$PATH:/BingoDast/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/BingoDast/lib

for executables and libraries. Similar to run they need to have a
environment variable path like for Eg:
 export SYSTEMD_UNIT_PATH=/BingoDast/Units
and he should be able to start, stop the unit files available under
/BingoDast/Units folder.

But when I tried setting SYSTEMD_UNIT_PATH which is empty in case, value
set for this is not reflecting.

Why this value given to this environment variable is not working

Regards.
Raghu

--
Regards,

Raghavendra. H. R
(Raghu)

On Fri, Sep 23, 2016 at 12:00 PM, Kai Krakow  wrote:

> Am Thu, 22 Sep 2016 11:43:56 +0530
> schrieb "Raghavendra. H. R" :
>
> > Thank you for the suggestions.
> > But with this suggestion I need to run as user something like that.
> >
> > In normal init.d systems, we have environment variables like PATH &
> > LD_LIBRARY_PATH.
> > No matter where I place my new executable or library, adding that
> > path into these environment variables is enough to execute or link
> > the library.
> >
> > Probably this kind of facility is not available in Systemd init
> > systems.
>
> Then this is like asking how sysvinit could load files from other
> locations than /etc/init.d. I don't think that is possible. To solve
> this, one copies the init scripts from where they are to init.d and
> then just enables them. Tip: systemd works the same.
>
> Adding a location where init scripts reside to PATH is just not exactly
> what would work during boot. You are just exploiting and side effect
> of /etc/init.d being scripts and not pure configuration. Service files
> for systemd are configuration. Actually, this trick won't solve startup
> dependencies as sysvinit systems only look at that directory (or the
> runlevel directories where you'd symlink your scripts which is what
> you'd do in systemd, too: symlink the services).
>
> If this is how you do it, create a generator which creates a service
> files for each script in a directory. Gentoo has something
> for /etc/local.d that works this way. Another way would be (if the copy
> source is already systemd service files) to just copy those with the
> generator. But that was already suggested.
>
> Here's the template to get you going:
> https://gitweb.gentoo.org/proj/gentoo-systemd-integration.git/tree/system-
> generators/gentoo-local-generator
>
> It expects /etc/local.d/*.{start,stop} bash scripts. I think it is easy
> to adapt for you.
>
> > On Thu, Sep 22, 2016 at 12:34 AM, Kai Krakow 
> > wrote:
> >
> > > Am Wed, 21 Sep 2016 16:56:52 +0530
> > > schrieb "Raghavendra. H. R" :
> > >
> > > > Hi,
> > > >
> > > > I'm newbie with systemd boot system and I need help in resolving
> > > > one issue.
> > > >
> > > > I would like to create a service under a customized path Eg:/mnt
> > > > and systemd should be able to pick my unit file from this.
> > > >
> > > > I tried by setting *Environment=SYSTEMD_UNIT_PATH=/mnt *from the
> > > > console but it didnt help and found the error *"Failed to start
> > > > startup.service: Unit startup.service failed to load: No such
> > > > file or directory."*
> > > >
> > > >
> > > > Is it possible to achieve this ?
> > >
> > > Not sure if this helps you, i.e. is appropriate for your use-case...
> > >
> > > But if the directory happens to be a home directory and the services
> > > are designed to be run as user, you could make the service files go
> > > into $HOME/.config/systemd/user/ (or symlink this to your
> > > mountpoint) and enable linger on the user (loginctl enable-linger
> > > $USER).
> > >
> > > You can then manage these units as the user through "system --user
> > > {start,stop,enable,...}" (only with real login sessions, not through
> > > sudo -iu $USER, but ssh would work).
> > >
> > > --
> > > Regards,
> > > Kai
> > >
> > > Replies to list-only preferred.
> > >
> > > ___
> > > systemd-devel mailing list
> > > systemd-devel@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/systemd-devel
> > >
> >
>
>
>
>
> --
> Regards,
> Kai
>
> Replies to list-only preferred.
>
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> 

Re: [systemd-devel] Is it possible to load unit files from paths other than default paths ?

2016-09-23 Thread Kai Krakow
Am Thu, 22 Sep 2016 11:43:56 +0530
schrieb "Raghavendra. H. R" :

> Thank you for the suggestions.
> But with this suggestion I need to run as user something like that.
> 
> In normal init.d systems, we have environment variables like PATH &
> LD_LIBRARY_PATH.
> No matter where I place my new executable or library, adding that
> path into these environment variables is enough to execute or link
> the library.
> 
> Probably this kind of facility is not available in Systemd init
> systems.

Then this is like asking how sysvinit could load files from other
locations than /etc/init.d. I don't think that is possible. To solve
this, one copies the init scripts from where they are to init.d and
then just enables them. Tip: systemd works the same.

Adding a location where init scripts reside to PATH is just not exactly
what would work during boot. You are just exploiting and side effect
of /etc/init.d being scripts and not pure configuration. Service files
for systemd are configuration. Actually, this trick won't solve startup
dependencies as sysvinit systems only look at that directory (or the
runlevel directories where you'd symlink your scripts which is what
you'd do in systemd, too: symlink the services).

If this is how you do it, create a generator which creates a service
files for each script in a directory. Gentoo has something
for /etc/local.d that works this way. Another way would be (if the copy
source is already systemd service files) to just copy those with the
generator. But that was already suggested.

Here's the template to get you going:
https://gitweb.gentoo.org/proj/gentoo-systemd-integration.git/tree/system-generators/gentoo-local-generator

It expects /etc/local.d/*.{start,stop} bash scripts. I think it is easy
to adapt for you.

> On Thu, Sep 22, 2016 at 12:34 AM, Kai Krakow 
> wrote:
> 
> > Am Wed, 21 Sep 2016 16:56:52 +0530
> > schrieb "Raghavendra. H. R" :
> >  
> > > Hi,
> > >
> > > I'm newbie with systemd boot system and I need help in resolving
> > > one issue.
> > >
> > > I would like to create a service under a customized path Eg:/mnt
> > > and systemd should be able to pick my unit file from this.
> > >
> > > I tried by setting *Environment=SYSTEMD_UNIT_PATH=/mnt *from the
> > > console but it didnt help and found the error *"Failed to start
> > > startup.service: Unit startup.service failed to load: No such
> > > file or directory."*
> > >
> > >
> > > Is it possible to achieve this ?  
> >
> > Not sure if this helps you, i.e. is appropriate for your use-case...
> >
> > But if the directory happens to be a home directory and the services
> > are designed to be run as user, you could make the service files go
> > into $HOME/.config/systemd/user/ (or symlink this to your
> > mountpoint) and enable linger on the user (loginctl enable-linger
> > $USER).
> >
> > You can then manage these units as the user through "system --user
> > {start,stop,enable,...}" (only with real login sessions, not through
> > sudo -iu $USER, but ssh would work).
> >
> > --
> > Regards,
> > Kai
> >
> > Replies to list-only preferred.
> >
> > ___
> > systemd-devel mailing list
> > systemd-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/systemd-devel
> >  
> 




-- 
Regards,
Kai

Replies to list-only preferred.

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Is it possible to load unit files from paths other than default paths ?

2016-09-22 Thread Mantas Mikulėnas
On Thu, Sep 22, 2016 at 9:13 AM, Raghavendra. H. R 
wrote:

> Thank you for the suggestions.
> But with this suggestion I need to run as user something like that.
>
> In normal init.d systems, we have environment variables like PATH &
> LD_LIBRARY_PATH.
> No matter where I place my new executable or library, adding that path
> into these environment variables is enough to execute or link the library.
>

Oh, sure, you still have PATH and LD_LIBRARY_PATH. But you weren't asking
about *executables*, you were asking about *service scripts*, and in normal
init.d systems you *don't* have anything like INITSCRIPT_PATH either, do
you? `service` uses /etc/init.d, the boot process uses /etc/rc[2345].d, and
that's it. Isn't it?

-- 
Mantas Mikulėnas 
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Is it possible to load unit files from paths other than default paths ?

2016-09-22 Thread Andrei Borzenkov
On Thu, Sep 22, 2016 at 9:18 AM, Raghavendra. H. R  wrote:
> Thank you for the suggestions.
> But with this suggestion i.e., generator file, I again need to add/modify
> some files.
>

You need to add/modify some files to implement your service anyway. I
do not see how one more file is a problem so far.

> All I'm looking into is I mount my binaries and unit files under /mnt. By
> setting any environment variable like SYSTEMD_UNIT_PATH, systemd should pick
> the unit files from /mnt and execute my binaries as per the instructions
> given in unit file.
>

Which is exactly what it does. You just need to set variable in
environment of systemd.

> In normal init.d systems, we have environment variables like PATH &
> LD_LIBRARY_PATH.
> No matter where I place my new executable or library, adding new path into
> these environment variables is enough to execute or link the library.
>
> Probably this kind of facility is not available in Systemd init systems.
>
> --
> Regards,
>
> Raghavendra. H. R
> (Raghu)
>
> On Wed, Sep 21, 2016 at 10:40 PM, Andrei Borzenkov 
> wrote:
>>
>> 21.09.2016 14:26, Raghavendra. H. R пишет:
>> > Hi,
>> >
>> > I'm newbie with systemd boot system and I need help in resolving one
>> > issue.
>> >
>> > I would like to create a service under a customized path Eg:/mnt and
>> > systemd should be able to pick my unit file from this.
>> >
>> > I tried by setting *Environment=SYSTEMD_UNIT_PATH=/mnt *from the
>> > console
>>
>> This should be set in environment of srarted systemd, which in case of
>> systemwide init effectively means either you need to use some wrapper to
>> set it and exec systemd or hack initrd.
>>
>> Also SYSTEMD_UNIT_PATH does not really play nicely with priorities of
>> unit locations (run-time vs. sysadmin vs. shipped).
>>
>> May be it is simpler to install generator that copies your unit
>> definition in standard location. This guarantees it is available before
>> systemd starts.
>
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Is it possible to load unit files from paths other than default paths ?

2016-09-22 Thread Raghavendra. H. R
Thank you for the suggestions.
But with this suggestion I need to run as user something like that.

In normal init.d systems, we have environment variables like PATH &
LD_LIBRARY_PATH.
No matter where I place my new executable or library, adding that path into
these environment variables is enough to execute or link the library.

Probably this kind of facility is not available in Systemd init systems.


Regards,
Raghavendra H R


On Thu, Sep 22, 2016 at 12:34 AM, Kai Krakow  wrote:

> Am Wed, 21 Sep 2016 16:56:52 +0530
> schrieb "Raghavendra. H. R" :
>
> > Hi,
> >
> > I'm newbie with systemd boot system and I need help in resolving one
> > issue.
> >
> > I would like to create a service under a customized path Eg:/mnt and
> > systemd should be able to pick my unit file from this.
> >
> > I tried by setting *Environment=SYSTEMD_UNIT_PATH=/mnt *from the
> > console but it didnt help and found the error *"Failed to start
> > startup.service: Unit startup.service failed to load: No such file or
> > directory."*
> >
> >
> > Is it possible to achieve this ?
>
> Not sure if this helps you, i.e. is appropriate for your use-case...
>
> But if the directory happens to be a home directory and the services
> are designed to be run as user, you could make the service files go
> into $HOME/.config/systemd/user/ (or symlink this to your mountpoint)
> and enable linger on the user (loginctl enable-linger $USER).
>
> You can then manage these units as the user through "system --user
> {start,stop,enable,...}" (only with real login sessions, not through
> sudo -iu $USER, but ssh would work).
>
> --
> Regards,
> Kai
>
> Replies to list-only preferred.
>
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Is it possible to load unit files from paths other than default paths ?

2016-09-22 Thread Raghavendra. H. R
Thank you for the suggestions.
But with this suggestion i.e., generator file, I again need to add/modify
some files.

All I'm looking into is I mount my binaries and unit files under /mnt. By
setting any environment variable like SYSTEMD_UNIT_PATH, systemd should
pick the unit files from /mnt and execute my binaries as per the
instructions given in unit file.

In normal init.d systems, we have environment variables like PATH &
LD_LIBRARY_PATH.
No matter where I place my new executable or library, adding new path into
these environment variables is enough to execute or link the library.

Probably this kind of facility is not available in Systemd init systems.

--
Regards,

Raghavendra. H. R
(Raghu)

On Wed, Sep 21, 2016 at 10:40 PM, Andrei Borzenkov 
wrote:

> 21.09.2016 14:26, Raghavendra. H. R пишет:
> > Hi,
> >
> > I'm newbie with systemd boot system and I need help in resolving one
> issue.
> >
> > I would like to create a service under a customized path Eg:/mnt and
> > systemd should be able to pick my unit file from this.
> >
> > I tried by setting *Environment=SYSTEMD_UNIT_PATH=/mnt *from the
> > console
>
> This should be set in environment of srarted systemd, which in case of
> systemwide init effectively means either you need to use some wrapper to
> set it and exec systemd or hack initrd.
>
> Also SYSTEMD_UNIT_PATH does not really play nicely with priorities of
> unit locations (run-time vs. sysadmin vs. shipped).
>
> May be it is simpler to install generator that copies your unit
> definition in standard location. This guarantees it is available before
> systemd starts.
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Is it possible to load unit files from paths other than default paths ?

2016-09-21 Thread Kai Krakow
Am Wed, 21 Sep 2016 16:56:52 +0530
schrieb "Raghavendra. H. R" :

> Hi,
> 
> I'm newbie with systemd boot system and I need help in resolving one
> issue.
> 
> I would like to create a service under a customized path Eg:/mnt and
> systemd should be able to pick my unit file from this.
> 
> I tried by setting *Environment=SYSTEMD_UNIT_PATH=/mnt *from the
> console but it didnt help and found the error *"Failed to start
> startup.service: Unit startup.service failed to load: No such file or
> directory."*
> 
> 
> Is it possible to achieve this ?

Not sure if this helps you, i.e. is appropriate for your use-case...

But if the directory happens to be a home directory and the services
are designed to be run as user, you could make the service files go
into $HOME/.config/systemd/user/ (or symlink this to your mountpoint)
and enable linger on the user (loginctl enable-linger $USER).

You can then manage these units as the user through "system --user
{start,stop,enable,...}" (only with real login sessions, not through
sudo -iu $USER, but ssh would work).

-- 
Regards,
Kai

Replies to list-only preferred.

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Is it possible to load unit files from paths other than default paths ?

2016-09-21 Thread Andrei Borzenkov
21.09.2016 14:26, Raghavendra. H. R пишет:
> Hi,
> 
> I'm newbie with systemd boot system and I need help in resolving one issue.
> 
> I would like to create a service under a customized path Eg:/mnt and
> systemd should be able to pick my unit file from this.
> 
> I tried by setting *Environment=SYSTEMD_UNIT_PATH=/mnt *from the
> console

This should be set in environment of srarted systemd, which in case of
systemwide init effectively means either you need to use some wrapper to
set it and exec systemd or hack initrd.

Also SYSTEMD_UNIT_PATH does not really play nicely with priorities of
unit locations (run-time vs. sysadmin vs. shipped).

May be it is simpler to install generator that copies your unit
definition in standard location. This guarantees it is available before
systemd starts.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Is it possible to load unit files from paths other than default paths ?

2016-09-21 Thread Raghavendra. H. R
Hi,

I'm newbie with systemd boot system and I need help in resolving one issue.

I would like to create a service under a customized path Eg:/mnt and
systemd should be able to pick my unit file from this.

I tried by setting *Environment=SYSTEMD_UNIT_PATH=/mnt *from the
console but it didnt help and found the error *"Failed to start
startup.service: Unit startup.service failed to load: No such file or
directory."*


Is it possible to achieve this ?


--
Regards,

Raghavendra. H. R
(Raghu)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel