Re: [systemd-devel] Erlang bindings for systemd-notify API

2016-06-24 Thread Peter Lemenkov
Hello All!

2016-06-24 17:28 GMT+02:00 Lennart Poettering :
> On Thu, 23.06.16 16:12, Peter Lemenkov (lemen...@gmail.com) wrote:
>
>> Sorry for resurrecting of an old thread, but I really hope to finish
>> this task :)
>> What should I do for moving this library under systemd umbrella?
>> What's the next step?
>
> I copied your repo now into the systemd umbrella, made the "erlang"
> group we already have admin of it, and added you to it.

Cool, thanks!

> I hope this is all that's needed?

Yes, I think so.


-- 
With best regards, Peter Lemenkov.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] x bits set on /run/systemd/private, any particular reason?

2016-06-24 Thread Lennart Poettering
On Fri, 24.06.16 11:24, Hoyer, Marko (ADITG/SW2) (mho...@de.adit-jv.com) wrote:

> Hi,
> 
> I'm not an expert on Linux access right management but I'm wondering
> why systemd's private socket (/run/systemd/private) has the x bits
> set. Did it happen accidently?

We don't do that explicitly. That's simply what the kernel does if you
invoke bind(). Compare:


$ socat UNIX-LISTEN:/tmp/fff -
^Z
[1]+  Stopped socat UNIX-LISTEN:/tmp/fff -
$ stat /tmp/fff
  File: '/tmp/fff'
  Size: 0 Blocks: 0  IO Block: 4096   socket
Device: 2bh/43d Inode: 3604282 Links: 1
Access: (0775/srwxrwxr-x)  Uid: ( 1000/ lennart)   Gid: ( 1000/ lennart)
Context: unconfined_u:object_r:user_tmp_t:s0
Access: 2016-06-24 20:28:56.692037876 +0200
Modify: 2016-06-24 20:28:56.692037876 +0200
Change: 2016-06-24 20:28:56.692037876 +0200
 Birth: -
$ fg
socat UNIX-LISTEN:/tmp/fff -
^C


And this doesn't matter much as the x bit has no real effect on
AF_UNIX sockets. (much like i has no effect on fifos or symlinks).

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] x bits set on /run/systemd/private, any particular reason?

2016-06-24 Thread Mantas Mikulėnas
On Fri, Jun 24, 2016 at 2:24 PM, Hoyer, Marko (ADITG/SW2) <
mho...@de.adit-jv.com> wrote:

> Hi,
>
>
>
> I’m not an expert on Linux access right management but I’m wondering why
> systemd’s private socket (/run/systemd/private) has the x bits set. Did it
> happen accidently?
>

Immediately after bind(), the socket will have all permissions that weren't
masked out by the current umask – there doesn't seem to be an equivalent to
the mode parameter of open().

The default umask for init is 0; it seems that while systemd does set a
more restrictive umask when necessary, it doesn't bother doing so when
setting up the private socket, so it ends up having 0777 permissions by
default...

Either way, +x has no meaning on sockets (only +w matters). Checking `find
/run -type s -ls`, it seems services aren't very consistent whether to keep
or remove it for their own sockets...

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


Re: [systemd-devel] Erlang bindings for systemd-notify API

2016-06-24 Thread Lennart Poettering
On Thu, 23.06.16 16:12, Peter Lemenkov (lemen...@gmail.com) wrote:

> Sorry for resurrecting of an old thread, but I really hope to finish
> this task :)
> What should I do for moving this library under systemd umbrella?
> What's the next step?

I copied your repo now into the systemd umbrella, made the "erlang"
group we already have admin of it, and added you to it.

I hope this is all that's needed?

Thanks for contributing this!

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] how to use per-user systemd --user services / how to replace /etc/xdg/autostart/app.desktop?

2016-06-24 Thread Martin Pitt
Mantas Mikulėnas [2016-06-16 16:03 +0300]:
> So I would create a separate graphical.target and manually `systemctl
> start` it via .xprofile or such. (Don't forget, also, that graphical
> programs usually need $DISPLAY, and this is only imported to the --user
> manager /after/ default.target has already started.)

That's in fact my current schema too. We want to convert the Ubuntu
user session from (session) upstart to (per-user) systemd units, and
my current prototype [1] defines a "graphical.slice", the actual
services hook into that (or perhaps into a subslice like
graphical-xfce.slice), and the whole Xsession gets wrapped into
starting/stopping the per-session-type slice [2].

It's still a prototype (work on this is postponed until end of July on
a sprint), but so far this works reasonably well.

Martin

[1] https://git.launchpad.net/~pitti/+git/systemd-graphical-session/tree/
[2] 
https://git.launchpad.net/~pitti/+git/systemd-graphical-session/tree/usr/share/systemd-graphical-session/session-wrapper
-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] x bits set on /run/systemd/private, any particular reason?

2016-06-24 Thread Hoyer, Marko (ADITG/SW2)
Hi,

I'm not an expert on Linux access right management but I'm wondering why 
systemd's private socket (/run/systemd/private) has the x bits set. Did it 
happen accidently?

Can someone explain?

Best regards

Marko Hoyer
Advanced Driver Information Technology GmbH
Software Group II (ADITG/SW2)
Robert-Bosch-Str. 200
31139 Hildesheim
Germany
Tel. +49 5121 49 6948
Fax +49 5121 49 6999
mho...@de.adit-jv.com
ADIT is a joint venture company of Robert Bosch GmbH/Robert Bosch Car 
Multimedia GmbH and DENSO Corporation
Sitz: Hildesheim, Registergericht: Amtsgericht Hildesheim HRB 3438
Geschäftsführung: Wilhelm Grabow, Ken Yaguchi
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] does "Before=network.target" really work

2016-06-24 Thread Andrei Borzenkov
On Fri, Jun 24, 2016 at 1:41 PM, Xin Long  wrote:
> On Fri, Jun 24, 2016 at 6:23 PM, Andrei Borzenkov  wrote:
>> On Fri, Jun 24, 2016 at 1:11 PM, Xin Long  wrote:
>>> Hi,
>>>
>>> I have a service, and want it to be stopped only after network is
>>> stopped when system shutdown.
>>>
>>> I checked "man systemd.special ", network is a special internal
>>> service for systemd, , and I found "network.target":
>>> "at shutdown, a unit that is ordered after network.target will be
>>> stopped before the network -- to whatever  level it might be set up
>>> then -- is shut down".
>>> That means "After=network.target" can work well.
>>>
>>> But my situation is opposite to that, I need "a unit that is ordered
>>> before network.target will be stopped *after* the network so
>>> shutdown".
>>>
>>> So I added "Before=network.target" to .service file. can it really
>>> work as I expect?
>>>
>>
>> No. That is why systemd was forced to introduce additional
>> network-pre.target to make it possible to explicitly order things
>> before networking is started (or stop after networking has been
>> stopped - assuming of course that all services that implement
>> networking correct order themselves After network-pre.target).
>
> So you mean "Before=network-pre.target" can work on my case, right ?
>

Yes.

>>> I have a service, and want it to be stopped only after network is
>>> stopped when system shutdown
>
> and since which version "network-pre.target" was introduced ?
> cause I didn't find it in "man systemd.special" in my system.

No idea. It is commit a4a878d04045b46fa9783664e3643a890b356790.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] does "Before=network.target" really work

2016-06-24 Thread Xin Long
On Fri, Jun 24, 2016 at 6:22 PM, Michael Hirmke  wrote:
> Hi Xin,
>
>>Hi,
>
>>I have a service, and want it to be stopped only after network is
>>stopped when system shutdown.
>
>>I checked "man systemd.special ", network is a special internal
>>service for systemd, , and I found "network.target":
>>"at shutdown, a unit that is ordered after network.target will be
>>stopped before the network -- to whatever  level it might be set up
>>then -- is shut down".
>>That means "After=network.target" can work well.
>
>>But my situation is opposite to that, I need "a unit that is ordered
>>before network.target will be stopped *after* the network so
>>shutdown".
>
>>So I added "Before=network.target" to .service file. can it really
>>work as I expect?
>
> it depends on what you're trying to do with this information.
> AFAIK network.target is related to the network stack as such. It does
> not apply to a certain interface is up, down, activated or deactivated.
> If you need the information for the network stack being up or down,
> the use of network.target is ok - and works for me.
>
my case only cares about shutdown time.
I do not know "Before=network.target" can make my service stop
after which phase of network is stopped.
and I also cannot find anything in man doc.

but I can find some services are truly using it now:
$ grep "Before=network.target" . -R
./wpa_supplicant.service:Before=network.target
./NetworkManager.service:Before=network.target
./NetworkManager-wait-online.service:Before=network.target network-online.target
./arp-ethers.service:Before=network.target
./firewalld.service:Before=network.target

what I need is just make sure my service will stop after we just can't
communicate with other host. (no need to after device down, or stack
is removed)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] does "Before=network.target" really work

2016-06-24 Thread Xin Long
On Fri, Jun 24, 2016 at 6:23 PM, Andrei Borzenkov  wrote:
> On Fri, Jun 24, 2016 at 1:11 PM, Xin Long  wrote:
>> Hi,
>>
>> I have a service, and want it to be stopped only after network is
>> stopped when system shutdown.
>>
>> I checked "man systemd.special ", network is a special internal
>> service for systemd, , and I found "network.target":
>> "at shutdown, a unit that is ordered after network.target will be
>> stopped before the network -- to whatever  level it might be set up
>> then -- is shut down".
>> That means "After=network.target" can work well.
>>
>> But my situation is opposite to that, I need "a unit that is ordered
>> before network.target will be stopped *after* the network so
>> shutdown".
>>
>> So I added "Before=network.target" to .service file. can it really
>> work as I expect?
>>
>
> No. That is why systemd was forced to introduce additional
> network-pre.target to make it possible to explicitly order things
> before networking is started (or stop after networking has been
> stopped - assuming of course that all services that implement
> networking correct order themselves After network-pre.target).

So you mean "Before=network-pre.target" can work on my case, right ?

>> I have a service, and want it to be stopped only after network is
>> stopped when system shutdown

and since which version "network-pre.target" was introduced ?
cause I didn't find it in "man systemd.special" in my system.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] does "Before=network.target" really work

2016-06-24 Thread Andrei Borzenkov
On Fri, Jun 24, 2016 at 1:11 PM, Xin Long  wrote:
> Hi,
>
> I have a service, and want it to be stopped only after network is
> stopped when system shutdown.
>
> I checked "man systemd.special ", network is a special internal
> service for systemd, , and I found "network.target":
> "at shutdown, a unit that is ordered after network.target will be
> stopped before the network -- to whatever  level it might be set up
> then -- is shut down".
> That means "After=network.target" can work well.
>
> But my situation is opposite to that, I need "a unit that is ordered
> before network.target will be stopped *after* the network so
> shutdown".
>
> So I added "Before=network.target" to .service file. can it really
> work as I expect?
>

No. That is why systemd was forced to introduce additional
network-pre.target to make it possible to explicitly order things
before networking is started (or stop after networking has been
stopped - assuming of course that all services that implement
networking correct order themselves After network-pre.target).
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] does "Before=network.target" really work

2016-06-24 Thread Michael Hirmke
Hi Xin,

>Hi,

>I have a service, and want it to be stopped only after network is
>stopped when system shutdown.

>I checked "man systemd.special ", network is a special internal
>service for systemd, , and I found "network.target":
>"at shutdown, a unit that is ordered after network.target will be
>stopped before the network -- to whatever  level it might be set up
>then -- is shut down".
>That means "After=network.target" can work well.

>But my situation is opposite to that, I need "a unit that is ordered
>before network.target will be stopped *after* the network so
>shutdown".

>So I added "Before=network.target" to .service file. can it really
>work as I expect?

it depends on what you're trying to do with this information.
AFAIK network.target is related to the network stack as such. It does
not apply to a certain interface is up, down, activated or deactivated.
If you need the information for the network stack being up or down,
the use of network.target is ok - and works for me.

>Thanks

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


[systemd-devel] does "Before=network.target" really work

2016-06-24 Thread Xin Long
Hi,

I have a service, and want it to be stopped only after network is
stopped when system shutdown.

I checked "man systemd.special ", network is a special internal
service for systemd, , and I found "network.target":
"at shutdown, a unit that is ordered after network.target will be
stopped before the network -- to whatever  level it might be set up
then -- is shut down".
That means "After=network.target" can work well.

But my situation is opposite to that, I need "a unit that is ordered
before network.target will be stopped *after* the network so
shutdown".

So I added "Before=network.target" to .service file. can it really
work as I expect?

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