Re: [systemd-devel] delayed reply to sd-bus method invocation

2017-06-29 Thread Jason Litzinger
> machined has easier-to-follow uses of this, as it does some operations
> that might take a bit longer, such as cloning or removing images.
Thanks!

Since I'll be going through this to come up with something for my
own use case, it wouldn't be much to write up a self-contained example.
Is there an examples repo/folder/etc where this kind of thing would fit?

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


Re: [systemd-devel] [PATCH] firmware: wake all waiters

2017-06-29 Thread Daniel Wagner

On 06/28/2017 06:06 PM, Luis R. Rodriguez wrote:

On Wed, Jun 28, 2017 at 12:06 AM, Lennart Poettering
 wrote:

On Wed, 28.06.17 00:24, Luis R. Rodriguez (mcg...@kernel.org) wrote:

I think it was first packaged into systemd, and then it was split out to
help those who want it external.


Certainly not. I'd sure know about that. ;-)


Sorry I may have confused 'intended to be at first'. Tom and Daniel
can elaborate.


Tom helped out building the daemon as standalone project. There is no 
real reason that it needs to be part of the systemd code base.


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


Re: [systemd-devel] 回复: 回复: [systemd-de vel] systemctl can't execute stop actually,whenservice is started by other way

2017-06-29 Thread Reindl Harald



Am 29.06.2017 um 11:51 schrieb Oliver Neukum:

Am Donnerstag, den 29.06.2017, 11:45 +0200 schrieb Reindl Harald:


Am 29.06.2017 um 10:05 schrieb Oliver Neukum:


Am Mittwoch, den 28.06.2017, 13:29 +0200 schrieb Lennart Poettering:


Well, it's a service manager. As such it keeps track of services,
knows when they are started and when they aren't. Why would it stop
services that aren't started?


Because you command it to do so.
The check systemd does adds no value. There is a reason to not start
something that is running. The reverse does not apply


this is nonsense - how in the world should systemmd know what to stop
when it has no clue about the involved processes because it did not
start the service and hence has no tracking at all



So try and fail. That is still no excuse for ruling out that you can
stop a service you have not started. That is pure politics.


*try WHAT* - kill random processes?

simple example after that you hopefully understand why this is nonsense

* i have two servcies on several machines
* each of the has "mysqld" as ExecStart using different configs
* "mysqld.service" and "replication.service"

so what do you do when "replication.service" is not started and you say 
"systemctl stop replicatiuon.service" - kill my other mysqld?


ps aux | grep openvpn | wc -l
7

what do you do when you issue "systemctl stop openvpn1.service" and it 
is not running? kill my other 6 instanes, kill only one of them and if 
yes which one


a service manager is not a gambling machine

* if you start a process by hand kill it by hand
* if you start a process as service kill it with systemcl

it's really that easy

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


Re: [systemd-devel] 回复: 回复: [systemd-de vel] systemctl can't execute stop actually,whenservice is started by other way

2017-06-29 Thread Tomasz Torcz
On Thu, Jun 29, 2017 at 11:51:53AM +0200, Oliver Neukum wrote:
> Am Donnerstag, den 29.06.2017, 11:45 +0200 schrieb Reindl Harald:
> > 
> > Am 29.06.2017 um 10:05 schrieb Oliver Neukum:
> > > 
> > > Am Mittwoch, den 28.06.2017, 13:29 +0200 schrieb Lennart Poettering:
> > > > 
> > > > Well, it's a service manager. As such it keeps track of services,
> > > > knows when they are started and when they aren't. Why would it stop
> > > > services that aren't started?
> > > 
> > > Because you command it to do so.
> > > The check systemd does adds no value. There is a reason to not start
> > > something that is running. The reverse does not apply
> > 
> > this is nonsense - how in the world should systemmd know what to stop 
> > when it has no clue about the involved processes because it did not 
> > start the service and hence has no tracking at all
> > 
> 
> So try and fail. That is still no excuse for ruling out that you can
> stop a service you have not started. That is pure politics.

  There's no service if it wasn't started by systemd. It's just a random 
binary. 



-- 
Tomasz Torcz Morality must always be based on practicality.
xmpp: zdzich...@chrome.pl-- Baron Vladimir Harkonnen

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


Re: [systemd-devel] 回复: 回复: [systemd-de vel] systemctl can't execute stop actually,whenservice is started by other way

2017-06-29 Thread Reindl Harald



Am 29.06.2017 um 10:05 schrieb Oliver Neukum:

Am Mittwoch, den 28.06.2017, 13:29 +0200 schrieb Lennart Poettering:

Well, it's a service manager. As such it keeps track of services,
knows when they are started and when they aren't. Why would it stop
services that aren't started?


Because you command it to do so.
The check systemd does adds no value. There is a reason to not start
something that is running. The reverse does not apply


this is nonsense - how in the world should systemmd know what to stop 
when it has no clue about the involved processes because it did not 
start the service and hence has no tracking at all

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


Re: [systemd-devel] 回复: 回复: [systemd-de vel] systemctl can't execute stop actually,whenservice is started by other way

2017-06-29 Thread Oliver Neukum
Am Donnerstag, den 29.06.2017, 11:45 +0200 schrieb Reindl Harald:
> 
> Am 29.06.2017 um 10:05 schrieb Oliver Neukum:
> > 
> > Am Mittwoch, den 28.06.2017, 13:29 +0200 schrieb Lennart Poettering:
> > > 
> > > Well, it's a service manager. As such it keeps track of services,
> > > knows when they are started and when they aren't. Why would it stop
> > > services that aren't started?
> > 
> > Because you command it to do so.
> > The check systemd does adds no value. There is a reason to not start
> > something that is running. The reverse does not apply
> 
> this is nonsense - how in the world should systemmd know what to stop 
> when it has no clue about the involved processes because it did not 
> start the service and hence has no tracking at all
> 

So try and fail. That is still no excuse for ruling out that you can
stop a service you have not started. That is pure politics.

Regards
Oliver

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


Re: [systemd-devel] delayed reply to sd-bus method invocation

2017-06-29 Thread Lennart Poettering
On Wed, 28.06.17 20:52, Jason Litzinger (jlitzinger...@gmail.com) wrote:

> I have a daemon using the sd-bus API with a use case that I suspect
> is supported, but wanted to see if there was an example anywhere (I've
> been looking, haven't found one yet).
> 
> Is there a case in the systemd codebase (or something else) where a
> method is invoked but its handler doesn't immediately reply?
> 
> What I'm trying to achieve is:
> 
> * method called
> * Handler triggers some IO
> 
> * Important event occurs
> * Reply message sent to the caller
> 
> I'm assuming this is possible/implemented, if not that would also be
> good to know :).

PID 1 does this when a Reload() operation is issued as it will then
seriliaze its state, flush the configuration out, load the new
configuration and read the state back in. But following the codepaths
for this isn#t trivial.

machined has easier-to-follow uses of this, as it does some operations
that might take a bit longer, such as cloning or removing images.

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] 回复: 回复: [systemd-de vel] systemctl can't execute stop actually,whenservice is started by other way

2017-06-29 Thread Lennart Poettering
On Thu, 29.06.17 10:05, Oliver Neukum (oneu...@suse.com) wrote:

> Am Mittwoch, den 28.06.2017, 13:29 +0200 schrieb Lennart Poettering:
> > Well, it's a service manager. As such it keeps track of services,
> > knows when they are started and when they aren't. Why would it stop
> > services that aren't started?
> 
> Because you command it to do so.

Because things are technically designed that way. When systemd manages
services it does so ensuring it will get SIGCHLD events for them. it
will also run them in a cgroup, so that it can monitor its lifetime by
enumerating the cgroup's contents, and getting events from it.

Now, if you start stuff outside of systemd nothing of that is
available, so systemd wouldn#t know that is running, and it
couldn't properly stop anything because it can't get ahold of the
processes to terminate.

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] 回复: 回复: [systemd-de vel] systemctl can't execute stop actually,whenservice is started by other way

2017-06-29 Thread Tomasz Torcz
On Thu, Jun 29, 2017 at 10:05:08AM +0200, Oliver Neukum wrote:
> Am Mittwoch, den 28.06.2017, 13:29 +0200 schrieb Lennart Poettering:
> > Well, it's a service manager. As such it keeps track of services,
> > knows when they are started and when they aren't. Why would it stop
> > services that aren't started?
> 
> Because you command it to do so.
> The check systemd does adds no value. There is a reason to not start
> something that is running. The reverse does not apply.

  By starting nscd in some shell session, there's no mapping between
running executable and a service.  Systemd has no way of knowing
that random nscd binary is supposed to be killed when 'systemctl stop nscd'
is invoked. How would it know?

  That is really the question! How systemd would know that unrelated
binary should be killed when user invokes 'systemctl stop' on service,
service which has not been started?  Is systemd supposed to compare full
path of all running binaries to ExecStart= lines in unit files? But what
about situation when you have multiple services with the same ExecStart=?

  Maybe user starting random binaries in login session should echo their
PIDs into 'tasks' file in relevant cgroup? What if the cgroup does not exists
yet (because service wasn't started)? This quickly becames a dangerous hackery.

  I'm all ears – what's your solution?

-- 
Tomasz Torcz Morality must always be based on practicality.
xmpp: zdzich...@chrome.pl-- Baron Vladimir Harkonnen

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


Re: [systemd-devel] 回复: 回复: [systemd-de vel] systemctl can't execute stop actually,whenservice is started by other way

2017-06-29 Thread Oliver Neukum
Am Mittwoch, den 28.06.2017, 13:29 +0200 schrieb Lennart Poettering:
> Well, it's a service manager. As such it keeps track of services,
> knows when they are started and when they aren't. Why would it stop
> services that aren't started?

Because you command it to do so.
The check systemd does adds no value. There is a reason to not start
something that is running. The reverse does not apply.

Regards
Oliver

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