Re: [systemd-devel] Timeout for 'Activating (start)' status

2017-07-11 Thread Mikhail Kasimov

11.07.2017 17:13, Lennart Poettering пишет:
> On Tue, 11.07.17 14:46, Mikhail Kasimov (mikhail.kasi...@gmail.com) wrote:
>
>> Or, please, give a hint how service, which works in 'start -> do
>> something->exit' scheme (so this is oneshot type, as I understand:
>> https://www.freedesktop.org/software/systemd/man/systemd.service.html :
>> "Behavior of |oneshot| is similar to |simple|; however, it is expected
>> that the *process has to exit* before systemd starts follow-up units."),
>> be forced to be restarted on its failure.
> There's an RFE issue about adding Restart= for Type=oneshot too:
>
> https://github.com/systemd/systemd/issues/2582
>
> Would be happy to take patches that make that work...

Thanks for info!

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


Re: [systemd-devel] Timeout for 'Activating (start)' status

2017-07-11 Thread Lennart Poettering
On Tue, 11.07.17 14:46, Mikhail Kasimov (mikhail.kasi...@gmail.com) wrote:

> Or, please, give a hint how service, which works in 'start -> do
> something->exit' scheme (so this is oneshot type, as I understand:
> https://www.freedesktop.org/software/systemd/man/systemd.service.html :
> "Behavior of |oneshot| is similar to |simple|; however, it is expected
> that the *process has to exit* before systemd starts follow-up units."),
> be forced to be restarted on its failure.

There's an RFE issue about adding Restart= for Type=oneshot too:

https://github.com/systemd/systemd/issues/2582

Would be happy to take patches that make that work...

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] Timeout for 'Activating (start)' status

2017-07-11 Thread Mikhail Kasimov
Hello!


11.07.2017 13:49, Lennart Poettering пишет:
> On Thu, 06.07.17 16:43, Mikhail Kasimov (mikhail.kasi...@gmail.com) wrote:
>
>> Hello!
>>
>> 've got an interesting trouble on timer-activated service -- 'systemctl
>> status' returns a log with 'Activating (start)' status:
>>
>> [1]
>> ==
>> k_mikhail@linux-mk500:~> systemctl status vba32update.service
>> ● vba32update.service - VBA32 Anti-Virus Update Service
>>Loaded: loaded (/etc/systemd/system/vba32update.service; disabled;
>> vendor preset: disabled)
>>Active: activating (start) since Чтв 2017-07-06 15:32:35 EEST; 35min ago
>>  Main PID: 6214 (vbaupdx)
>> Tasks: 1 (limit: 512)
>>CGroup: /system.slice/vba32update.service
>>└─6214 ./vbaupdx http://anti-virus.by/beta/update
>>
>> Июл 06 15:32:35 linux-mk500 systemd[1]: Starting VBA32 Anti-Virus Update
>> Service...
>> Июл 06 15:32:35 linux-mk500 vbacl[6214]: Vba32 console scanner update
>> process started
>> Июл 06 15:32:35 linux-mk500 vbacl[6214]: Reading configuration options
>> from ./vbacl.ini
>> Июл 06 15:32:35 linux-mk500 vbacl[6214]: Using direct connection for update
>> k_mikhail@linux-mk500:~>
>> ==
>>
>>
>> Simultaneously:
>> [2]
>> ==
>> k_mikhail@linux-mk500:~> systemctl list-units -t timer
>> UNIT LOAD   ACTIVE SUB DESCRIPTION
>> vba32update.timerloaded active running Runs VBA32 Update Hourly
>> ==
>>
>> And that is normal. But 35 minutes for activating service is too long,
>> as for me.
> Well, process 6214 is still around as you can see above, and since you
> appear to have set Type=oneshot, that's really the right behaviour:
> the unit will be starting until process 6214 decides. if 35min is too
> long for that process, then this indicates that something is wrong in
> that process, and systemd is just the messenger.
>
> If you want to place a timeout on starting use TimeoutStartSec= and
> set it to whatever you like. If the timeout is then hit, systemd will
> abort the process and log about this and place the service in a failed
> state.

No problem at all. I 've modified vba32update.service by adding
TimeoutStarSec= and Restart=on-failure directives, because I wanna force
to restart service automatically if it gets 'failed' status.

[1]

k_mikhail@linux-mk500:~> cat vba32update.service
[Unit]

Description=VBA32 Anti-Virus Update Service
Requires=network.target
Wants=network-online.target
After=network.target network-online.target

[Service]
Type=oneshot
WorkingDirectory=/opt/vba/vbacl/
ExecStart=/opt/vba/vbacl/vbacl --update
EnvironmentFile=/opt/vba/vbacl/vbacl.ini
TimeoutStartSec=120s
Restart=on-failure

[Install]
WantedBy=multi-user.target



Then attempt to vba32update.service:

k_mikhail@linux-mk500:~> systemctl status -l vba32update.service
● vba32update.service - VBA32 Anti-Virus Update Service
   Loaded: error (Reason: Invalid argument)
   Active: activating (start) since Вто 2017-07-11 02:48:54 EEST; 11h ago
 Main PID: 22712 (vbaupdx)
   CGroup: /system.slice/vba32update.service
   └─22712 ./vbaupdx http://anti-virus.by/beta/update

Июл 11 02:48:54 linux-mk500 systemd[1]: Starting VBA32 Anti-Virus Update
Service...
Июл 11 02:48:54 linux-mk500 vbacl[22712]: Vba32 console scanner update
process started
Июл 11 02:48:54 linux-mk500 vbacl[22712]: Reading configuration options
from ./vbacl.ini
Июл 11 02:48:54 linux-mk500 vbacl[22712]: Using direct connection for update
Июл 11 14:22:19 linux-mk500 systemd[1]: vba32update.service: Service has
Restart= setting other than no, which isn't allowed for Type=oneshot
services. Refusing.


Brilliant. Let's go to man-page
https://www.freedesktop.org/software/systemd/man/systemd.service.html on
Restart= directive text and we can see _no_ _info_ about such
restriction. Lack-of-info on documentaion.

Or, please, give a hint how service, which works in 'start -> do
something->exit' scheme (so this is oneshot type, as I understand:
https://www.freedesktop.org/software/systemd/man/systemd.service.html :
"Behavior of |oneshot| is similar to |simple|; however, it is expected
that the *process has to exit* before systemd starts follow-up units."),
be forced to be restarted on its failure.
>
> But systemd is not a magic wand that can make hanging processes
> suddenly work...

I understand it. I just try to find the way how to resolve my usecase
problem by options, which systemd provides.

Thanks!


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


Re: [systemd-devel] Timeout for 'Activating (start)' status

2017-07-11 Thread Lennart Poettering
On Thu, 06.07.17 16:43, Mikhail Kasimov (mikhail.kasi...@gmail.com) wrote:

> Hello!
> 
> 've got an interesting trouble on timer-activated service -- 'systemctl
> status' returns a log with 'Activating (start)' status:
> 
> [1]
> ==
> k_mikhail@linux-mk500:~> systemctl status vba32update.service
> ● vba32update.service - VBA32 Anti-Virus Update Service
>Loaded: loaded (/etc/systemd/system/vba32update.service; disabled;
> vendor preset: disabled)
>Active: activating (start) since Чтв 2017-07-06 15:32:35 EEST; 35min ago
>  Main PID: 6214 (vbaupdx)
> Tasks: 1 (limit: 512)
>CGroup: /system.slice/vba32update.service
>└─6214 ./vbaupdx http://anti-virus.by/beta/update
> 
> Июл 06 15:32:35 linux-mk500 systemd[1]: Starting VBA32 Anti-Virus Update
> Service...
> Июл 06 15:32:35 linux-mk500 vbacl[6214]: Vba32 console scanner update
> process started
> Июл 06 15:32:35 linux-mk500 vbacl[6214]: Reading configuration options
> from ./vbacl.ini
> Июл 06 15:32:35 linux-mk500 vbacl[6214]: Using direct connection for update
> k_mikhail@linux-mk500:~>
> ==
> 
> 
> Simultaneously:
> [2]
> ==
> k_mikhail@linux-mk500:~> systemctl list-units -t timer
> UNIT LOAD   ACTIVE SUB DESCRIPTION
> vba32update.timerloaded active running Runs VBA32 Update Hourly
> ==
> 
> And that is normal. But 35 minutes for activating service is too long,
> as for me.

Well, process 6214 is still around as you can see above, and since you
appear to have set Type=oneshot, that's really the right behaviour:
the unit will be starting until process 6214 decides. if 35min is too
long for that process, then this indicates that something is wrong in
that process, and systemd is just the messenger.

If you want to place a timeout on starting use TimeoutStartSec= and
set it to whatever you like. If the timeout is then hit, systemd will
abort the process and log about this and place the service in a failed
state.

But systemd is not a magic wand that can make hanging processes
suddenly work...

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] Timeout for 'Activating (start)' status

2017-07-07 Thread Mikhail Kasimov
Hello, everyone!


06.07.2017 19:17, Mikhail Kasimov пишет:
>
> 06.07.2017 19:12, Mikhail Kasimov пишет:
>> 06.07.2017 18:27, Michael Chapman пишет:
>>> On Fri, 7 Jul 2017, Mikhail Kasimov wrote:
 06.07.2017 17:18, Michael Chapman пишет:
> On Thu, 6 Jul 2017, Mikhail Kasimov wrote:
>> Hello!
>>
>> 've got an interesting trouble on timer-activated service --
>> 'systemctl
>> status' returns a log with 'Activating (start)' status:
>>
>> [1]
>> ==
>> k_mikhail@linux-mk500:~> systemctl status vba32update.service
>> ● vba32update.service - VBA32 Anti-Virus Update Service
>>   Loaded: loaded (/etc/systemd/system/vba32update.service; disabled;
>> vendor preset: disabled)
>>   Active: activating (start) since Чтв 2017-07-06 15:32:35 EEST;
>> 35min ago
>> Main PID: 6214 (vbaupdx)
>>Tasks: 1 (limit: 512)
>>   CGroup: /system.slice/vba32update.service
>>   └─6214 ./vbaupdx http://anti-virus.by/beta/update
>>
>> Июл 06 15:32:35 linux-mk500 systemd[1]: Starting VBA32 Anti-Virus
>> Update
>> Service...
>> Июл 06 15:32:35 linux-mk500 vbacl[6214]: Vba32 console scanner update
>> process started
>> Июл 06 15:32:35 linux-mk500 vbacl[6214]: Reading configuration options
>> from ./vbacl.ini
>> Июл 06 15:32:35 linux-mk500 vbacl[6214]: Using direct connection for
>> update
>> k_mikhail@linux-mk500:~>
>> ==
>>
>>
>> Simultaneously:
>> [2]
>> ==
>> k_mikhail@linux-mk500:~> systemctl list-units -t timer
>> UNIT LOAD   ACTIVE SUB DESCRIPTION
>> vba32update.timerloaded active running Runs VBA32 Update
>> Hourly
>> ==
>>
>> And that is normal. But 35 minutes for activating service is too long,
>> as for me.
> Is this a Type=oneshot service?
>
> It's a bit weird, but Type=oneshot services are not considered to be
> fully started until the ExecStart= command has exited. Until that time
> they're still "activating".
>
> You may be better off making the service Type=simple instead. A
> Type=simple service is fully started as soon as it has spawned the
> ExecStart= command.
 Yes, Type=oneshot, because, if Type=simple, service will be active
 permanently in case of its start. But this is not what is needed here --
 service should be started, then to check the updates of anti-virus
 software and then be successfully closed. Nothing more. Only one thing
 can impact here -- remote anti-virus server connection timeout. And if
 server connection timeout is set in wrong way, having a native systemd
 forced timeout for oneshot-services may be useful.
>>> I still think you want Type=simple there. A Type=simple service can
>>> exit when it's finished doing whatever it needs to do. The service
>>> will then transition back to its inactive state.
>>>
>>> Really, I think the only time Type=oneshot should be used is when you
>>> have a _sequence_ of units, where one unit shouldn't be started until
>>> the previous one has finished. You don't have that here.
>> Ok, here is Type=oneshot. And we can see two sessions of our service
>> (at1 7:06:52 and 18:06:57):
>> ==
>> [1]
>> Июл 06 17:06:52 linux-mk500 systemd[1]: Starting VBA32 Anti-Virus Update
>> Service...
>> Июл 06 17:06:52 linux-mk500 vbacl[8058]: Vba32 console scanner update
>> process started
>> Июл 06 17:06:52 linux-mk500 vbacl[8058]: Reading configuration options
>> from ./vbacl.ini
>> Июл 06 17:06:52 linux-mk500 vbacl[8058]: Using direct connection for update
>> Июл 06 17:06:56 linux-mk500 vbacl[8058]: Current dir is ./
>> Июл 06 17:06:56 linux-mk500 vbacl[8058]: Start update from
>> http://anti-virus.by/beta/update
>> Июл 06 17:06:56 linux-mk500 vbacl[8058]: Receiving file list
>> Июл 06 17:06:56 linux-mk500 vbacl[8058]: File list received
>> Июл 06 17:06:56 linux-mk500 vbacl[8058]: Update is not needed
>> Июл 06 17:06:57 linux-mk500 systemd[1]: Started VBA32 Anti-Virus Update
>> Service.
>>
>> [2]
>> Июл 06 18:06:57 linux-mk500 systemd[1]: Starting VBA32 Anti-Virus Update
>> Service...
>> Июл 06 18:06:57 linux-mk500 vbacl[8842]: Vba32 console scanner update
>> process started
>> Июл 06 18:06:57 linux-mk500 vbacl[8842]: Reading configuration options
>> from ./vbacl.ini
>> Июл 06 18:06:57 linux-mk500 vbacl[8842]: Using direct connection for update
>> Июл 06 18:07:00 linux-mk500 vbacl[8842]: Current dir is ./
>> Июл 06 18:07:00 linux-mk500 vbacl[8842]: Start update from
>> http://anti-virus.by/beta/update
>> Июл 06 18:07:00 linux-mk500 vbacl[8842]: Receiving file list
>> Июл 06 18:07:00 linux-mk500 vbacl[8842]: File list received
>> Июл 06 18:07:00 linux-mk500 vbacl[8842]: Update is not needed
>> Июл 06 18:07:00 linux-mk500 systemd[1]: Started VBA32 Anti-Virus Update
>> Service.
>> ==
>>
>>
>> And here when Type=simple:
>> =

Re: [systemd-devel] Timeout for 'Activating (start)' status

2017-07-06 Thread Mikhail Kasimov


06.07.2017 19:12, Mikhail Kasimov пишет:
>
> 06.07.2017 18:27, Michael Chapman пишет:
>> On Fri, 7 Jul 2017, Mikhail Kasimov wrote:
>>> 06.07.2017 17:18, Michael Chapman пишет:
 On Thu, 6 Jul 2017, Mikhail Kasimov wrote:
> Hello!
>
> 've got an interesting trouble on timer-activated service --
> 'systemctl
> status' returns a log with 'Activating (start)' status:
>
> [1]
> ==
> k_mikhail@linux-mk500:~> systemctl status vba32update.service
> ● vba32update.service - VBA32 Anti-Virus Update Service
>   Loaded: loaded (/etc/systemd/system/vba32update.service; disabled;
> vendor preset: disabled)
>   Active: activating (start) since Чтв 2017-07-06 15:32:35 EEST;
> 35min ago
> Main PID: 6214 (vbaupdx)
>Tasks: 1 (limit: 512)
>   CGroup: /system.slice/vba32update.service
>   └─6214 ./vbaupdx http://anti-virus.by/beta/update
>
> Июл 06 15:32:35 linux-mk500 systemd[1]: Starting VBA32 Anti-Virus
> Update
> Service...
> Июл 06 15:32:35 linux-mk500 vbacl[6214]: Vba32 console scanner update
> process started
> Июл 06 15:32:35 linux-mk500 vbacl[6214]: Reading configuration options
> from ./vbacl.ini
> Июл 06 15:32:35 linux-mk500 vbacl[6214]: Using direct connection for
> update
> k_mikhail@linux-mk500:~>
> ==
>
>
> Simultaneously:
> [2]
> ==
> k_mikhail@linux-mk500:~> systemctl list-units -t timer
> UNIT LOAD   ACTIVE SUB DESCRIPTION
> vba32update.timerloaded active running Runs VBA32 Update
> Hourly
> ==
>
> And that is normal. But 35 minutes for activating service is too long,
> as for me.
 Is this a Type=oneshot service?

 It's a bit weird, but Type=oneshot services are not considered to be
 fully started until the ExecStart= command has exited. Until that time
 they're still "activating".

 You may be better off making the service Type=simple instead. A
 Type=simple service is fully started as soon as it has spawned the
 ExecStart= command.
>>> Yes, Type=oneshot, because, if Type=simple, service will be active
>>> permanently in case of its start. But this is not what is needed here --
>>> service should be started, then to check the updates of anti-virus
>>> software and then be successfully closed. Nothing more. Only one thing
>>> can impact here -- remote anti-virus server connection timeout. And if
>>> server connection timeout is set in wrong way, having a native systemd
>>> forced timeout for oneshot-services may be useful.
>> I still think you want Type=simple there. A Type=simple service can
>> exit when it's finished doing whatever it needs to do. The service
>> will then transition back to its inactive state.
>>
>> Really, I think the only time Type=oneshot should be used is when you
>> have a _sequence_ of units, where one unit shouldn't be started until
>> the previous one has finished. You don't have that here.
> Ok, here is Type=oneshot. And we can see two sessions of our service
> (at1 7:06:52 and 18:06:57):
> ==
> [1]
> Июл 06 17:06:52 linux-mk500 systemd[1]: Starting VBA32 Anti-Virus Update
> Service...
> Июл 06 17:06:52 linux-mk500 vbacl[8058]: Vba32 console scanner update
> process started
> Июл 06 17:06:52 linux-mk500 vbacl[8058]: Reading configuration options
> from ./vbacl.ini
> Июл 06 17:06:52 linux-mk500 vbacl[8058]: Using direct connection for update
> Июл 06 17:06:56 linux-mk500 vbacl[8058]: Current dir is ./
> Июл 06 17:06:56 linux-mk500 vbacl[8058]: Start update from
> http://anti-virus.by/beta/update
> Июл 06 17:06:56 linux-mk500 vbacl[8058]: Receiving file list
> Июл 06 17:06:56 linux-mk500 vbacl[8058]: File list received
> Июл 06 17:06:56 linux-mk500 vbacl[8058]: Update is not needed
> Июл 06 17:06:57 linux-mk500 systemd[1]: Started VBA32 Anti-Virus Update
> Service.
>
> [2]
> Июл 06 18:06:57 linux-mk500 systemd[1]: Starting VBA32 Anti-Virus Update
> Service...
> Июл 06 18:06:57 linux-mk500 vbacl[8842]: Vba32 console scanner update
> process started
> Июл 06 18:06:57 linux-mk500 vbacl[8842]: Reading configuration options
> from ./vbacl.ini
> Июл 06 18:06:57 linux-mk500 vbacl[8842]: Using direct connection for update
> Июл 06 18:07:00 linux-mk500 vbacl[8842]: Current dir is ./
> Июл 06 18:07:00 linux-mk500 vbacl[8842]: Start update from
> http://anti-virus.by/beta/update
> Июл 06 18:07:00 linux-mk500 vbacl[8842]: Receiving file list
> Июл 06 18:07:00 linux-mk500 vbacl[8842]: File list received
> Июл 06 18:07:00 linux-mk500 vbacl[8842]: Update is not needed
> Июл 06 18:07:00 linux-mk500 systemd[1]: Started VBA32 Anti-Virus Update
> Service.
> ==
>
>
> And here when Type=simple:
> ==
> Июл 06 18:47:29 linux-mk500 systemd[1]: Started VBA32 Anti-Virus Update
> Service.
> Июл 06 18:47:29 linux-mk500 vbacl[10042]: Vba32 console scanner update
> process s

Re: [systemd-devel] Timeout for 'Activating (start)' status

2017-07-06 Thread Mikhail Kasimov


06.07.2017 18:27, Michael Chapman пишет:
> On Fri, 7 Jul 2017, Mikhail Kasimov wrote:
>> 06.07.2017 17:18, Michael Chapman пишет:
>>> On Thu, 6 Jul 2017, Mikhail Kasimov wrote:
 Hello!

 've got an interesting trouble on timer-activated service --
 'systemctl
 status' returns a log with 'Activating (start)' status:

 [1]
 ==
 k_mikhail@linux-mk500:~> systemctl status vba32update.service
 ● vba32update.service - VBA32 Anti-Virus Update Service
   Loaded: loaded (/etc/systemd/system/vba32update.service; disabled;
 vendor preset: disabled)
   Active: activating (start) since Чтв 2017-07-06 15:32:35 EEST;
 35min ago
 Main PID: 6214 (vbaupdx)
Tasks: 1 (limit: 512)
   CGroup: /system.slice/vba32update.service
   └─6214 ./vbaupdx http://anti-virus.by/beta/update

 Июл 06 15:32:35 linux-mk500 systemd[1]: Starting VBA32 Anti-Virus
 Update
 Service...
 Июл 06 15:32:35 linux-mk500 vbacl[6214]: Vba32 console scanner update
 process started
 Июл 06 15:32:35 linux-mk500 vbacl[6214]: Reading configuration options
 from ./vbacl.ini
 Июл 06 15:32:35 linux-mk500 vbacl[6214]: Using direct connection for
 update
 k_mikhail@linux-mk500:~>
 ==


 Simultaneously:
 [2]
 ==
 k_mikhail@linux-mk500:~> systemctl list-units -t timer
 UNIT LOAD   ACTIVE SUB DESCRIPTION
 vba32update.timerloaded active running Runs VBA32 Update
 Hourly
 ==

 And that is normal. But 35 minutes for activating service is too long,
 as for me.
>>>
>>> Is this a Type=oneshot service?
>>>
>>> It's a bit weird, but Type=oneshot services are not considered to be
>>> fully started until the ExecStart= command has exited. Until that time
>>> they're still "activating".
>>>
>>> You may be better off making the service Type=simple instead. A
>>> Type=simple service is fully started as soon as it has spawned the
>>> ExecStart= command.
>>
>> Yes, Type=oneshot, because, if Type=simple, service will be active
>> permanently in case of its start. But this is not what is needed here --
>> service should be started, then to check the updates of anti-virus
>> software and then be successfully closed. Nothing more. Only one thing
>> can impact here -- remote anti-virus server connection timeout. And if
>> server connection timeout is set in wrong way, having a native systemd
>> forced timeout for oneshot-services may be useful.
>
> I still think you want Type=simple there. A Type=simple service can
> exit when it's finished doing whatever it needs to do. The service
> will then transition back to its inactive state.
>
> Really, I think the only time Type=oneshot should be used is when you
> have a _sequence_ of units, where one unit shouldn't be started until
> the previous one has finished. You don't have that here.
Ok, here is Type=oneshot. And we can see two sessions of our service
(at1 7:06:52 and 18:06:57):
==
[1]
Июл 06 17:06:52 linux-mk500 systemd[1]: Starting VBA32 Anti-Virus Update
Service...
Июл 06 17:06:52 linux-mk500 vbacl[8058]: Vba32 console scanner update
process started
Июл 06 17:06:52 linux-mk500 vbacl[8058]: Reading configuration options
from ./vbacl.ini
Июл 06 17:06:52 linux-mk500 vbacl[8058]: Using direct connection for update
Июл 06 17:06:56 linux-mk500 vbacl[8058]: Current dir is ./
Июл 06 17:06:56 linux-mk500 vbacl[8058]: Start update from
http://anti-virus.by/beta/update
Июл 06 17:06:56 linux-mk500 vbacl[8058]: Receiving file list
Июл 06 17:06:56 linux-mk500 vbacl[8058]: File list received
Июл 06 17:06:56 linux-mk500 vbacl[8058]: Update is not needed
Июл 06 17:06:57 linux-mk500 systemd[1]: Started VBA32 Anti-Virus Update
Service.

[2]
Июл 06 18:06:57 linux-mk500 systemd[1]: Starting VBA32 Anti-Virus Update
Service...
Июл 06 18:06:57 linux-mk500 vbacl[8842]: Vba32 console scanner update
process started
Июл 06 18:06:57 linux-mk500 vbacl[8842]: Reading configuration options
from ./vbacl.ini
Июл 06 18:06:57 linux-mk500 vbacl[8842]: Using direct connection for update
Июл 06 18:07:00 linux-mk500 vbacl[8842]: Current dir is ./
Июл 06 18:07:00 linux-mk500 vbacl[8842]: Start update from
http://anti-virus.by/beta/update
Июл 06 18:07:00 linux-mk500 vbacl[8842]: Receiving file list
Июл 06 18:07:00 linux-mk500 vbacl[8842]: File list received
Июл 06 18:07:00 linux-mk500 vbacl[8842]: Update is not needed
Июл 06 18:07:00 linux-mk500 systemd[1]: Started VBA32 Anti-Virus Update
Service.
==


And here when Type=simple:
==
Июл 06 18:47:29 linux-mk500 systemd[1]: Started VBA32 Anti-Virus Update
Service.
Июл 06 18:47:29 linux-mk500 vbacl[10042]: Vba32 console scanner update
process started
Июл 06 18:47:29 linux-mk500 vbacl[10042]: Reading configuration options
from ./vbacl.ini
Июл 06 18:47:29 linux-mk500 vbacl[10042]: Using direct connection for update
==

Re: [systemd-devel] Timeout for 'Activating (start)' status

2017-07-06 Thread Michael Chapman

On Fri, 7 Jul 2017, Mikhail Kasimov wrote:

06.07.2017 17:18, Michael Chapman пишет:

On Thu, 6 Jul 2017, Mikhail Kasimov wrote:

Hello!

've got an interesting trouble on timer-activated service -- 'systemctl
status' returns a log with 'Activating (start)' status:

[1]
==
k_mikhail@linux-mk500:~> systemctl status vba32update.service
● vba32update.service - VBA32 Anti-Virus Update Service
  Loaded: loaded (/etc/systemd/system/vba32update.service; disabled;
vendor preset: disabled)
  Active: activating (start) since Чтв 2017-07-06 15:32:35 EEST;
35min ago
Main PID: 6214 (vbaupdx)
   Tasks: 1 (limit: 512)
  CGroup: /system.slice/vba32update.service
  └─6214 ./vbaupdx http://anti-virus.by/beta/update

Июл 06 15:32:35 linux-mk500 systemd[1]: Starting VBA32 Anti-Virus Update
Service...
Июл 06 15:32:35 linux-mk500 vbacl[6214]: Vba32 console scanner update
process started
Июл 06 15:32:35 linux-mk500 vbacl[6214]: Reading configuration options
from ./vbacl.ini
Июл 06 15:32:35 linux-mk500 vbacl[6214]: Using direct connection for
update
k_mikhail@linux-mk500:~>
==


Simultaneously:
[2]
==
k_mikhail@linux-mk500:~> systemctl list-units -t timer
UNIT LOAD   ACTIVE SUB DESCRIPTION
vba32update.timerloaded active running Runs VBA32 Update
Hourly
==

And that is normal. But 35 minutes for activating service is too long,
as for me.


Is this a Type=oneshot service?

It's a bit weird, but Type=oneshot services are not considered to be
fully started until the ExecStart= command has exited. Until that time
they're still "activating".

You may be better off making the service Type=simple instead. A
Type=simple service is fully started as soon as it has spawned the
ExecStart= command.


Yes, Type=oneshot, because, if Type=simple, service will be active
permanently in case of its start. But this is not what is needed here --
service should be started, then to check the updates of anti-virus
software and then be successfully closed. Nothing more. Only one thing
can impact here -- remote anti-virus server connection timeout. And if
server connection timeout is set in wrong way, having a native systemd
forced timeout for oneshot-services may be useful.


I still think you want Type=simple there. A Type=simple service can exit 
when it's finished doing whatever it needs to do. The service will then 
transition back to its inactive state.


Really, I think the only time Type=oneshot should be used is when you have 
a _sequence_ of units, where one unit shouldn't be started until the 
previous one has finished. You don't have that here.



And, by default, there is no way for user\admin to get message, that
there is a problem with activating of some service, except periodical
'systemctl list-units -t timer' command output (in current described
case). And systemd logs contain no interesting info, which can be useful
to investigate the problem and its reasons, because there are no
explicit error-messages for such case.

So, my questions are:
=
1) What is the correct systemd's behavior in such case?


If this is a Type=oneshot service, systemd is working as intended here.


Ok, got that.





2) What is systemd's timeout by default for service activation
(timer-activated, socket-activated)? If it is documentened, please, give
me a hint.


By default, Type=oneshot services don't have a start timeout.



3) If systemd's timeout from 2) is present, how can it be managed by
user\admin? E.g. after 10 minutes of 'Activating (start)', service gets
FAILED state with putting this info to systemd log, of course (something
like "systemd[1] fails to start foobar.service[PID] by timeout.
ExitCode:").


If you do add a TimeoutStartSec= to a Type=oneshot unit, this will
force the unit to be stopped (by killing the process) after that time.
That's probably not what you want.


In general way -- why not?


Well, it acts as a hard-limit for the service lifetime.

If that's actually what you wanted, a more natural way to do it would 
be to use RuntimeMaxSec= on a Type=simple service.



  For more twisted cases I can use OnFailure=
directive here, I suppose. So, will try to play with TimeoutStartSec=
directive.



For a Type=simple service, the default TimeoutStartSec= is set in
/etc/systemd/system.conf. It will be 90 seconds unless you've changed it.



Ok, thanks for clarifying and help!


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


Re: [systemd-devel] Timeout for 'Activating (start)' status

2017-07-06 Thread Mikhail Kasimov


06.07.2017 17:18, Michael Chapman пишет:
> On Thu, 6 Jul 2017, Mikhail Kasimov wrote:
>> Hello!
>>
>> 've got an interesting trouble on timer-activated service -- 'systemctl
>> status' returns a log with 'Activating (start)' status:
>>
>> [1]
>> ==
>> k_mikhail@linux-mk500:~> systemctl status vba32update.service
>> ● vba32update.service - VBA32 Anti-Virus Update Service
>>   Loaded: loaded (/etc/systemd/system/vba32update.service; disabled;
>> vendor preset: disabled)
>>   Active: activating (start) since Чтв 2017-07-06 15:32:35 EEST;
>> 35min ago
>> Main PID: 6214 (vbaupdx)
>>Tasks: 1 (limit: 512)
>>   CGroup: /system.slice/vba32update.service
>>   └─6214 ./vbaupdx http://anti-virus.by/beta/update
>>
>> Июл 06 15:32:35 linux-mk500 systemd[1]: Starting VBA32 Anti-Virus Update
>> Service...
>> Июл 06 15:32:35 linux-mk500 vbacl[6214]: Vba32 console scanner update
>> process started
>> Июл 06 15:32:35 linux-mk500 vbacl[6214]: Reading configuration options
>> from ./vbacl.ini
>> Июл 06 15:32:35 linux-mk500 vbacl[6214]: Using direct connection for
>> update
>> k_mikhail@linux-mk500:~>
>> ==
>>
>>
>> Simultaneously:
>> [2]
>> ==
>> k_mikhail@linux-mk500:~> systemctl list-units -t timer
>> UNIT LOAD   ACTIVE SUB DESCRIPTION
>> vba32update.timerloaded active running Runs VBA32 Update
>> Hourly
>> ==
>>
>> And that is normal. But 35 minutes for activating service is too long,
>> as for me.
>
> Is this a Type=oneshot service?
>
> It's a bit weird, but Type=oneshot services are not considered to be
> fully started until the ExecStart= command has exited. Until that time
> they're still "activating".
>
> You may be better off making the service Type=simple instead. A
> Type=simple service is fully started as soon as it has spawned the
> ExecStart= command.

Yes, Type=oneshot, because, if Type=simple, service will be active
permanently in case of its start. But this is not what is needed here --
service should be started, then to check the updates of anti-virus
software and then be successfully closed. Nothing more. Only one thing
can impact here -- remote anti-virus server connection timeout. And if
server connection timeout is set in wrong way, having a native systemd
forced timeout for oneshot-services may be useful.


>
>
>> And, by default, there is no way for user\admin to get message, that
>> there is a problem with activating of some service, except periodical
>> 'systemctl list-units -t timer' command output (in current described
>> case). And systemd logs contain no interesting info, which can be useful
>> to investigate the problem and its reasons, because there are no
>> explicit error-messages for such case.
>>
>> So, my questions are:
>> =
>> 1) What is the correct systemd's behavior in such case?
>
> If this is a Type=oneshot service, systemd is working as intended here.

Ok, got that.


>
>> 2) What is systemd's timeout by default for service activation
>> (timer-activated, socket-activated)? If it is documentened, please, give
>> me a hint.
>
> By default, Type=oneshot services don't have a start timeout.

>> 3) If systemd's timeout from 2) is present, how can it be managed by
>> user\admin? E.g. after 10 minutes of 'Activating (start)', service gets
>> FAILED state with putting this info to systemd log, of course (something
>> like "systemd[1] fails to start foobar.service[PID] by timeout.
>> ExitCode:").
>
> If you do add a TimeoutStartSec= to a Type=oneshot unit, this will
> force the unit to be stopped (by killing the process) after that time.
> That's probably not what you want.

In general way -- why not? For more twisted cases I can use OnFailure=
directive here, I suppose. So, will try to play with TimeoutStartSec=
directive.

>
> For a Type=simple service, the default TimeoutStartSec= is set in
> /etc/systemd/system.conf. It will be 90 seconds unless you've changed it.


Ok, thanks for clarifying and help!

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


Re: [systemd-devel] Timeout for 'Activating (start)' status

2017-07-06 Thread Michael Chapman

On Thu, 6 Jul 2017, Mikhail Kasimov wrote:

Hello!

've got an interesting trouble on timer-activated service -- 'systemctl
status' returns a log with 'Activating (start)' status:

[1]
==
k_mikhail@linux-mk500:~> systemctl status vba32update.service
● vba32update.service - VBA32 Anti-Virus Update Service
  Loaded: loaded (/etc/systemd/system/vba32update.service; disabled;
vendor preset: disabled)
  Active: activating (start) since Чтв 2017-07-06 15:32:35 EEST; 35min ago
Main PID: 6214 (vbaupdx)
   Tasks: 1 (limit: 512)
  CGroup: /system.slice/vba32update.service
  └─6214 ./vbaupdx http://anti-virus.by/beta/update

Июл 06 15:32:35 linux-mk500 systemd[1]: Starting VBA32 Anti-Virus Update
Service...
Июл 06 15:32:35 linux-mk500 vbacl[6214]: Vba32 console scanner update
process started
Июл 06 15:32:35 linux-mk500 vbacl[6214]: Reading configuration options
from ./vbacl.ini
Июл 06 15:32:35 linux-mk500 vbacl[6214]: Using direct connection for update
k_mikhail@linux-mk500:~>
==


Simultaneously:
[2]
==
k_mikhail@linux-mk500:~> systemctl list-units -t timer
UNIT LOAD   ACTIVE SUB DESCRIPTION
vba32update.timerloaded active running Runs VBA32 Update Hourly
==

And that is normal. But 35 minutes for activating service is too long,
as for me.


Is this a Type=oneshot service?

It's a bit weird, but Type=oneshot services are not considered to be fully 
started until the ExecStart= command has exited. Until that time they're 
still "activating".


You may be better off making the service Type=simple instead. A 
Type=simple service is fully started as soon as it has spawned the 
ExecStart= command.



And, by default, there is no way for user\admin to get message, that
there is a problem with activating of some service, except periodical
'systemctl list-units -t timer' command output (in current described
case). And systemd logs contain no interesting info, which can be useful
to investigate the problem and its reasons, because there are no
explicit error-messages for such case.

So, my questions are:
=
1) What is the correct systemd's behavior in such case?


If this is a Type=oneshot service, systemd is working as intended here.


2) What is systemd's timeout by default for service activation
(timer-activated, socket-activated)? If it is documentened, please, give
me a hint.


By default, Type=oneshot services don't have a start timeout.


3) If systemd's timeout from 2) is present, how can it be managed by
user\admin? E.g. after 10 minutes of 'Activating (start)', service gets
FAILED state with putting this info to systemd log, of course (something
like "systemd[1] fails to start foobar.service[PID] by timeout.
ExitCode:").


If you do add a TimeoutStartSec= to a Type=oneshot unit, this will force 
the unit to be stopped (by killing the process) after that time. That's 
probably not what you want.


For a Type=simple service, the default TimeoutStartSec= is set in 
/etc/systemd/system.conf. It will be 90 seconds unless you've changed it.___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Timeout for 'Activating (start)' status

2017-07-06 Thread Mikhail Kasimov
Hello!

've got an interesting trouble on timer-activated service -- 'systemctl
status' returns a log with 'Activating (start)' status:

[1]
==
k_mikhail@linux-mk500:~> systemctl status vba32update.service
● vba32update.service - VBA32 Anti-Virus Update Service
   Loaded: loaded (/etc/systemd/system/vba32update.service; disabled;
vendor preset: disabled)
   Active: activating (start) since Чтв 2017-07-06 15:32:35 EEST; 35min ago
 Main PID: 6214 (vbaupdx)
Tasks: 1 (limit: 512)
   CGroup: /system.slice/vba32update.service
   └─6214 ./vbaupdx http://anti-virus.by/beta/update

Июл 06 15:32:35 linux-mk500 systemd[1]: Starting VBA32 Anti-Virus Update
Service...
Июл 06 15:32:35 linux-mk500 vbacl[6214]: Vba32 console scanner update
process started
Июл 06 15:32:35 linux-mk500 vbacl[6214]: Reading configuration options
from ./vbacl.ini
Июл 06 15:32:35 linux-mk500 vbacl[6214]: Using direct connection for update
k_mikhail@linux-mk500:~>
==


Simultaneously:
[2]
==
k_mikhail@linux-mk500:~> systemctl list-units -t timer
UNIT LOAD   ACTIVE SUB DESCRIPTION
vba32update.timerloaded active running Runs VBA32 Update Hourly
==

And that is normal. But 35 minutes for activating service is too long,
as for me.

And, by default, there is no way for user\admin to get message, that
there is a problem with activating of some service, except periodical
'systemctl list-units -t timer' command output (in current described
case). And systemd logs contain no interesting info, which can be useful
to investigate the problem and its reasons, because there are no
explicit error-messages for such case.

So, my questions are:
=
1) What is the correct systemd's behavior in such case?
2) What is systemd's timeout by default for service activation
(timer-activated, socket-activated)? If it is documentened, please, give
me a hint.
3) If systemd's timeout from 2) is present, how can it be managed by
user\admin? E.g. after 10 minutes of 'Activating (start)', service gets
FAILED state with putting this info to systemd log, of course (something
like "systemd[1] fails to start foobar.service[PID] by timeout.
ExitCode:").

Thanks for your assistance!

OS: openSUSE 42.2, systemd v.228.

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