Re: [systemd-devel] systemd-run and waiting for initialization

2015-04-01 Thread Lennart Poettering
On Mon, 30.03.15 09:48, Igor Bukanov (i...@mir2.org) wrote:

> As I understand, the systemd-run utility returns immediately even with
> --service-type=forking. What is the proper way then to wait using a shell
> until the main service process forks the child and exists signaling
> initialization?

THis is currently not supported, but it certainly would make sense to
support this. Added to the TODO list.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-run and waiting for initialization

2015-03-30 Thread Igor Bukanov
It would be really nice to have an utility that waits until a unit is
transitioned from the activating state. My problem is that I wanted to
replace in a shell script a sequence like:

sudo -u some_user ssh -f port_forwarding host
use_forwarded_ports
kill hopefully rightly guessed ssh PID

with something like

sudo systemd-run --uid user --service-type=forking ...  ssh -f
port_forwarding host
use_forwarded_ports
sudo systemctl stop unit_name

as that is easier to make reliable. However, this does not work as I
expected as systemd-run does not wait for the ssh -f unit to transition
from the activating state indicating that port forwarding is established.
So I need to implement own wait or polling.


On 31 March 2015 at 05:51, Andrei Borzenkov  wrote:

> В Mon, 30 Mar 2015 09:48:25 +0200
> Igor Bukanov  пишет:
>
> > As I understand, the systemd-run utility returns immediately even with
> > --service-type=forking. What is the proper way then to wait using a shell
> > until the main service process forks the child and exists signaling
> > initialization?
>
> It is not limited to forking. systemd-run simply queues request to
> start unit, same as systemctl does. It would need to actually wait
> until systemd reports that unit is started.
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-run and waiting for initialization

2015-03-30 Thread Andrei Borzenkov
В Mon, 30 Mar 2015 09:48:25 +0200
Igor Bukanov  пишет:

> As I understand, the systemd-run utility returns immediately even with
> --service-type=forking. What is the proper way then to wait using a shell
> until the main service process forks the child and exists signaling
> initialization?

It is not limited to forking. systemd-run simply queues request to
start unit, same as systemctl does. It would need to actually wait
until systemd reports that unit is started.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] systemd-run and waiting for initialization

2015-03-30 Thread Igor Bukanov
As I understand, the systemd-run utility returns immediately even with
--service-type=forking. What is the proper way then to wait using a shell
until the main service process forks the child and exists signaling
initialization?
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel