<div dir="ltr"><div class="gmail_default" style="font-family:times new roman,serif;font-size:large">Andrei,</div><div class="gmail_default" style="font-family:times new roman,serif;font-size:large"><br></div><div class="gmail_default" style="font-family:times new roman,serif;font-size:large">Your doubt is absolutely correct. Default target of the system as nothing to do with auto start of services.</div><div class="gmail_default" style="font-family:times new roman,serif;font-size:large"><br></div><div class="gmail_default" style="font-family:times new roman,serif;font-size:large">I checked both graphical.target & multi-user.target, surprisingly I don't see any big difference in these. Both of the files are almost same except multi-user.target have dependency <i>After=</i> with <i>rescue.service & rescue.target</i> which is restricting multi-user.target from starting.</div><div class="gmail_default" style="font-family:times new roman,serif;font-size:large"><br></div><div class="gmail_default" style="font-family:times new roman,serif;font-size:large">However graphical.target don't depend on rescue services, so it is active & started. And by making graphical.target as dependency in my unit file solved my problem.</div><div class="gmail_default" style="font-family:times new roman,serif;font-size:large"><br></div><div class="gmail_default" style="font-family:times new roman,serif;font-size:large">Hopefully if I remove the rescue services dependency from multi-user.target and add it as dependency then my service should come up without failures.</div><div class="gmail_default" style="font-family:times new roman,serif;font-size:large"><br></div><div class="gmail_default" style="font-family:times new roman,serif;font-size:large"><br></div><div class="gmail_default" style="font-family:times new roman,serif;font-size:large">Thanks for your valuable feedback.</div><div class="gmail_default" style="font-family:times new roman,serif;font-size:large"><br></div><div class="gmail_default" style="font-family:times new roman,serif;font-size:large">Regards,</div><div class="gmail_default" style="font-family:times new roman,serif;font-size:large">Raghavendra H R</div><div class="gmail_default" style="font-family:times new roman,serif;font-size:large"><br></div><div class="gmail_default" style="font-family:times new roman,serif;font-size:large"><br></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 Wed, Oct 5, 2016 at 4:55 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 Wed, Oct 5, 2016 at 1:19 PM, Raghavendra. H. R <<a href="mailto:raghuhr84@gmail.com">raghuhr84@gmail.com</a>> wrote:<br>
> It's working fine now. We should give the default target of the system for<br>
> WantedBy= of the Install section.<br>
> So I used graphical.target in the Install section and it fixed my issue.<br>
><br>
<br>
</span>I doubt it was the reason. grpahical.target pulls in multi-user.target<br>
unless you have very customized unit definitions.<br>
<div class="HOEnZb"><div class="h5"><br>
> Thanks for the information.<br>
><br>
><br>
><br>
> --<br>
> Regards,<br>
><br>
> Raghavendra. H. R<br>
> (Raghu)<br>
><br>
> On Wed, Oct 5, 2016 at 3:12 PM, Raghavendra. H. R <<a href="mailto:raghuhr84@gmail.com">raghuhr84@gmail.com</a>><br>
> wrote:<br>
>><br>
>> I ran "systemctl enable test.service" but when I restart it shows only<br>
>> that the service is only enabled but not active and running.<br>
>><br>
>> Here is the status of test.service<br>
>><br>
>> ? test.service - Hey Bings<br>
>> Loaded: loaded (/lib/systemd/system/test.<wbr>service; enabled)<br>
>> Active: inactive (dead)<br>
>><br>
>><br>
>> For WantedBy= which attribute should be given, whether it is<br>
>> "default.target" or the default target of the system ?<br>
>> Running systemctl get-default shows graphical.target as the default<br>
>> target.<br>
>><br>
>> --<br>
>> Regards,<br>
>><br>
>> Raghavendra. H. R<br>
>> (Raghu)<br>
>><br>
>> On Wed, Oct 5, 2016 at 2:59 PM, Andrei Borzenkov <<a href="mailto:arvidjaar@gmail.com">arvidjaar@gmail.com</a>><br>
>> wrote:<br>
>>><br>
>>> On Wed, Oct 5, 2016 at 12:23 PM, Raghavendra. H. R <<a href="mailto:raghuhr84@gmail.com">raghuhr84@gmail.com</a>><br>
>>> wrote:<br>
>>> > Hi All,<br>
>>> ><br>
>>> > I'm a newbie in Systemd init system and I'm trying to auto boot/start<br>
>>> > my<br>
>>> > service in systemd. But my service gets only enabled and it never runs<br>
>>> > automatically.<br>
>>> ><br>
>>> > I modifying my unit file to depend on sysinit.target and<br>
>>> > multi-user.target<br>
>>> > by making use of I used After= this also didnt help.<br>
>>> ><br>
>>> > I would like to do something in my unit file from which systemd starts<br>
>>> > my<br>
>>> > service automatically after starting it's own system related services.<br>
>>> ><br>
>>><br>
>>> There is no such thing as "own systemd services". All services are<br>
>>> equal (but some are more equal than others :)<br>
>>><br>
>>> > Can anyone help me regarding this ?<br>
>>> ><br>
>>> ><br>
>>> > My sample service<br>
>>> > =============<br>
>>> > [Unit]<br>
>>> > Description=Hey Bings<br>
>>> ><br>
>>> > [Service]<br>
>>> > ExecStart="Run an executable"<br>
>>> ><br>
>>> > [Install]<br>
>>> > WantedBy=multi-user.target or sysinit.target<br>
>>> ><br>
>>><br>
>>> sysinit.target is wrong, it should never be used for normal service.<br>
>>> multi-user.target should work as long as it is your default target (or<br>
>>> dependency of default target).<br>
>>><br>
>>> You did run "systemctl enable your.service", did not you? What<br>
>>> "systemctl status your.service" says?<br>
>><br>
>><br>
><br>
</div></div></blockquote></div><br></div>