<div dir="ltr"><div class="gmail_default" style="font-family:times new roman,serif;font-size:large">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.</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><font style="font-family:times new roman,serif" size="2"></font><font face="times new roman,serif"><font size="4">--<br>Regards,<br><br>Raghavendra. H. R<br>(Raghu)</font><br></font></div></div></div></div>
<br><div class="gmail_quote">On Thu, Sep 22, 2016 at 12:26 PM, Andrei Borzenkov <span dir="ltr"><<a href="mailto:arvidjaar@gmail.com" target="_blank">arvidjaar@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thu, Sep 22, 2016 at 9:18 AM, Raghavendra. H. R <<a href="mailto:raghuhr84@gmail.com">raghuhr84@gmail.com</a>> wrote:<br>
> Thank you for the suggestions.<br>
> But with this suggestion i.e., generator file, I again need to add/modify<br>
> some files.<br>
><br>
<br>
</span>You need to add/modify some files to implement your service anyway. I<br>
do not see how one more file is a problem so far.<br>
<span class=""><br>
> All I'm looking into is I mount my binaries and unit files under /mnt. By<br>
> setting any environment variable like SYSTEMD_UNIT_PATH, systemd should pick<br>
> the unit files from /mnt and execute my binaries as per the instructions<br>
> given in unit file.<br>
><br>
<br>
</span>Which is exactly what it does. You just need to set variable in<br>
environment of systemd.<br>
<div class="HOEnZb"><div class="h5"><br>
> In normal init.d systems, we have environment variables like PATH &<br>
> LD_LIBRARY_PATH.<br>
> No matter where I place my new executable or library, adding new path into<br>
> these environment variables is enough to execute or link the library.<br>
><br>
> Probably this kind of facility is not available in Systemd init systems.<br>
><br>
> --<br>
> Regards,<br>
><br>
> Raghavendra. H. R<br>
> (Raghu)<br>
><br>
> On Wed, Sep 21, 2016 at 10:40 PM, Andrei Borzenkov <<a href="mailto:arvidjaar@gmail.com">arvidjaar@gmail.com</a>><br>
> wrote:<br>
>><br>
>> <a href="tel:21.09.2016%2014" value="+12109201614">21.09.2016 14</a>:26, Raghavendra. H. R пишет:<br>
>> > Hi,<br>
>> ><br>
>> > I'm newbie with systemd boot system and I need help in resolving one<br>
>> > issue.<br>
>> ><br>
>> > I would like to create a service under a customized path Eg:/mnt and<br>
>> > systemd should be able to pick my unit file from this.<br>
>> ><br>
>> > I tried by setting *Environment=SYSTEMD_UNIT_<wbr>PATH=/mnt *from the<br>
>> > console<br>
>><br>
>> This should be set in environment of srarted systemd, which in case of<br>
>> systemwide init effectively means either you need to use some wrapper to<br>
>> set it and exec systemd or hack initrd.<br>
>><br>
>> Also SYSTEMD_UNIT_PATH does not really play nicely with priorities of<br>
>> unit locations (run-time vs. sysadmin vs. shipped).<br>
>><br>
>> May be it is simpler to install generator that copies your unit<br>
>> definition in standard location. This guarantees it is available before<br>
>> systemd starts.<br>
><br>
><br>
</div></div></blockquote></div><br></div>