Re: [systemd-devel] kexec reboot fails and reboots in normal cold boot way

2022-06-17 Thread Prashantkumar dhotre
Following up on this to see if anyone has any idea why this is happening
Thanks


On Tue, Jun 14, 2022 at 2:09 PM Prashantkumar dhotre 
wrote:

> Hi,
> In  systemd 243.2+ version, intermittently sometimes I see that 'systemctl
> kexec' does not result in kexec reboot but results in reguler cold boot
> reboot
> In console logs, I see below logs.
> At line#209, I see "FAIL" string but not sure where it is coming from.
> In which cases do 'systemctl kexec' can fail and result in non-kexec
> reguler reboot?
>
>
>  185 2022-06-13 13:56:18 [^[[0;32m  OK  ^[[0m] Unmounted
> ^[[0;1;39m/data/var/home/root/.ssh^[[0m.^M
>  186 2022-06-13 13:56:18 [^[[0;1;31mFAILED^[[0m] Failed unmounting
> ^[[0;1;39m/etc^[[0m.^M
>  187 2022-06-13 13:56:18 [^[[0;32m  OK  ^[[0m] Unmounted
> ^[[0;1;39m/soft/uswitch^[[0m.^M
>  188 2022-06-13 13:56:18 [^[[0;32m  OK  ^[[0m] Unmo[ 1130.272883]
> systemd-shutdown[1]: Could not deactivate swap /sda3: Transport endpoint is
> not
>  connected^M
>  189 2022-06-13 13:56:18 unted ^[[0;1;39m/u^[[0m.^M
>  190 2022-06-13 13:56:18 [^[[0;32m  OK  ^[[0m] Unmounted
> ^[[0;1;39m/usr/conf^[[0m.^M
>  191 2022-06-13 13:56:18 [^[[0;32m  OK  ^[[0m] Unmounted
> ^[[0;1;39m/usr/evo/share^[[0m.^M
>  192 2022-06-13 13:56:18 [^[[0;32m  OK  ^[[0m] Unmounted
> ^[[0;1;39m/uswitch/data/var/external^[[0m.^M
>  193 2022-06-13 13:56:18 [^[[0;32m  OK  ^[[0m] Unmounted
> ^[[0;1;39m/uswitch/dev^[[0m.^M
>  194 2022-06-13 13:56:18 [^[[0;32m  OK  ^[[0m] Unmounted
> ^[[0;1;39m/uswitch/proc^[[0m.^M
>  195 2022-06-13 13:56:18 [^[[0;32m  OK  ^[[0m] Unmounted
> ^[[0;1;39m/uswitch/soft^[[0m.^M
>  196 2022-06-13 13:56:18 [^[[0;32m  OK  ^[[0m] Unmounted
> ^[[0;1;39m/uswitch/tmp^[[0m.^M
>  197 2022-06-13 13:56:18 [^[[0;32m  OK  ^[[0m] Unmounted
> ^[[0;1;39m/var/db^[[0m.^M
>  198 2022-06-13 13:56:19 [^[[0;32m  OK  ^[[0m] Unmounted
> ^[[0;1;39m/var/etc^[[0m.^M
>  199 2022-06-13 13:56:19 [^[[0;32m  OK  ^[[0m] Unmounted
> ^[[0;1;39m/var/pfe^[[0m.^M
>  200 2022-06-13 13:56:19 [^[[0;32m  OK  ^[[0m] Unmounted
> ^[[0;1;39m/var/rundb^[[0m.^M
>  201 2022-06-13 13:56:19 [^[[0;32m  OK  ^[[0m] Unmounted
> ^[[0;1;39mTemporary Directory (/tmp)^[[0m.^M
>  202 2022-06-13 13:56:19 [^[[0;32m  OK  ^[[0m] Stopped target
> ^[[0;1;39mSwap^[[0m.^M
>  203 2022-06-13 13:56:19  Deactivating swap
> ^[[0;1;39m/sda3^[[0m...^M
>  204 2022-06-13 13:56:19  Unmounting ^[[0;1;39m/data/var^[[0m...^M
>  205 2022-06-13 13:56:19  Unmounting ^[[0;1;39m/soft^[[0m...^M
>  206 2022-06-13 13:56:19  Unmounting
> ^[[0;1;39m/uswitch/data/var^[[0m...^M
>  207 2022-06-13 13:56:19  Unmounting ^[[0;1;39m/var^[[0m...[
> 1131.454830] reboot: Restarting system^M
>  208 2022-06-13 13:56:19 ^M
>  209 2022-06-13 13:56:19 [^[[0;1;31mFAIL^[c^M
>  210 2022-06-13 13:56:19 Booting from Flash A^M
>  211 2022-06-13 13:56:19 ^M
>  212 2022-06-13 13:56:19 FPGA Reset Reason = 0x80^M
>  213 2022-06-13 13:56:19 ^M
>  214 2022-06-13 13:56:20 Primary BIOS version CBDE_P_LIG0_00.25.1^M
>
> Thanks
>
>


[systemd-devel] kexec reboot fails and reboots in normal cold boot way

2022-06-14 Thread Prashantkumar dhotre
Hi,
In  systemd 243.2+ version, intermittently sometimes I see that 'systemctl
kexec' does not result in kexec reboot but results in reguler cold boot
reboot
In console logs, I see below logs.
At line#209, I see "FAIL" string but not sure where it is coming from.
In which cases do 'systemctl kexec' can fail and result in non-kexec
reguler reboot?


 185 2022-06-13 13:56:18 [^[[0;32m  OK  ^[[0m] Unmounted
^[[0;1;39m/data/var/home/root/.ssh^[[0m.^M
 186 2022-06-13 13:56:18 [^[[0;1;31mFAILED^[[0m] Failed unmounting
^[[0;1;39m/etc^[[0m.^M
 187 2022-06-13 13:56:18 [^[[0;32m  OK  ^[[0m] Unmounted
^[[0;1;39m/soft/uswitch^[[0m.^M
 188 2022-06-13 13:56:18 [^[[0;32m  OK  ^[[0m] Unmo[ 1130.272883]
systemd-shutdown[1]: Could not deactivate swap /sda3: Transport endpoint is
not
 connected^M
 189 2022-06-13 13:56:18 unted ^[[0;1;39m/u^[[0m.^M
 190 2022-06-13 13:56:18 [^[[0;32m  OK  ^[[0m] Unmounted
^[[0;1;39m/usr/conf^[[0m.^M
 191 2022-06-13 13:56:18 [^[[0;32m  OK  ^[[0m] Unmounted
^[[0;1;39m/usr/evo/share^[[0m.^M
 192 2022-06-13 13:56:18 [^[[0;32m  OK  ^[[0m] Unmounted
^[[0;1;39m/uswitch/data/var/external^[[0m.^M
 193 2022-06-13 13:56:18 [^[[0;32m  OK  ^[[0m] Unmounted
^[[0;1;39m/uswitch/dev^[[0m.^M
 194 2022-06-13 13:56:18 [^[[0;32m  OK  ^[[0m] Unmounted
^[[0;1;39m/uswitch/proc^[[0m.^M
 195 2022-06-13 13:56:18 [^[[0;32m  OK  ^[[0m] Unmounted
^[[0;1;39m/uswitch/soft^[[0m.^M
 196 2022-06-13 13:56:18 [^[[0;32m  OK  ^[[0m] Unmounted
^[[0;1;39m/uswitch/tmp^[[0m.^M
 197 2022-06-13 13:56:18 [^[[0;32m  OK  ^[[0m] Unmounted
^[[0;1;39m/var/db^[[0m.^M
 198 2022-06-13 13:56:19 [^[[0;32m  OK  ^[[0m] Unmounted
^[[0;1;39m/var/etc^[[0m.^M
 199 2022-06-13 13:56:19 [^[[0;32m  OK  ^[[0m] Unmounted
^[[0;1;39m/var/pfe^[[0m.^M
 200 2022-06-13 13:56:19 [^[[0;32m  OK  ^[[0m] Unmounted
^[[0;1;39m/var/rundb^[[0m.^M
 201 2022-06-13 13:56:19 [^[[0;32m  OK  ^[[0m] Unmounted
^[[0;1;39mTemporary Directory (/tmp)^[[0m.^M
 202 2022-06-13 13:56:19 [^[[0;32m  OK  ^[[0m] Stopped target
^[[0;1;39mSwap^[[0m.^M
 203 2022-06-13 13:56:19  Deactivating swap
^[[0;1;39m/sda3^[[0m...^M
 204 2022-06-13 13:56:19  Unmounting ^[[0;1;39m/data/var^[[0m...^M
 205 2022-06-13 13:56:19  Unmounting ^[[0;1;39m/soft^[[0m...^M
 206 2022-06-13 13:56:19  Unmounting
^[[0;1;39m/uswitch/data/var^[[0m...^M
 207 2022-06-13 13:56:19  Unmounting ^[[0;1;39m/var^[[0m...[
1131.454830] reboot: Restarting system^M
 208 2022-06-13 13:56:19 ^M
 209 2022-06-13 13:56:19 [^[[0;1;31mFAIL^[c^M
 210 2022-06-13 13:56:19 Booting from Flash A^M
 211 2022-06-13 13:56:19 ^M
 212 2022-06-13 13:56:19 FPGA Reset Reason = 0x80^M
 213 2022-06-13 13:56:19 ^M
 214 2022-06-13 13:56:20 Primary BIOS version CBDE_P_LIG0_00.25.1^M

Thanks


[systemd-devel] OnFailure units get triggered when service timesout on sigterm during restart of service

2022-06-02 Thread Prashantkumar dhotre
Hi,
I see issue with OnFailure cfg
have a simple service which ignores sigterm and has OnFailure and Restart
cfg in its service file
issue restart of that service.
expectation is that OnFailure units will not be triggered (as per doc as
service is gonna restart even if it times out sigterm) but in it is
observed that they are triggered
I think https://github.com/systemd/systemd/issues/8398 is fixed only
partially
Logged https://github.com/systemd/systemd/issues/23599
Thanks


Re: [systemd-devel] From dbus notification, how to know service entered failed state and will not start without admin action

2022-02-18 Thread Prashantkumar dhotre
Hi,
Can you please help ?
I see that in OnFailure behaviour is changed and these units in OnFailure
gets triggerd when service is failed-and-will-not-restart-automatically.
https://lists.freedesktop.org/archives/systemd-devel/2018-June/040879.html
In such case, does systemd also send dbus signal  whenever it triggers
OnFailure ?
Thanks


On Fri, Feb 18, 2022 at 8:55 PM Prashantkumar dhotre 
wrote:

> Hi,
> In my app, I am monitoring a few services and would like to do some
> cleanup in my app, when these services  fail in such a way that they
> don't restart back up without admin action.
> From  dbus-monitor , I see that 'Result' dbus PropertiesChanged signal
> comes first and then 'ActiveState' PropertiesChanged signal comes next.
> I was hoping that to use   'ActiveState' = "failed"  and "SubState" =
> "failed" but that does not satisfy my requirement as
> when I  send sigkill  i get "ActiveState" and "SubState" as "failed" in
> DBus notification but service starts back up automatically (due to
> 'Restart' &  'ActiveState'settings )
> Also when app exits with non-zero code also , I get "ActiveState"
> and "SubState" as "failed" in DBus notification.
> So I can not use only  "ActiveState" and "SubState" values , as app
> restarts after these states report "failed" (in which case my app should
> not do cleanup)
> Using dbus notification, how can determine that service is down and not
> going to start automatically so that in my app i can do cleanup ?
> Is there any parameter in PropertiesChanged  signal that tells that app is
> down and will not start back up automatically ?
> I am using systemd 243.
> Thanks for your help.
> Regards
>
>
>
>


[systemd-devel] From dbus notification, how to know service entered failed state and will not start without admin action

2022-02-18 Thread Prashantkumar dhotre
Hi,
In my app, I am monitoring a few services and would like to do some cleanup
in my app, when these services  fail in such a way that they don't restart
back up without admin action.
>From  dbus-monitor , I see that 'Result' dbus PropertiesChanged signal
comes first and then 'ActiveState' PropertiesChanged signal comes next.
I was hoping that to use   'ActiveState' = "failed"  and "SubState" =
"failed" but that does not satisfy my requirement as
when I  send sigkill  i get "ActiveState" and "SubState" as "failed" in
DBus notification but service starts back up automatically (due to
'Restart' &  'ActiveState'settings )
Also when app exits with non-zero code also , I get "ActiveState"
and "SubState" as "failed" in DBus notification.
So I can not use only  "ActiveState" and "SubState" values , as app
restarts after these states report "failed" (in which case my app should
not do cleanup)
Using dbus notification, how can determine that service is down and not
going to start automatically so that in my app i can do cleanup ?
Is there any parameter in PropertiesChanged  signal that tells that app is
down and will not start back up automatically ?
I am using systemd 243.
Thanks for your help.
Regards


[systemd-devel] How to disable job cancelling feature

2022-01-10 Thread Prashantkumar dhotre
Hi,
It seems that systemd cancels pending stop job if a start job is being
attempted to be enqueued (seen when we enable debug level logs)
so app will not get stopped and started and systemd leave the app as
running instead of stopping and starting
but this seems to be unexpected from user/client-app point of view as the
client is expecting the app to be stopped and started when client issues
stop and start (even though they are quick requests)
Could you please let me know if this understanding is correct ?
Is there a systemd  config that controls this job canceling feature and can
we disable it  by changing that cfg in system.conf ?
Thanks for the help
Regards,
Prashant


[systemd-devel] services stopping order during shutdown

2021-12-07 Thread Prashantkumar dhotre
Hi,
Is there a batching of service stops by systemd during shutdown.
In journal logs, I see a batch of 40 odd 'Stopping' messages and then the
next batch is seen after few seconds (4-6 seconds)
Is this by design ?
I am looking for a faster way to shutdown. Is there any config that can
speed up service stops during shutdown (like  avoid batching )?
Thanks
Prashant


Re: [systemd-devel] how to know what triggered a serivce start

2021-08-25 Thread Prashantkumar dhotre
 Hi
How to know what triggered a service start ?
For eg, service X may Require service Y, so starting service-Y will start
service-X.
Can I get this info from 'systemd-analyze' ?
If yes, which argument to use for systemd-analyze?
I am interested to see what actually triggered  and not just list out the
dependency of a service
Thanks


[systemd-devel] Conditional dependency

2020-01-26 Thread prashantkumar dhotre
Hi,
Is there a way to specify conditional dependency in service files ?
My use case is : I have a include file my.include that contains
'After=core.service' among other things.
I have services A,B,C and X. As of now , all include my.include.
Now my requirement is - I want services A,B and C to be dependent on
core.service but  X service should not depend on core.service.one solution
i thought is -
Instead of include my.include in all 4 services, I can create 2
separate include files and include appropriate files in those services.
Is there any other better way ?
Regards
Prashant
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] StartLimitBurst/StartLimitInterval not getting enforced

2019-03-06 Thread prashantkumar dhotre
Follow up

On Wed, Mar 6, 2019 at 12:59 PM prashantkumar dhotre <
prashantkumardho...@gmail.com> wrote:

> But the doc says
> https://www.freedesktop.org/software/systemd/man/systemd.unit.html
> " however, they apply to all kinds of starts (including manual), not just
> those triggered by theRestart= logic"
> so a sper doc , they apply to manual start/stop too.
>
> On Wed, Mar 6, 2019 at 12:53 PM Bruno Vernay 
> wrote:
>
>> Hi,
>> I would say that they limit restarts on errors (process crashes)
>> Not an explicit command to stop and restart. There are no errors here.
>>
>> Bruno
>>
>> On Wed, Mar 6, 2019 at 8:02 AM prashantkumar dhotre <
>> prashantkumardho...@gmail.com> wrote:
>>
>>> Hi,
>>> I use v230 systemd.
>>> I see that even after repeated stop and start  of my service, i dont see
>>> it going to going to failed state.
>>> I have not configured any StartLimitBurst/StartLimitInterval , so
>>> default values should take effect but I dont se ethat happening. service
>>> always restarts.
>>> Is this behavior expected ? or this is a bug which got fixed in later
>>> releases ?
>>>
>>> $  while true; do systemctl stop snmpd;  systemctl start snmpd;
>>> systemctl status snmpd;done
>>>
>>> $ cat snmpd.service
>>> ...
>>>
>>> [Service]
>>> ExecStart= /usr/sbin/snmpd
>>> Restart=always
>>> ...
>>>
>>>
>>> Thanks
>>>
>>>
>>> ___
>>> systemd-devel mailing list
>>> systemd-devel@lists.freedesktop.org
>>> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>>
>>
>>
>> --
>> Bruno VERNAY
>>
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Re: [systemd-devel] StartLimitBurst/StartLimitInterval not getting enforced

2019-03-05 Thread prashantkumar dhotre
But the doc says
https://www.freedesktop.org/software/systemd/man/systemd.unit.html
" however, they apply to all kinds of starts (including manual), not just
those triggered by theRestart= logic"
so a sper doc , they apply to manual start/stop too.

On Wed, Mar 6, 2019 at 12:53 PM Bruno Vernay  wrote:

> Hi,
> I would say that they limit restarts on errors (process crashes)
> Not an explicit command to stop and restart. There are no errors here.
>
> Bruno
>
> On Wed, Mar 6, 2019 at 8:02 AM prashantkumar dhotre <
> prashantkumardho...@gmail.com> wrote:
>
>> Hi,
>> I use v230 systemd.
>> I see that even after repeated stop and start  of my service, i dont see
>> it going to going to failed state.
>> I have not configured any StartLimitBurst/StartLimitInterval , so default
>> values should take effect but I dont se ethat happening. service always
>> restarts.
>> Is this behavior expected ? or this is a bug which got fixed in later
>> releases ?
>>
>> $  while true; do systemctl stop snmpd;  systemctl start snmpd; systemctl
>> status snmpd;done
>>
>> $ cat snmpd.service
>> ...
>>
>> [Service]
>> ExecStart= /usr/sbin/snmpd
>> Restart=always
>> ...
>>
>>
>> Thanks
>>
>>
>> ___
>> systemd-devel mailing list
>> systemd-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
>
>
> --
> Bruno VERNAY
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

[systemd-devel] StartLimitBurst/StartLimitInterval not getting enforced

2019-03-05 Thread prashantkumar dhotre
Hi,
I use v230 systemd.
I see that even after repeated stop and start  of my service, i dont see it
going to going to failed state.
I have not configured any StartLimitBurst/StartLimitInterval , so default
values should take effect but I dont se ethat happening. service always
restarts.
Is this behavior expected ? or this is a bug which got fixed in later
releases ?

$  while true; do systemctl stop snmpd;  systemctl start snmpd; systemctl
status snmpd;done

$ cat snmpd.service
...

[Service]
ExecStart= /usr/sbin/snmpd
Restart=always
...


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

[systemd-devel] Effect of reset-failed on service that is not in failed state

2019-03-05 Thread prashantkumar dhotre
Hi,
Is there any side-effect of the 'reset-failed' operation on a service that
is not in failed state.
My understanding is , in that case, it is no-op.
I have an app which uses dbus API for systemd to start/stop services.
Here I always the startApp() of my app should always result in starting of
app, even if it is inn failed/stopped state.
Is it safe to always call 'reset-failed' systemd dbus API before I call
'start' dbus API, in my startApp() ?
Thanks
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Re: [systemd-devel] what does it mean to have exit-code of 251

2019-03-04 Thread prashantkumar dhotre
Thanks.
It seems like that call to zookeeper lib API is causing this exit with 251
and hence it is most likely in zookeeper lib code.
Regards


On Mon, Mar 4, 2019 at 5:26 PM Lennart Poettering 
wrote:

> On Mo, 04.03.19 16:58, prashantkumar dhotre (prashantkumardho...@gmail.com)
> wrote:
>
> > Hi,
> >
> > In my journal log, I see ;
> >
> > 1199473 Mar 01 15:46:03 evo-qfx-01 systemd[1]: ifmand.service: Main
> process
> > exited, code=exited, status=251/n/a
> >
> >
> > I want to know what does 251 means.
> >
> > Can you  please  let me know where can I see the exit-code to meaning
> mapping
>
> This depends on the program you are invoking as a service. i.e. ask
> the folks who wrote "ifmand" about this, or consult the documentation
> for that program.
>
> When systemd cannot invoke a program you configured it will generate a
> couple of error codes on its own. These are documented here:
>
>
> https://www.freedesktop.org/software/systemd/man/systemd.exec.html#Process%20exit%20codes
>
> But as you can see there 251 is none of the exit codes systemd itself
> defines, hence it must come from your own app.
>
> Lennart
>
> --
> Lennart Poettering, Red Hat
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Re: [systemd-devel] what does it mean to have exit-code of 251

2019-03-04 Thread prashantkumar dhotre
In my app, I don't explicitly call exit(251).
I use zookeeper lib.
Fro my logs,I see that after a call to zookeeper lib API, I see that my
service exited with 251.
Is 251 a std exit code or app/lib specific custom exit code ?
Thanks



On Mon, Mar 4, 2019 at 5:02 PM Umut Tezduyar Lindskog 
wrote:

> You need to do some bit analysis - https://shapeshed.com/unix-exit-codes/
>
> On Mon, Mar 4, 2019 at 12:29 PM prashantkumar dhotre
>  wrote:
> >
> > Hi,
> >
> > In my journal log, I see ;
> >
> > 1199473 Mar 01 15:46:03 evo-qfx-01 systemd[1]: ifmand.service: Main
> process exited, code=exited, status=251/n/a
> >
> >
> > I want to know what does 251 means.
> >
> > Can you  please  let me know where can I see the exit-code to meaning
> mapping ?
> >
> > Thanks
> >
> > Prashant
> >
> >
> > ___
> > 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

[systemd-devel] what does it mean to have exit-code of 251

2019-03-04 Thread prashantkumar dhotre
Hi,

In my journal log, I see ;

1199473 Mar 01 15:46:03 evo-qfx-01 systemd[1]: ifmand.service: Main process
exited, code=exited, status=251/n/a


I want to know what does 251 means.

Can you  please  let me know where can I see the exit-code to meaning mapping
?

Thanks

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

[systemd-devel] Failed state DBUS notification not received on sigkill of service

2018-09-27 Thread prashantkumar dhotre
Hi
Failed state DBUS notification  for  ActiveState property
is not received on  sigkill of service, for the service that supports
restart ('Restart' value in service faile). But i see that unit goes to
failed state in journal logs

++
Sep 25 08:52:00 mynode systemd[1]: alarmd.service: Unit entered failed
state.
Sep 25 08:52:00 mynode systemd[1]: alarmd.service: Triggering OnFailure=
dependencies.
Sep 25 08:52:00 mynode systemd[1]: alarmd.service: Failed with result
'signal'.
Sep 25 08:52:00  mynode   systemd[1]: alarmd.service: Service hold-off time
over, scheduling restart.
Sep 25 08:52:00  mynode   systemd[1]: Stopped "Alarm agent on RE".
Sep 25 08:52:00  mynode   systemd[1]: Started "Alarm agent on RE".
++

Logs from my app which monitors dbus notifications:
+++
Updated Result=signal for service alarmd.service in cache contents:
activeState=active subState=running result=signal" }
Updated ActiveState=deactivating for service alarmd.service in cache
contents: activeState=deactivating subState=running result=signal" }
Updated SubState=stop-post
Updated Result=signal for service alarmd.service in cache contents:
activeState=deactivating subState=stop-post result=signal" }
Updated ActiveState=activating for service alarmd.service in cache
contents: activeState=activating subState=stop-post result=signal" }
Updated SubState=auto-restart for service alarmd.service in cache contents:
activeState=activating subState=auto-restart result=signal" }
Updated Result=success for service alarmd.service in cache contents:
activeState=activating subState=auto-restart result=success" }
Updated ActiveState=active for service alarmd.service in cache contents:
activeState=active subState=auto-restart result=success" }
Updated SubState=running for service alarmd.service in cache contents:
activeState=active subState=running result=success" }
+

If service does not support restart (Restart=no), then I see that we get
 Failed state DBUS notification , as  ' ActiveState=failed '.
Logs from my app which monitors dbus notifications:
++
Updated Result=signal for service alarmd.service in cache contents:
activeState=deactivating subState=stop-post result=signal" }
Updated ActiveState=failed for service alarmd.service in cache contents:
activeState=failed subState=stop-post result=signal" }
Updated SubState=failed for service alarmd.service in cache contents:
activeState=failed subState=failed result=signal" }
++
1) Is this a bug ?
2) Why service is put to failed state on sigkill ?
3) if putting service into failed state on sigkill is right thing to do ,
they why dbus notification  is not being sent in case of service that
supports restart.

Thanks for your help
-Prashant
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] DBUS API to restart unit by sending sigkill/sighup

2018-09-10 Thread prashantkumar dhotre
Hi,
Is there is dbus API for systemd to restart unit by sending sigkill /sighup
?
https://www.freedesktop.org/wiki/Software/systemd/dbus/
RestartUnit(in  s name, in  s mode, out o job);
My requirement is to have a way to restart unit by sending sigkill or
sighup (user can specify ) also along with sigterm.
Since that dbus APi does not seem to exists, to achieve same effect ,
I can use KillUnit() API to send custom signal and then use  StartUnit().
KillUnit(in  s name, in  s who,   in  i signal);
StartUnit(in  s name, in  s mode,  out o job);

Is that correct understanding ?
One issue with this is how to know when to do  StartUnit() after KillUnit()
since KillUnit() may not have completed stopping unit yet.
Regards
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] how to put max time limit on reboot time

2018-04-05 Thread prashantkumar dhotre
Hi
Currently it appears that systemd does not provide a way to put max time
limit for system reboot.

So there is no way to get system reboot within specified time limit even if
hardware watchdog is present in system.


Using RunTimeWatchDogSec,ShutDownTimeWatchDogSec and
JobTimeoutSec,JobTimeoutAction= in shutdown.target will not solve this
issue.

RunTimeWatchDogSec  configures hardware watchdog (hw wd )with the given
timeout value and system manager will pat the wd at least once in half of
that time.
This wd patting will be done in 1st phase of shutdown also.
example: set this to 2 min and hw wd gets configured with 2 min timeout and
system manager keeps patting every 1min.

ShutDownTimeWatchDogSec will configured HW WD with given value and pats the
WD during 2nd phase of shutdown.
2nd phase of shutdown contains loop of 'try to clean up remaining things'.

So for ex, if we set ShutDownTimeWatchDogSec to 10 min, then during 2nd
phase of shutdown , if any task of 'try to clean up remaining things' in
the loop takes more than 10 min, then only HW WD get fired and system
reboots.

So this puts max time out on each iteration of loop and not on entire loop

So this setting does not help in putting max time out for 2nd phase of
shutdown.



But intention of ShutDownTimeWatchDogSec  from man page is : “It works as a
safety net to ensure that the reboot takes place even if a clean reboot
attempt times out.”

Clearly this intention is not served by current implementation of
ShutDownTimeWatchDogSec.



Do we need to :

redefine ShutDownTimeWatchDogSec and use it to put max time out on entire
2nd part of shutdown.

i.e set the user given value of ShutDownTimeWatchDogSec to HW WD at
beginning of 2nd phase of shutdown but do not pat HW WD each time in in
each iteration of loop.

this way, if 2nd phase takes more than 10 min, then hw wd gets fired and
system reboots.



please let me know if we need to open a bug for this


1) related write up

https://utcc.utoronto.ca/~cks/space/blog/linux/SystemdNFSMountShutdown
https://utcc.utoronto.ca/~cks/space/blog/linux/SystemdShutdownWatchdog



2) my previous queries related to this are

https://lists.freedesktop.org/archives/systemd-devel/2018-March/040566.html
https://github.com/systemd/systemd/issues/8484



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


[systemd-devel] systemd issues related to watchdog

2018-03-21 Thread prashantkumar dhotre
Hi systemd-experts

I am seeing few issues related to watchdog  in systemd 230 version.
Could you please help me with few queries below ?


1) How do I  test hardware watchdog config RunTimeWatchDiogSec and
ShutDownTimeWatchDogSec

2) If I enable RunTimeWatchDogSec, should I also run watchdog.service which
runs /usr/sbin/watchdog ?

3) What is the config to put say 2 min timeout for shutdown/reboot ?
ShutDownTimeWatchDogSec  does not do that .

4) In console of my device ,when i reboot it, I  sometimes , I see “
553.001000]
Uhhuh. NMI receÿ “ string message.

What is this indicate ? doe this indicate expiry of hw watchdog  timer ?


5) how do I see present setting of hw watchdog timer  ?

wdctl is not working


root@bng-evo-ptx5k-c-re0:~# wdctl /dev/watchdog0

wdctl: /dev/watchdog0: watchdog already in use, terminating.

wdctl: cannot open /dev/watchdog0: Device or resource busy


root@bng-evo-ptx5k-c-re0:~# wdctl /dev/watchdog1

wdctl: /dev/watchdog1: watchdog already in use, terminating.

wdctl: cannot open /dev/watchdog1: Device or resource busy

5) reboot-force seem to be overwriting the hardware watchdog timeout value.

I have changed reboot.target to make JobTimeoutSec=5sec
when system boots up i see that hardware watchdog is set to 1 min 4 sec.
but when 'systemctl reboot' timesout , reboot-force is invoked and that is
overwriting the
hardware watchdog timeout value to 4 min.
Is this a bug or I am missing some config?

Note that i have not set ShutdownWatchdogSec= in /etc/systemd/system.conf


$ grep -i hardware /var/tmp/j12_systemctl_reboot_jobtimeout5sec_1

Mar 18 23:42:11 re1 systemd[1]: Hardware watchdog 'iTCO_wdt', version 0
Mar 18 23:42:11 re1 systemd[1]: Set hardware watchdog to 1min 4s.
Mar 18 23:42:32 re1 systemd[1]: Set hardware watchdog to 4min.
6) RuntimeWatchdogSec does not seem to work.
I have set it to 90 sec, but i see my system getting rebooted due to
hardware watchdog getting triggered as I see in my console 'NMI received'
This will not happen if i have  only watchdog.service
(running /usr/sbin/watchdog ) and not set  *RuntimeWatchdogSec* .
this observation indicates that  *RuntimeWatchdogSec*  does not seem to do
what it is supposed to do.

7)  hw watchdg time out seems to be be non-configurable and always
hardcoded to 1min 4 sec.
neither  *RuntimeWatchdogSec* nor  ShutDownTimeWatchDogSec setting are
having effect on hw wd timeout.
i see hw watchdog NMI at reboot after 1min4sec of reboot command even if
ShutDownTimeWatchDogSec  is configured to 10 min
is this a systemd bug ?

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


Re: [systemd-devel] ShutdownWatchdogSec does not work as described

2018-03-19 Thread prashantkumar dhotre
I see another issue also wrt hardware watchdog
reboot-force seem to be overwriting the hardware watchdog timeout value.

I have changed  reboot.target to make JobTimeoutSec=5sec
when system boots up i see that hardware watchdog is set to 1 min 4 sec.
but when 'systemctl reboot' timesout , reboot-force is invoked and that is
overwriting the
hardware watchdog timeout value to 4 min.
Is this a bug or I am missing some config?

Thanks



# grep -i hardware  /var/tmp/j12_systemctl_reboot_jobtimeout5sec_1

Mar 18 23:42:11 re1 systemd[1]: Hardware watchdog 'iTCO_wdt', version 0
Mar 18 23:42:11 re1 systemd[1]: Set hardware watchdog to 1min 4s.
Mar 18 23:42:32 re1 systemd[1]: Set hardware watchdog to 4min.

+++

root@bng-evo-ptx5k-c-re1:~# cat   /lib/systemd/system/reboot.target
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=Reboot
Documentation=man:systemd.special(7)
DefaultDependencies=no
Requires=systemd-reboot.service
After=systemd-reboot.service
AllowIsolate=yes
#JobTimeoutSec=30min
JobTimeoutSec=5sec
JobTimeoutAction=reboot-force

[Install]
Alias=ctrl-alt-del.target




On Mon, Mar 19, 2018 at 11:41 AM, prashantkumar dhotre <
prashantkumardho...@gmail.com> wrote:

> Hi
> I am observing that  ShutdownWatchdogSec   setting in  system.conf
>
> In man page, for ShutdownWatchdogSec, I see :
> " It works as a safety net to ensure that the reboot takes place even if a
> clean reboot attempt times out. "
> I am not clear what is meant by 'clean reboot' and 'times out ' here
>
> For testing, I have set it to 5 sec
>
> ++
> root@re1:~# grep ShutdownWatchdogSec /etc/systemd/system.conf
> ShutdownWatchdogSec=5sec
> root@re1:~#
> ++
>
>
> and I have my.service , which on stop will sleep for few minutes
>
> ++
> # cat /etc/systemd/system/my.service
> [Unit]
> Description="my"
>
> [Service]
> Type=oneshot
> RemainAfterExit=yes
> ExecStart=/bin/true
> ExecStopPost=/bin/sleep 3000
> Restart=no
>
> [Install]
> WantedBy=multi-user.target
> ++
>
> But I dont see hardware watchdog being kicked in.
> Is this a bug in ShutdownWatchdogSec ? if not am I missing any config ?
>
> I did some research and found below links which talk about effect of
> ShutdownWatchdogSec .
>
> https://utcc.utoronto.ca/~cks/space/blog/linux/SystemdNFSMountShutdown
> https://utcc.utoronto.ca/~cks/space/blog/linux/SystemdShutdownWatchdog
>
> as described in above pages, one option seem to be to lower value of
> JobTimeoutSec
> <https://www.freedesktop.org/software/systemd/man/systemd.unit.html> in
> reboot.target but that solution is still about software watchdog and not
> about hardware watchdog.
>
>
> My requirement is to put upper bound time limit of reboot, and once upper
> limit is reached, i want to kick in hardware watchdog
>
> Could you please let me know how do I achieve this ?
>
> Thanks
>
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] ShutdownWatchdogSec does not work as described

2018-03-19 Thread prashantkumar dhotre
Hi
I am observing that  ShutdownWatchdogSec   setting in  system.conf

In man page, for ShutdownWatchdogSec, I see :
" It works as a safety net to ensure that the reboot takes place even if a
clean reboot attempt times out. "
I am not clear what is meant by 'clean reboot' and 'times out ' here

For testing, I have set it to 5 sec

++
root@re1:~# grep ShutdownWatchdogSec /etc/systemd/system.conf
ShutdownWatchdogSec=5sec
root@re1:~#
++


and I have my.service , which on stop will sleep for few minutes

++
# cat /etc/systemd/system/my.service
[Unit]
Description="my"

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/true
ExecStopPost=/bin/sleep 3000
Restart=no

[Install]
WantedBy=multi-user.target
++

But I dont see hardware watchdog being kicked in.
Is this a bug in ShutdownWatchdogSec ? if not am I missing any config ?

I did some research and found below links which talk about effect of
ShutdownWatchdogSec .

https://utcc.utoronto.ca/~cks/space/blog/linux/SystemdNFSMountShutdown
https://utcc.utoronto.ca/~cks/space/blog/linux/SystemdShutdownWatchdog

as described in above pages, one option seem to be to lower value of
JobTimeoutSec
 in
reboot.target but that solution is still about software watchdog and not
about hardware watchdog.


My requirement is to put upper bound time limit of reboot, and once upper
limit is reached, i want to kick in hardware watchdog

Could you please let me know how do I achieve this ?

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


Re: [systemd-devel] safe and fast shutdown/reboot

2018-03-16 Thread prashantkumar dhotre
Thanks
I understand that
'systemctl isolate other.target' will stop all present services and start
services of other.target

My thinking is :
I can put all my apps in my.target
and my.target can start after multi-user.target.

When shutting down , somewhere first i will do 'systemctl iso
multi-user.target' so that all my services in my.target will stop.
but my understanding is this will stop my services with SIGTERM
but i want them to be killed with SIGKILL.
Is there a way to SIGKILL my services in my.target when i do  'systemctl
iso multi-user.target' (something equivalent to concept of  ' systemctl iso
multi-user.target --signal= SIGKILL  ' )  ?

Regards



On Fri, Mar 16, 2018 at 1:19 PM, Andrei Borzenkov 
wrote:

> 16.03.2018 10:19, aleivag пишет:
> >>
> >>
> >> Won't work. Status changes only when job for a unit completes and jobs
> >> are executed in order of dependencies. Actually, jobs are *queued* in
> >> order of dependencies so nothing would indicate that you are going to
> >> shutdown until it is too late (i.e. all normal services are stopped).
> >>
> >>
> > yes, but those units have started, so during a `systemctl reboot` you can
> > execute
> >
> > [~] systemctl list-jobs shutdown.target reboot.target
> >  JOB UNITTYPE  STATE
> > 1972 reboot.target   start waiting
> > 1974 shutdown.target start waiting
> >
> > 2 jobs listed.
> >
> > and get if shutdown has started
> >
>
> Yes, you are right. I'm sure I have seen cases when jobs were not
> present in other cases so I assumed it will be here as well.
>
> > the other thing that may help you know if you are in shutdown mode is
> > execute `systemctl is-system-running`  and then check if returns
> `stopping`,
> > during a shutdown is suppose to return something like that. and i think
> it
> > does this by checking is shutdown.target has started (
> > https://github.com/systemd/systemd/blob/7a30dfeb18d09940a844389e06b25c
> a2bca5e093/src/core/manager.c#L3833-L3836
> > )
> >
>
> Yes, could be more reliable.
>
> >
> > Logically runlevel is not changed until *after* new runlevel has been
> >> reached. Practically systemd does not update runlevel during shutdown at
> >> all.
> >
> >
> > yeap, you are right here, i was wrong :D
> >
>
> ___
> 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] safe and fast shutdown/reboot

2018-03-15 Thread prashantkumar dhotre
Thanks but I want to sigkill my services only during system shutdown and
not on normal service stop 'systemctl myservice stop'.
so I can not use ' KillSignal' setting. Is there any other way ?

On Fri, Mar 16, 2018 at 9:23 AM, Zeal Jagannatha <zealjaganna...@gmail.com>
wrote:

> I think it would be better for the services you define to specifically
> define their own `KillSignal` so you can control how they shutdown.
> https://www.freedesktop.org/software/systemd/man/systemd.
> kill.html#KillSignal=
>
> It's may not be safe for all the services on the machine to be shut down
> with SIGKILL, so you should avoid using '--force' unless you know that
> everything running on the system is safe to shutdown with SIGKILL.
>
> On Thu, Mar 15, 2018 at 8:43 PM prashantkumar dhotre <
> prashantkumardho...@gmail.com> wrote:
>
>> Hi
>> I see that default reboot/systemctl reboot command issues SIGTERM to my
>> apps and hence it is doing graceful stop of apps and this may take some
>> time and hence shutdown time may be little longer.
>>
>> I am looking for safe and fastest shutdown/reboot method.
>>
>>
>> a) It is OK if my apps are stopped ungracefully during shutdown .(app
>> should not start automatically again after they are killed/stopped during
>> shutdown)
>>
>> b)  file system and such system level stuff needs to be cleanly shut down
>>
>> 1) From my research, I see that 'systemctl reboot --force' is the one I
>> can use.
>> I understand that this command sends SIGKILL to my apps.
>> So this satisfies both (a) and (b) and hence this command should be used
>> to reboot faster.
>> Could you please confirm ?
>> If this is not right method, please comment on which method to use.
>>
>> 2) Also is there a way to limit SIGKILL to only my apps when I do ' 
>> 'systemctl
>> reboot --force'
>> so that rest of the system level services still get stopped gracefully
>>
>> 3) If  'systemctl reboot --force' is correct command to use in my case,
>> then during shutdown , will my apps get restarted
>> due to 'Restart'/'StartLimitBurst'/'StartLimitInterval' settings in
>> service file ? I dont want my apps to get restarted if they are
>> stopped/killed during system shutdown
>>
>>
>> Thanks
>>
>>
>>
>> ___
>> 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


[systemd-devel] safe and fast shutdown/reboot

2018-03-15 Thread prashantkumar dhotre
Hi
I see that default reboot/systemctl reboot command issues SIGTERM to my
apps and hence it is doing graceful stop of apps and this may take some
time and hence shutdown time may be little longer.

I am looking for safe and fastest shutdown/reboot method.


a) It is OK if my apps are stopped ungracefully during shutdown .(app
should not start automatically again after they are killed/stopped during
shutdown)

b)  file system and such system level stuff needs to be cleanly shut down

1) From my research, I see that 'systemctl reboot --force' is the one I can
use.
I understand that this command sends SIGKILL to my apps.
So this satisfies both (a) and (b) and hence this command should be used to
reboot faster.
Could you please confirm ?
If this is not right method, please comment on which method to use.

2) Also is there a way to limit SIGKILL to only my apps when I do ' 'systemctl
reboot --force'
so that rest of the system level services still get stopped gracefully

3) If  'systemctl reboot --force' is correct command to use in my case,
then during shutdown , will my apps get restarted
due to 'Restart'/'StartLimitBurst'/'StartLimitInterval' settings in service
file ? I dont want my apps to get restarted if they are stopped/killed
during system shutdown


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


[systemd-devel] How to get notification when time changes

2018-01-23 Thread prashantkumar dhotre
Hi
When time changes in system , I see
"systemd[1]: Time has been changed" journal log. From systemd,
Is there a way for my app to get notification about this time change event ?
>From code it does not look like we have a way.
Thanks
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] failed to schedule restart job: Transaction is destructive.

2017-11-28 Thread prashantkumar dhotre
Exec StopPost script writes to log file and writes to zookeeper.
I have checked that , that script takes Max 2 sec to finish.
To recreate issue, I have tried doing mre work in the script so that script
take more than 1 min but I could not recreate issue

On Nov 28, 2017 4:34 PM, "Mantas Mikulėnas" <graw...@gmail.com> wrote:

> On Tue, Nov 28, 2017 at 11:14 AM, prashantkumar dhotre <
> prashantkumardho...@gmail.com> wrote:
>
>> Hi
>> Sometimes i see that service restart fails with
>> systemd[1]: *my.service failed to schedule restart job: Transaction is
>> destructive.*
>>
>> above error is very rare.
>> I have defined ExecStopPost script in my service file.
>> this problem does not always happen and  there is no defined steps to
>> recreate this.
>> Any idea what may cause above error ? is it ExecStopPost  script.
>>
>
> What does your ExecStopPost script do?
>
> --
> Mantas Mikulėnas <graw...@gmail.com>
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] failed to schedule restart job: Transaction is destructive.

2017-11-28 Thread prashantkumar dhotre
Hi
Sometimes i see that service restart fails with
systemd[1]: *my.service failed to schedule restart job: Transaction is
destructive.*

above error is very rare.
I have defined ExecStopPost script in my service file.
this problem does not always happen and  there is no defined steps to
recreate this.
Any idea what may cause above error ? is it ExecStopPost  script.
how to resolve that ?
thanks
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] how to correctly specify dependency on dbus

2017-05-23 Thread prashantkumar dhotre
Thanks.
my service runs during early bootup.
one intermittent issue I am seeing is that my service fails in
dbus_bus_get_private() with error:

 07:45:19 : dbus_bus_get_private() failed with error: Failed to
connect to socket /var/run/dbus/system_bus_socket: No such file or
directory


dbus service started at 07:44:34  and my service started at  07:45:19
which is 45 sec after dbus and also I see
/var/run/dbus/system_bus_socket present before this error.


#systemctl status dbus :
 * dbus.service - D-Bus System Message Bus
   Loaded: loaded (/lib/systemd/system/dbus.service; static; vendor
preset: enabled)
   Active: active (running) since Tue 2017-05-02 07:44:34 UTC; 40s ago
 Docs: man:dbus-daemon(1)
 Main PID: 1574 (dbus-daemon)
   CGroup: /system.slice/dbus.service
   `-1574 /usr/bin/dbus-daemon --system --address=systemd:
--nofork --nopidfile --systemd-activation

 07:45:15:  netstat -anp | grep dbus :
 unix  2  [ ACC ] STREAM LISTENING 116811/init
 /var/run/dbus/system_bus_socket
unix  3  [ ] STREAM CONNECTED 118311574/dbus-daemon
unix  3  [ ] STREAM CONNECTED 109071574/dbus-daemon
unix  3  [ ] STREAM CONNECTED 118301574/dbus-daemon
unix  3  [ ] STREAM CONNECTED 11833
1574/dbus-daemon/var/run/dbus/system_bus_socket
unix  3  [ ] STREAM CONNECTED 11832
1574/dbus-daemon/var/run/dbus/system_bus_socket


not sure why dbus API is failing even though the socket is present.
So am I missing to add any dependency in my service file ?


On Sat, Apr 29, 2017 at 10:36 PM, Lennart Poettering
<lenn...@poettering.net> wrote:
> On Wed, 26.04.17 10:09, prashantkumar dhotre (prashantkumardho...@gmail.com) 
> wrote:
>
>> Hi
>> For my service,  I have:
>>
>> # cat my.service
>> [Unit]
>> Description=My Service
>> After=dbus.service
>> Requires=dbus.service
>> ...
>> ...
>>
>> Some time i see that my service fails to get dbus connection
>> (dbus_bus_get_private() fails without any error msg).
>> one possibility i think is that dbus is not fully initialized.
>> From above service file config, i understand when i start my service,
>> dbus service is started 1st and then my service.
>> but i am not sure if my service start step is delayed until dbus is
>> fully up , initialized and running and ready to accept conections.
>> is there a way to specify this in my service file.
>
> Regular system services do not have to declare any explicit dependency
> on D-Bus, as D-Bus is always and unconditionally available in the later
> boot phase (where regular services are started) and during runtime.
>
> If your service runs during the early boot phase however (i.e. before
> basic.target is reached, meaning your service has
> DefaultDependencies=no set), then you do need an explicit dependency,
> but should only specify it as After=dbus.socket +
> Requires=dbus.socket (i.e. on the socket rather than the service).
>
> If you don't know whether your service is an early or late boot
> service then it's almost certainly a late boot service.
>
>> For ex, for systemd-networkd,service, i see it specify  like :
>>
>> # On kdbus systems we pull in the busname explicitly, because it
>> # carries policy that allows the daemon to acquire its name.
>> Wants=org.freedesktop.network1.busname
>> After=org.freedesktop.network1.busname
>>
>>
>> Can i use same (specifying After/Wants on a dbus name) ?
>
> Please ignore anything related to kdbus in the source, this is
> supported no longer, and does not apply to regular D-Bus.
>
>
>
> Lennart
>
> --
> Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] SIGHUP to systemd

2017-05-21 Thread prashantkumar dhotre
Hi
What happens when SIGHUP is sent by some service to systemd (PID 1 ) ?
I see below lines in journalctl logs

 systemd[1]: Received SIGHUP from PID 27128 (myservice).
 systemd[1]: Reloading.
 systemd[1]: Configuration file /lib/systemd/system/xyz.service is
marked executable. Please remove executable permission bits.
Proceeding  anyway.

Does SIGHUP ends up killing any process ?
Where do I see code for handling SIGHUP in systemd src (file/function) ?

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


[systemd-devel] how to correctly specify dependency on dbus

2017-04-25 Thread prashantkumar dhotre
Hi
For my service,  I have:

# cat my.service
[Unit]
Description=My Service
After=dbus.service
Requires=dbus.service
...
...

Some time i see that my service fails to get dbus connection
(dbus_bus_get_private() fails without any error msg).
one possibility i think is that dbus is not fully initialized.
From above service file config, i understand when i start my service,
dbus service is started 1st and then my service.
but i am not sure if my service start step is delayed until dbus is
fully up , initialized and running and ready to accept conections.
is there a way to specify this in my service file.

For ex, for systemd-networkd,service, i see it specify  like :

# On kdbus systems we pull in the busname explicitly, because it
# carries policy that allows the daemon to acquire its name.
Wants=org.freedesktop.network1.busname
After=org.freedesktop.network1.busname


Can i use same (specifying After/Wants on a dbus name) ?
Appreciate your help on this.
Thanks
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel