Re: [systemd-devel] [PATCH] rules: add by-parttypeuuid rule for GPT labeled partitions

2014-05-13 Thread Karel Zak
On Mon, May 12, 2014 at 05:18:56PM +0200, Kay Sievers wrote:
> > I just looked up libudev and it looks like there is even a pyudev wrapper,
> > so that could indeed work better.  I take it that queries via
> > udev_enumerate for (say) ID_PART_ENTRY_TYPE=x are efficient?
> 
> Sure, filter for "block" devices and this or other GPT properties. The
> libudev API will just find the devices is /sys and read the database
> files in tmpfs /run and, it will not talk to any devices, so it should
> perform pretty well.

 and on command line lsblk(8) reads the info from udev db, so you can
 use:

 $ lsblk -o+PARTTYPE
 NAME   MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT PARTTYPE
 sda  8:00 149.1G  0 disk
 ├─sda1   8:10  1000M  0 part  /boot  
c12a7328-f81f-11d2-ba4b-00a0c93ec93b
 ├─sda2   8:20 2G  0 part 
ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
 ├─sda3   8:30   9.7G  0 part  [SWAP] 
0657fd6d-a4ab-43c4-84e5-0933c84b4f4f
 ├─sda4   8:40  34.2G  0 part  /  
ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
 ├─sda5   8:50  63.2G  0 part  /home  
ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
 └─sda6   8:60  39.1G  0 part 
ebd0a0a2-b9e5-4433-87c0-68b6b72699c7


(well, this is from git tree, will be in v2.25 :-)

Karel

-- 
 Karel Zak  
 http://karelzak.blogspot.com
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] how can I add a boot parameter to a app which depend on kernel boot option

2014-05-13 Thread zhang xiong
Hi, All:
 I face a problem when I'm using systemd. It's appreciate that someone
can give me some suggestion.
 I want to boot an app from systemd and this app's boot parameter is
gotten from /proc/cmdline.
 the boot logic of my app is:

 if boot_option = a
ExecStart=myapp --parameter=value1
 else if boot_option = b
ExecStart=myapp --parameter=value2

  how can I implement this logic in myapp.service ?

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


[systemd-devel] systemd headers missing and compiling failed

2014-05-13 Thread winew...@qq.com
hi all,

i tried to compile some source code on archlinux (v 2014.05.01), but i got an 
error: (header missing ?)
fatal error: systemd/sd-event.h: No such file or directory 
#include  
^ 
compilation terminated. 

then i downloaded & unpacked systemd-212.tar.gz, 
and copy the headers in systemd-212/src/systemd/
to archlinux:/usr/include/systemd/  and "make" again,
but i got more errors, such as: (implementation missing ?)
undefined reference to `sd_event_source_unref'

so i tried to compile the newest systemd myself, 
but i suffered errors again!
[root@zarch systemd-212]# make 
make --no-print-directory all-recursive 
Making all in . 
CCLD libgudev-1.0.la 
/usr/bin/ld.gold: error: .libs/libgudev-1.0.ver:2:1: syntax error, 
unexpected LOCAL, expecting STRING or QUOTED_STRING or EXTERN 
/usr/bin/ld.gold: fatal error: unable to parse version script file 
.libs/libgudev-1.0.ver 
collect2: error: ld returned 1 exit status 
Makefile:7671: recipe for target 'libgudev-1.0.la' failed 
make[2]: *** [libgudev-1.0.la] Error 1 
Makefile:14502: recipe for target 'all-recursive' failed 
make[1]: *** [all-recursive] Error 1 
Makefile:7445: recipe for target 'all' failed 
make: *** [all] Error 2 

by the way, there is no guide for newbie in README or website,
so i just do it as "tradition" -- step1 "./configure" and step2 "make"  (error 
occurred in step2.)

can anybody help ?

thanks!
Hurry Zeng @ China



winew...@qq.com
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] timed out waiting for device dev-disk-by\x2duuid

2014-05-13 Thread poma
On 13.05.2014 04:48, Chris Murphy wrote:
...
> The problem seems to be that systemd (udev?) is not finding the volume by 
> uuid for some reason, and therefore not attempting to mount it. But I don't 
> know why it can't find it, or even how the find by uuid mechanism works this 
> early in boot. So I'm not sure if this is a systemd or udev bug, or a dracut, 
> or kernel bug.
> 
> The problem happens with systemd 208-9.fc20 with kernel 3.11.10-301.fc20, and 
> systemd 212-4.fc21 and kernel 3.15.0-0.rc5.git0.1.fc21.
...

[  ***] A start job is running for device dev-disk-by\x2duuid-...
loop loop loop ...
where's my cup of hot water with a bit of milk ...
afterwards a drop to the dracut hell.
Bare metal, no butter-tree.

I've encountered on this also, however afterward with 
kernel-3.15.0-0.rc5.git1.1.fc21.x86_64 & 
systemd-212-9.git9ae7021.20140512.fc21.x86_64 no more. :)


poma

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


Re: [systemd-devel] how can I add a boot parameter to a app which depend on kernel boot option

2014-05-13 Thread Umut Tezduyar Lindskog
Hi Xiong

You can have a script that reads the  /proc/cmdline and then calls
exec with your app.

ExecStart=/your/custom/scipt

cat /your/custom/script:

# Do what ever you want, figure out parameters

# Start your application
exec myapp --parameter=xyz

Umut

On Tue, May 13, 2014 at 12:48 PM, zhang xiong  wrote:
> Hi, All:
>  I face a problem when I'm using systemd. It's appreciate that someone
> can give me some suggestion.
>  I want to boot an app from systemd and this app's boot parameter is
> gotten from /proc/cmdline.
>  the boot logic of my app is:
>
>  if boot_option = a
> ExecStart=myapp --parameter=value1
>  else if boot_option = b
> ExecStart=myapp --parameter=value2
>
>   how can I implement this logic in myapp.service ?
>
> thanks
>
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] readahead: ARM: fix rotational media detection for MMC

2014-05-13 Thread alison_chaiken
From: Alison Chaiken 

The ARM runtime reports the major device type associated with
/proc/self/mountinfo as MMC_BLOCK_MAJOR, causing on_ssd() in
readahead-common.c to return false.   on_ssd() should return true, as
MMC like SSD is not rotational.

Signed-off-by: Alison Chaiken 
---
 src/readahead/readahead-common.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/src/readahead/readahead-common.c b/src/readahead/readahead-common.c
index 49679fc..4d1788a 100644
--- a/src/readahead/readahead-common.c
+++ b/src/readahead/readahead-common.c
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "log.h"
 #include "readahead-common.h"
@@ -72,6 +73,12 @@ int fs_on_ssd(const char *p) {
 if (stat(p, &st) < 0)
 return -errno;
 
+#ifdef __arm__
+if (major(st.st_dev) == MMC_BLOCK_MAJOR) {
+log_info("readahead: MMC is non-rotating.");
+return true;
+}
+#endif
 if (major(st.st_dev) == 0) {
 _cleanup_fclose_ FILE *f = NULL;
 int mount_id;
-- 
1.9.1

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


[systemd-devel] udev too late renaming network interfaces

2014-05-13 Thread Grant
I'm on Gentoo and when the system tries to start my network interfaces
at boot, I get:

Cannot find device "enp0s20u2u1"
 *   ERROR: interface enp0s20u2u1 does not exist
 *   Ensure that you have loaded the correct kernel module for your hardware
 * ERROR: net.enp0s20u2u1 failed to start
 * Bringing up interface enp0s20u2u2
Cannot find device "enp0s20u2u2"
 *   ERROR: interface enp0s20u2u2 does not exist
 *   Ensure that you have loaded the correct kernel module for your hardware
 * ERROR: net.enp0s20u2u2 failed to start

It seems udev is taking too long to rename my USB ethernet interfaces
from eth0 and eth1 to the above names.  Once the system is booted, I
can start the interfaces just fine.  I do like the renaming
functionality so I can plug any USB ethernet adapter into a particular
USB port and it will work without changes so I'd rather not disable
that.  Everything is built into the kernel, I'm not loading any
modules.  I have 5 Dell XPS 13 systems and only one is exhibiting this
problem.

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


Re: [systemd-devel] udev too late renaming network interfaces

2014-05-13 Thread Tom Gundersen
On Tue, May 13, 2014 at 1:52 PM, Grant  wrote:
> I'm on Gentoo and when the system tries to start my network interfaces
> at boot, I get:

What software is managing your network? It needs to listen with
libudev for the network devices to be fully initialized by udev,
otherwise this will happen...

Cheers,

Tom

> Cannot find device "enp0s20u2u1"
>  *   ERROR: interface enp0s20u2u1 does not exist
>  *   Ensure that you have loaded the correct kernel module for your hardware
>  * ERROR: net.enp0s20u2u1 failed to start
>  * Bringing up interface enp0s20u2u2
> Cannot find device "enp0s20u2u2"
>  *   ERROR: interface enp0s20u2u2 does not exist
>  *   Ensure that you have loaded the correct kernel module for your hardware
>  * ERROR: net.enp0s20u2u2 failed to start
>
> It seems udev is taking too long to rename my USB ethernet interfaces
> from eth0 and eth1 to the above names.  Once the system is booted, I
> can start the interfaces just fine.  I do like the renaming
> functionality so I can plug any USB ethernet adapter into a particular
> USB port and it will work without changes so I'd rather not disable
> that.  Everything is built into the kernel, I'm not loading any
> modules.  I have 5 Dell XPS 13 systems and only one is exhibiting this
> problem.
>
> - Grant
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] readahead: ARM: fix rotational media detection for MMC

2014-05-13 Thread Lennart Poettering
On Tue, 13.05.14 13:49, alison_chai...@mentor.com (alison_chai...@mentor.com) 
wrote:

> From: Alison Chaiken 
> 
> The ARM runtime reports the major device type associated with
> /proc/self/mountinfo as MMC_BLOCK_MAJOR, causing on_ssd() in
> readahead-common.c to return false.   on_ssd() should return true, as
> MMC like SSD is not rotational.

Not following here. fs_on_ssd() will actually check for the high-level
ID_SSD property, as well as the "queue/rotational" sysfs attribute for
the block device.

Are you saying that on you machine queue/rotational is set to 1 for
MMCs? If so, this appears to be the more appropriate thing to fix?

Moreover, why is this supposedly ARM specific?

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] udev too late renaming network interfaces

2014-05-13 Thread Lennart Poettering
On Tue, 13.05.14 04:52, Grant (emailgr...@gmail.com) wrote:

> I'm on Gentoo and when the system tries to start my network interfaces
> at boot, I get:
> 
> Cannot find device "enp0s20u2u1"
>  *   ERROR: interface enp0s20u2u1 does not exist
>  *   Ensure that you have loaded the correct kernel module for your hardware
>  * ERROR: net.enp0s20u2u1 failed to start
>  * Bringing up interface enp0s20u2u2
> Cannot find device "enp0s20u2u2"
>  *   ERROR: interface enp0s20u2u2 does not exist
>  *   Ensure that you have loaded the correct kernel module for your hardware
>  * ERROR: net.enp0s20u2u2 failed to start
> 
> It seems udev is taking too long to rename my USB ethernet interfaces
> from eth0 and eth1 to the above names.  Once the system is booted, I
> can start the interfaces just fine.  I do like the renaming
> functionality so I can plug any USB ethernet adapter into a particular
> USB port and it will work without changes so I'd rather not disable
> that.  Everything is built into the kernel, I'm not loading any
> modules.  I have 5 Dell XPS 13 systems and only one is exhibiting this
> problem.

Is your network configuration system waiting at all for network devices
to show up? If not, it's not really compatible who modern network
devices work, in particularly USB devices.

It needs to wait with libudev until the network devices it is interested
in have been reported initialized by udev.

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 headers missing and compiling failed

2014-05-13 Thread Matthew Monaco
On 05/13/2014 04:44 AM, winew...@qq.com wrote:
> hi all,
> 
> i tried to compile some source code on archlinux (v 2014.05.01), but i got an
> error: (header missing ?)
> fatal error:*systemd/sd-event.h*: No such file or directory
> #include 
> ^
> compilation terminated. 
> 

I get this when I try to compile some single binaries to patch and replace. Is
this what you're doing? My workaround is to just run make for a few seconds,
ctrl-c, and then make  =) I'm sure there's a real fix, but this has
worked for me so far.

> then i downloaded & unpacked systemd-212.tar.gz, 
> and copy the headers in systemd-212/src/systemd/
> to archlinux:/usr/include/systemd/  and "make" again,
> but i got more errors, such as: (implementation missing ?)
> undefined reference to `*sd_event_source_unref*'
> 
> so i tried to compile the newest systemd myself, 
> but i suffered errors again!
> [root@zarch systemd-212]# make 
> make --no-print-directory all-recursive
> Making all in .
> CCLD libgudev-1.0.la
> /usr/bin/ld.gold: *error*: .libs/libgudev-1.0.ver:2:1: syntax error,
> unexpected LOCAL, expecting STRING or QUOTED_STRING or EXTERN
> /usr/bin/ld.gold: fatal *error*: unable to parse version script file
> .libs/libgudev-1.0.ver
> collect2: error: ld returned 1 exit status
> Makefile:7671: recipe for target 'libgudev-1.0.la' failed
> make[2]: *** [libgudev-1.0.la] Error 1
> Makefile:14502: recipe for target 'all-recursive' failed
> make[1]: *** [all-recursive] Error 1
> Makefile:7445: recipe for target 'all' failed
> make: *** [all] Error 2
> 
> *by the way*, there is no guide for newbie in README or website,
> so i just do it as "tradition" -- step1 "./configure" and step2 "make"  (error
> occurred in step2.)
> 
> can anybody help ?
> 
> thanks!
> Hurry Zeng @ China
> 
> 
> winew...@qq.com



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] udev too late renaming network interfaces

2014-05-13 Thread Grant
>> I'm on Gentoo and when the system tries to start my network interfaces
>> at boot, I get:
>>
>> Cannot find device "enp0s20u2u1"
>>  *   ERROR: interface enp0s20u2u1 does not exist
>>  *   Ensure that you have loaded the correct kernel module for your hardware
>>  * ERROR: net.enp0s20u2u1 failed to start
>>  * Bringing up interface enp0s20u2u2
>> Cannot find device "enp0s20u2u2"
>>  *   ERROR: interface enp0s20u2u2 does not exist
>>  *   Ensure that you have loaded the correct kernel module for your hardware
>>  * ERROR: net.enp0s20u2u2 failed to start
>>
>> It seems udev is taking too long to rename my USB ethernet interfaces
>> from eth0 and eth1 to the above names.  Once the system is booted, I
>> can start the interfaces just fine.  I do like the renaming
>> functionality so I can plug any USB ethernet adapter into a particular
>> USB port and it will work without changes so I'd rather not disable
>> that.  Everything is built into the kernel, I'm not loading any
>> modules.  I have 5 Dell XPS 13 systems and only one is exhibiting this
>> problem.
>
> Is your network configuration system waiting at all for network devices
> to show up? If not, it's not really compatible who modern network
> devices work, in particularly USB devices.
>
> It needs to wait with libudev until the network devices it is interested
> in have been reported initialized by udev.


Thank you Tom and Lennart.  I'm not sure what to call my network
configuration system.  It's default Gentoo stuff, just initscrips in
runlevels.  To confirm, I should file a Gentoo bug?

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


Re: [systemd-devel] udev too late renaming network interfaces

2014-05-13 Thread Tom Gundersen
On Tue, May 13, 2014 at 3:43 PM, Grant  wrote:
>>> I'm on Gentoo and when the system tries to start my network interfaces
>>> at boot, I get:
>>>
>>> Cannot find device "enp0s20u2u1"
>>>  *   ERROR: interface enp0s20u2u1 does not exist
>>>  *   Ensure that you have loaded the correct kernel module for your hardware
>>>  * ERROR: net.enp0s20u2u1 failed to start
>>>  * Bringing up interface enp0s20u2u2
>>> Cannot find device "enp0s20u2u2"
>>>  *   ERROR: interface enp0s20u2u2 does not exist
>>>  *   Ensure that you have loaded the correct kernel module for your hardware
>>>  * ERROR: net.enp0s20u2u2 failed to start
>>>
>>> It seems udev is taking too long to rename my USB ethernet interfaces
>>> from eth0 and eth1 to the above names.  Once the system is booted, I
>>> can start the interfaces just fine.  I do like the renaming
>>> functionality so I can plug any USB ethernet adapter into a particular
>>> USB port and it will work without changes so I'd rather not disable
>>> that.  Everything is built into the kernel, I'm not loading any
>>> modules.  I have 5 Dell XPS 13 systems and only one is exhibiting this
>>> problem.
>>
>> Is your network configuration system waiting at all for network devices
>> to show up? If not, it's not really compatible who modern network
>> devices work, in particularly USB devices.
>>
>> It needs to wait with libudev until the network devices it is interested
>> in have been reported initialized by udev.
>
>
> Thank you Tom and Lennart.  I'm not sure what to call my network
> configuration system.  It's default Gentoo stuff, just initscrips in
> runlevels.  To confirm, I should file a Gentoo bug?


Sounds like it. If nothing else, they should at least be able to tell
you where to go next.

Cheers,

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


Re: [systemd-devel] udev too late renaming network interfaces

2014-05-13 Thread Samuli Suominen

On 13/05/14 16:43, Grant wrote:
>>> I'm on Gentoo and when the system tries to start my network interfaces
>>> at boot, I get:
>>>
>>> Cannot find device "enp0s20u2u1"
>>>  *   ERROR: interface enp0s20u2u1 does not exist
>>>  *   Ensure that you have loaded the correct kernel module for your hardware
>>>  * ERROR: net.enp0s20u2u1 failed to start
>>>  * Bringing up interface enp0s20u2u2
>>> Cannot find device "enp0s20u2u2"
>>>  *   ERROR: interface enp0s20u2u2 does not exist
>>>  *   Ensure that you have loaded the correct kernel module for your hardware
>>>  * ERROR: net.enp0s20u2u2 failed to start
>>>
>>> It seems udev is taking too long to rename my USB ethernet interfaces
>>> from eth0 and eth1 to the above names.  Once the system is booted, I
>>> can start the interfaces just fine.  I do like the renaming
>>> functionality so I can plug any USB ethernet adapter into a particular
>>> USB port and it will work without changes so I'd rather not disable
>>> that.  Everything is built into the kernel, I'm not loading any
>>> modules.  I have 5 Dell XPS 13 systems and only one is exhibiting this
>>> problem.
>> Is your network configuration system waiting at all for network devices
>> to show up? If not, it's not really compatible who modern network
>> devices work, in particularly USB devices.
>>
>> It needs to wait with libudev until the network devices it is interested
>> in have been reported initialized by udev.
>
> Thank you Tom and Lennart.  I'm not sure what to call my network
> configuration system.  It's default Gentoo stuff, just initscrips in
> runlevels.  To confirm, I should file a Gentoo bug?
>
>

Are you using dhcpcd with this device? It's USE="udev" in Gentoo that
makes net-misc/dhcpcd link against libudev
for initialization to make sure it's ready.

And this networking system is called net-misc/netifrc:

https://git.overlays.gentoo.org/gitweb/?p=proj/netifrc.git;a=summary

It's not programmed in C, so it's not using libudev, however, there is
/etc/init.d/net.lo that is part of the net-misc/netifrc
package, and net.lo has sys-apps/openrc specific depend() { } section,
so it's very much possible that net.lo init
script should have dependency on /etc/init.d/udev init script to ensure
it's initialized early enough
I suppose this could be the problem if you are not using dhcpcd, or it's
built wrongly, without USE="udev"

So yeah, file a Gentoo bug and provide necessary information there, if
this didn't help you

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


Re: [systemd-devel] [PATCH] readahead: ARM: fix rotational media detection for MMC

2014-05-13 Thread Chaiken, Alison
I wrote:
> The ARM runtime reports the major device type associated with
> /proc/self/mountinfo as MMC_BLOCK_MAJOR, causing on_ssd() in
> readahead-common.c to return false.   on_ssd() should return true, as
> MMC like SSD is not rotational.

Lennart writes:
> Not following here. fs_on_ssd() will actually check for the high-level
> ID_SSD property, as well as the "queue/rotational" sysfs attribute for
> the block device.

Those other checks are not reached, as the beginning of fs_on_ssd() has
if (major(st.st_dev) == 0) {}
encapsulating them, and major(st.st_dev)=MMC_BLOCK_MAJOR, not 0.My first 
attempt to fix the problem was

+if (streq(opts, "mmc") || startswith(opts, "mmc,") || endswith(opts, 
",mmc") || strstr(opts, ",mmc,"))

but that statement is also not reached.   Likely the best practice is also to 
compare MTD_BLOCK_MAJOR, but since I have no simple way to test that case, I 
didn't include it.   That's why I put the change inside an #ifdef.   As Auke 
points out in systemd-commits, where I erroneously attempted to post this 
patch, any arch using an MMC would consider it non-rotational.

-- Alison Chaiken
   Mentor Graphics, from rainy Hildesheim
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] how can I add a boot parameter to a app which depend on kernel boot option

2014-05-13 Thread Colin Guthrie
'Twas brillig, and Umut Tezduyar Lindskog at 13/05/14 12:18 did gyre and
gimble:
> Hi Xiong
> 
> You can have a script that reads the  /proc/cmdline and then calls
> exec with your app.
> 
> ExecStart=/your/custom/scipt
> 
> cat /your/custom/script:
> 
> # Do what ever you want, figure out parameters
> 
> # Start your application
> exec myapp --parameter=xyz

Yup this looks like the best idea.


There is also ConditionKernelCommandLine= but that would require you
actually have several units for each different option and have the
Condition prevent it from running.

ConditionKernelCommandLine also only does quite simple matching, so it
might not do what you need anyway.

So I think a wrapper script is likely best here. Or some:
  ExecStart=/bin/bash -c '...'
if you can encapsulate it simply enough within the ''.

Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/

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


Re: [systemd-devel] [PATCH] Fix systemd-stdio-bridge symlink

2014-05-13 Thread Umut Tezduyar Lindskog
On Wednesday, May 7, 2014, Colin Guthrie  wrote:

> 'Twas brillig, and Umut Tezduyar Lindskog at 04/03/14 12:44 did gyre and
> gimble:
> >> Does that actually matter much? This ln usage is at build time, not
> install time,
> >> and those stable versions aren't going to upgrade to a current systemd,
> >> because avoiding non-minimal upgrades is the whole point of stable
> distro
> >> releases.
> >
> > As you have stated, it matters for build time and we have build machines
> not running the latest and greatest SW. I wouldn't be surprised if we are
> not alone.
>
> Yeah, some of our build nodes are actually pretty old too, but that
> shouldn't matter really as the building happens inside a chroot with the
> latest packages, which includes latest ln.
>
> Do you really build on an older node against older libs with older ln
> etc? I would have thought you'd also have some kind of chroot on these
> nodes when building too no?


No. We just have virtual machines with Debian Wheezy to do the build.

Umut

>
> Col
>
>
>
>
> --
>
> Colin Guthrie
> gmane(at)colin.guthr.ie
> http://colin.guthr.ie/
>
> Day Job:
>   Tribalogic Limited http://www.tribalogic.net/
> Open Source:
>   Mageia Contributor http://www.mageia.org/
>   PulseAudio Hacker http://www.pulseaudio.org/
>   Trac Hacker http://trac.edgewall.org/
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org 
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd freezes after rshd execution, if network connection is down

2014-05-13 Thread Umut Tezduyar Lindskog
It is also reproducible by just loosing the carrier on the link. Maybe new
async close is a candidate to solve it.

On Tuesday, April 29, 2014, Harald Hoyer  wrote:

> Am 28.04.2014 13:33, schrieb Jimmy Assarsson:
> > Hi,
> >
> > We stumbled upon a freeze/block in systemd.
> > The problem occurs when a rshd (socket activated) execution is
> completed, the network connection is down and systemd is closing the socket.
> > This causes a long (60 seconds) freeze where it's not possible to
> communicate with systemd.
> > Do you have any idea on what is causing this or how we can investigate
> this further?
> >
> >
> > To reproduce the problem:
> > 1) Get latest Arch Linux
> > 2) On remote machine execute
> >rsh $target_ip -l root 'sleep 40'
> > 3) Set link down on the interface which is assigned with $target_ip, on
> systemd machine
> >ip link set down dev $if
> > 4) On systemd machine, wait for 'sleep 40' to be completed. Then execute
> any systemd command
> >systemctl list-jobs
> > 5) After 60 seconds systemd is responding again
> >
> >
> > By looking at the stack trace (see bellow), one can see that we are
> trying to close a socket and waiting on a system close call. So it's
> probably not a systemd problem, however systemd is affected by it.
> >
> > We've succesfully reproduced the problem on different hardware
> architectures (x86_64, arm, cris), systemd versions (208, 210, 212) and
> rshd implementations (netkit-rsh-0.17, inetutils 1.9.2-1). The problem
> occurs not only when the interface's link is set down, also when the IP
> address is removed or the ethernet cable is unplugged. ssh seems not to be
> affected by the problem.
> >
> >
> > We generated a core dump:
> > kill -SIGABRT 1
> >
> > Here is the stack trace (the machine is running systemd 210).
> > (gdb) bt
> > #0  0xb6f4d830 in raise (sig=sig@entry=6) at
> ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:46
> > #1  0x000527e8 in crash.4282 (sig=6) at
> apps/systemd/systemd/src/core/main.c:156
> > #2  
> > #3  0xb6f4c28c in close () from
> target/armv6-axis-linux-gnueabi/lib/libpthread.so.0
> > #4  0x0009417c in close_nointr (fd=) at
> apps/systemd/systemd/src/shared/util.c:167
> > #5  0x00094250 in close_nointr_nofail (fd=) at
> apps/systemd/systemd/src/shared/util.c:191
> > #6  0x00073e0c in service_close_socket_fd.9824 (s=s@entry=0x1b6f918) at
> apps/systemd/systemd/src/core/service.c:229
> > #7  0x00079728 in service_set_state.9835 (s=s@entry=0x1b6f918,
> state=SERVICE_DEAD) at apps/systemd/systemd/src/core/service.c:1496
> > #8  0x00079b70 in service_enter_dead.9847 (s=0x1b6f918, f= out>, allow_restart=)
> > at apps/systemd/systemd/src/core/service.c:1852
> > #9  0x00065470 in service_sigchld_event (u=0x1b6f918, pid= out>, code=1, status=0)
> > at apps/systemd/systemd/src/core/service.c:3037
> > #10 0x00073490 in invoke_sigchld_event.5410 (m=m@entry=0x1ad7360,
> u=0x1b6f918, si=0xbe862670, si@entry=0xbe862668)
> > at apps/systemd/systemd/src/core/manager.c:1430
> > #11 0x00054084 in manager_dispatch_sigchld.5415 (m=m@entry=0x1ad7360)
> at apps/systemd/systemd/src/core/manager.c:1477
> > #12 0x000629b0 in manager_dispatch_signal_fd.part.32
> (userdata=) at apps/systemd/systemd/src/core/manager.c:1723
> > #13 manager_dispatch_signal_fd.5363 (source=,
> fd=, revents=, userdata=0x1ad7360)
> > at apps/systemd/systemd/src/core/manager.c:1508
> > #14 0x0003e880 in source_dispatch (s=0x1ad7758) at
> apps/systemd/systemd/src/libsystemd/sd-event/sd-event.c:1861
> > #15 0x00041288 in sd_event_run (e=0x1ad61d8, timeout=) at
> apps/systemd/systemd/src/libsystemd/sd-event/sd-event.c:2117
> > #16 0x000103c8 in manager_loop (m=0x1ad7360) at
> apps/systemd/systemd/src/core/manager.c:1844
> > #17 main (argc=1, argv=0xbe862ee4) at
> apps/systemd/systemd/src/core/main.c:1704
> >
> > Thanks,
> > Jimmy
>
> Hmm, reminds me of:
>
>
> http://stackoverflow.com/questions/3757289/tcp-option-so-linger-zero-when-its-required
>
> http://oroboro.com/dealing-with-network-port-abuse-in-sockets-in-c/
>
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org 
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] cryptsetup vs. swapon/fsck (some kind of race condition)

2014-05-13 Thread Andy Kittner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512


Hi all,

first I hope I'm asking at the right place here, if not feel free to
kick me in the right direction.

Now, for my problem:

I have several encrypted partions set up via /etc/crypttab
Since the update to systemd-212 (from 207 I think) the following happens

- - Oh, here is a partition from crypttab, lets uncrypt it
- - Crypto for /home done
- - Hey, this block device for /home just turned up, lets fsck it
- - Stopping crypto for /home (WTF? why would you do that?)
- - Surprise fsck'ing the home partition failed because the device just
  disappeared

I'm pretty sure it is some kind of race-condition/ timing problem,
because about 1 in 10 boots works just fine.
Also, the same setup worked fine before.

I've been kind of living with this for a while now (login at the
admin-shell and systemctl isolate default.target --> system goes up
normally) because I was to lazy to dig through the logs, but today I
finally got fed up enough with it to get of my lazy but.


Sadly the logs didn't tell me much of *why* things happen the way they
do, so maybe someone here as an idea how to investigate this further.

These are the relevant parts of the log:
| May 13 18:50:31 pinky systemd[1]: Received SIGCHLD from PID 2647
(systemd-cryptse).
| May 13 18:50:31 pinky systemd[1]: Child 2647 (systemd-cryptse) died
(code=exited, status=0/SUCCESS)
| May 13 18:50:31 pinky systemd[1]: Child 2647 belongs to
systemd-cryptsetup@swap.service
| May 13 18:50:31 pinky systemd[1]: systemd-cryptsetup@swap.service:
main process exited, code=exited, status=0/SUCCESS
| May 13 18:50:31 pinky systemd[1]: systemd-cryptsetup@swap.service
changed start -> exited
| May 13 18:50:31 pinky systemd[1]: Job
systemd-cryptsetup@swap.service/start finished, result=done
| May 13 18:50:31 pinky systemd[1]: Started Cryptography Setup for swap.
| May 13 18:50:31 pinky systemd[1]: systemd-cryptsetup@swap.service:
cgroup is empty
| May 13 18:50:33 pinky systemd-udevd[2751]: conflicting device node
'/dev/mapper/swap' found, link to '/dev/dm-1' will not be created
Thats the first one I find a bit fishy, but it doesn't sound fatal
either...

| May 13 18:50:33 pinky systemd[1]: dev-mapper-swap.device changed
dead -> plugged
| May 13 18:50:33 pinky systemd[1]: Job dev-mapper-swap.device/start
finished, result=done
| May 13 18:50:33 pinky systemd[1]: Found device /dev/mapper/swap.
| May 13 18:50:33 pinky systemd[1]:
dev-disk-by\x2duuid-e51117ad\x2db39b\x2d4ca3\x2da3cf\x2d81016a3b0190.device
changed dead -> plugged
| May 13 18:50:33 pinky systemd[1]: Job
dev-disk-by\x2duuid-e51117ad\x2db39b\x2d4ca3\x2da3cf\x2d81016a3b0190.device/start
finished, result=done
| May 13 18:50:33 pinky systemd[1]: Found device
/dev/disk/by-uuid/e51117ad-b39b-4ca3-a3cf-81016a3b0190.
| May 13 18:50:33 pinky systemd[1]:
dev-disk-by\x2did-dm\x2duuid\x2dCRYPT\x2dLUKS1\x2db1c029d2515b47a1becf59c1f5191e43\x2dswap.device
changed dead -> plugged
| May 13 18:50:33 pinky systemd[1]:
dev-disk-by\x2did-dm\x2dname\x2dswap.device changed dead -> plugged
| May 13 18:50:33 pinky systemd[1]: dev-dm\x2d1.device changed dead ->
plugged
| May 13 18:50:33 pinky systemd[1]:
sys-devices-virtual-block-dm\x2d1.device changed dead -> plugged
So far, so good

| May 13 18:50:33 pinky systemd[1]: dev-mapper-swap.device changed
plugged -> dead
And here I think is the root of my problem, but I have no idea what
causes this or how to get more information about that,

| May 13 18:50:33 pinky systemd[1]: Trying to enqueue job
systemd-cryptsetup@swap.service/stop/replace
| May 13 18:50:33 pinky systemd[1]: Installed new job
systemd-cryptsetup@swap.service/stop as 282
| May 13 18:50:33 pinky systemd[1]: Job cryptsetup.target/start
finished, result=canceled
| May 13 18:50:33 pinky systemd[1]: Installed new job
cryptsetup.target/stop as 283
| May 13 18:50:33 pinky systemd[1]: Enqueued job
systemd-cryptsetup@swap.service/stop as 282
| May 13 18:50:33 pinky systemd[1]:
dev-disk-by\x2duuid-e51117ad\x2db39b\x2d4ca3\x2da3cf\x2d81016a3b0190.device
changed plugged -> dead
| May 13 18:50:33 pinky systemd[1]:
dev-disk-by\x2did-dm\x2duuid\x2dCRYPT\x2dLUKS1\x2db1c029d2515b47a1becf59c1f5191e43\x2dswap.device
changed plugged -> dead
| May 13 18:50:33 pinky systemd[1]:
dev-disk-by\x2did-dm\x2dname\x2dswap.device changed plugged -> dead
| May 13 18:50:33 pinky systemd[1]: dev-dm\x2d1.device changed plugged
- -> dead
| May 13 18:50:33 pinky systemd[1]:
sys-devices-virtual-block-dm\x2d1.device changed plugged -> dead
| May 13 18:50:33 pinky systemd[1]: Collecting
sys-devices-virtual-block-dm\x2d1.device
| May 13 18:50:33 pinky systemd[1]: Collecting dev-dm\x2d1.device
| May 13 18:50:33 pinky systemd[1]: Collecting
dev-disk-by\x2did-dm\x2dname\x2dswap.device
| May 13 18:50:33 pinky systemd[1]: Collecting
dev-disk-by\x2did-dm\x2duuid\x2dCRYPT\x2dLUKS1\x2db1c029d2515b47a1becf59c1f5191e43\x2dswap.device
| May 13 18:50:33 pinky systemd[1]: Stopped target Encrypted Volumes.
| May 13 18:50:33 pinky sy

[systemd-devel] How do I make some environment variables available to user-mode unit?

2014-05-13 Thread Andrei Dziahel
Hey list,

I've create socket-activated user-mode unit[1] that sets up a SSH
tunnel, but it fails to start because ssh is unaware of ssh-agent
(gnome-keyring) because of empty environment. Is this possible to feed
ssh-agent-related environment variables to foo-tunnel.service making
gnome-keyring ask me to unlock openssh key?

  [1]: https://gist.github.com/develop7/bdab20c0d9658f0d2b08

Thank you in advance.
-- 
Regards,
Andrei Dziahel
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] cryptsetup vs. swapon/fsck (some kind of race condition)

2014-05-13 Thread Zbigniew Jędrzejewski-Szmek
On Tue, May 13, 2014 at 08:01:21PM +0200, Andy Kittner wrote:
> | May 13 18:50:33 pinky systemd-udevd[2751]: conflicting device node
> '/dev/mapper/swap' found, link to '/dev/dm-1' will not be created
> Thats the first one I find a bit fishy, but it doesn't sound fatal
> either...
When this happens, what does /dev/mapper/swap point at?

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


Re: [systemd-devel] How do I make some environment variables available to user-mode unit?

2014-05-13 Thread Zbigniew Jędrzejewski-Szmek
On Tue, May 13, 2014 at 10:21:07PM +0300, Andrei Dziahel wrote:
> Hey list,
> 
> I've create socket-activated user-mode unit[1] that sets up a SSH
> tunnel, but it fails to start because ssh is unaware of ssh-agent
> (gnome-keyring) because of empty environment. Is this possible to feed
> ssh-agent-related environment variables to foo-tunnel.service making
> gnome-keyring ask me to unlock openssh key?
> 
>   [1]: https://gist.github.com/develop7/bdab20c0d9658f0d2b08
systemctl import-environment should do the trick. It's only avilable since
systemd-209, but if you're using something earlier, systemctl set-environent
would also work.

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


Re: [systemd-devel] [PATCH] readahead: ARM: fix rotational media detection for MMC

2014-05-13 Thread Zbigniew Jędrzejewski-Szmek
On Tue, May 13, 2014 at 02:14:20PM +, Chaiken, Alison wrote:
> I wrote:
> > The ARM runtime reports the major device type associated with
> > /proc/self/mountinfo as MMC_BLOCK_MAJOR, causing on_ssd() in
> > readahead-common.c to return false.   on_ssd() should return true, as
> > MMC like SSD is not rotational.
> 
> Lennart writes:
> > Not following here. fs_on_ssd() will actually check for the high-level
> > ID_SSD property, as well as the "queue/rotational" sysfs attribute for
> > the block device.
> 
> Those other checks are not reached, as the beginning of fs_on_ssd() has
> if (major(st.st_dev) == 0) {}
> encapsulating them, and major(st.st_dev)=MMC_BLOCK_MAJOR, not 0.
No, those other checks are *below* the if.

What do

1. udevadm info /dev/mmcXXX | grep SSD
2. cat /sys/class/block/mmcXXX/queue/rotational

say?

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


Re: [systemd-devel] systemd freezes after rshd execution, if network connection is down

2014-05-13 Thread Zbigniew Jędrzejewski-Szmek
On Tue, May 13, 2014 at 07:40:53PM +0200, Umut Tezduyar Lindskog wrote:
> It is also reproducible by just loosing the carrier on the link. Maybe new
> async close is a candidate to solve it.
> 
> On Tuesday, April 29, 2014, Harald Hoyer  wrote:
> 
> > Am 28.04.2014 13:33, schrieb Jimmy Assarsson:
> > > Hi,
> > >
> > > We stumbled upon a freeze/block in systemd.
> > > The problem occurs when a rshd (socket activated) execution is
> > completed, the network connection is down and systemd is closing the socket.
> > > This causes a long (60 seconds) freeze where it's not possible to
> > communicate with systemd.
> > > Do you have any idea on what is causing this or how we can investigate
> > this further?
Can you check if this patch fixes the problem:

-&<-
Subject: [PATCH] core: close socket fds asynchronously

http://lists.freedesktop.org/archives/systemd-devel/2014-April/018928.html
---
 src/core/service.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/core/service.c b/src/core/service.c
index 694a265..7461ec3 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -27,6 +27,7 @@
 #include 
 #include 
 
+#include "async.h"
 #include "manager.h"
 #include "unit.h"
 #include "service.h"
@@ -222,7 +223,7 @@ static void service_close_socket_fd(Service *s) {
 if (s->socket_fd < 0)
 return;
 
-s->socket_fd = safe_close(s->socket_fd);
+s->socket_fd = asynchronous_close(s->socket_fd);
 }
 
 static void service_connection_unref(Service *s) {
@@ -2705,7 +2706,7 @@ static int service_deserialize_item(Unit *u, const char 
*key, const char *value,
 log_debug_unit(u->id, "Failed to parse socket-fd value 
%s", value);
 else {
 
-safe_close(s->socket_fd);
+asynchronous_close(s->socket_fd);
 s->socket_fd = fdset_remove(fds, fd);
 }
 } else if (streq(key, "main-exec-status-pid")) {
-- 
1.9.0
->&-

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


Re: [systemd-devel] cryptsetup vs. swapon/fsck (some kind of race condition)

2014-05-13 Thread Andy Kittner
On 13/05/14 23:39, Zbigniew Jędrzejewski-Szmek wrote:
> On Tue, May 13, 2014 at 08:01:21PM +0200, Andy Kittner wrote:
>> | May 13 18:50:33 pinky systemd-udevd[2751]: conflicting device node
>> '/dev/mapper/swap' found, link to '/dev/dm-1' will not be created
>> Thats the first one I find a bit fishy, but it doesn't sound fatal
>> either...
> When this happens, what does /dev/mapper/swap point at?


Here are the nodes I have right now:
/dev/mapper:
total 0
crw--- 1 root root  10, 236 May 13 18:50 control
brw--- 1 root root 254,   3 May 13 18:50 data
brw--- 1 root root 254,   4 May 13 18:50 home
lrwxrwxrwx 1 root root   14 May 13 18:50 root -> root_sdb5-root
lrwxrwxrwx 1 root root7 May 13 18:50 root_sdb5-root -> ../dm-0
lrwxrwxrwx 1 root root7 May 13 18:50 swap -> ../dm-1
lrwxrwxrwx 1 root root7 May 13 18:50 videos -> ../dm-2

/dev/dm-*:
brw-rw 1 root disk 254, 0 May 13 18:50 /dev/dm-0
brw-rw 1 root disk 254, 1 May 13 18:50 /dev/dm-1
brw-rw 1 root disk 254, 2 May 13 18:50 /dev/dm-2
brw-rw 1 root disk 254, 3 May 13 18:50 /dev/dm-3
brw-rw 1 root disk 254, 4 May 13 18:50 /dev/dm-4


Regards,
Andy


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


[systemd-devel] [PATCH] network: fix build failure, missing KMOD_XXX flags

2014-05-13 Thread Cristian Rodríguez
- Add KMOD_CFLAGS and KMOD_LIBS where appropiate
- networkd now requires kmod. make --disable-kmod --enable-networkd
to raise an error.
---
 Makefile.am  | 7 ++-
 configure.ac | 2 ++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index b8ff732..0d08975 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2479,6 +2479,7 @@ busctl_CFLAGS = \
 noinst_LTLIBRARIES += \
libsystemd-network.la
 
+libsystemd_network_la_CFLAGS = $(AM_CFLAGS) $(KMOD_CFLAGS)
 libsystemd_network_la_SOURCES = \
src/systemd/sd-network.h \
src/systemd/sd-dhcp-client.h \
@@ -2504,7 +2505,8 @@ libsystemd_network_la_SOURCES = \
 libsystemd_network_la_LIBADD = \
libsystemd-label.la \
libsystemd-internal.la \
-   libsystemd-shared.la
+   libsystemd-shared.la \
+   $(KMOD_LIBS)
 
 test_dhcp_option_SOURCES = \
src/libsystemd-network/dhcp-protocol.h \
@@ -4185,6 +4187,7 @@ systemd_networkd_LDADD = \
 noinst_LTLIBRARIES += \
libsystemd-networkd-core.la
 
+libsystemd_networkd_core_la_CFLAGS = $(AM_CFLAGS) $(KMOD_CFLAGS)
 libsystemd_networkd_core_la_SOURCES = \
src/libsystemd-network/network-internal.h \
src/network/networkd.h \
@@ -4218,6 +4221,8 @@ GENERAL_ALIASES += \
 rootlibexec_PROGRAMS += \
systemd-networkd-wait-online
 
+systemd_networkd_wait_online_CFLAGS = $(AM_CFLAGS) $(KMOD_CFLAGS)
+
 systemd_networkd_wait_online_SOURCES = \
src/libsystemd-network/network-internal.h \
src/network/networkd-wait-online.c \
diff --git a/configure.ac b/configure.ac
index 972fc2f..4e78bf8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -875,6 +875,8 @@ if test "x$enable_networkd" != "xno"; then
 AC_DEFINE(ENABLE_NETWORKD, 1, [Define if networkd support is to be 
enabled])
 have_networkd=yes
 fi
+AS_IF([test "x$have_networkd" = "xyes" -a "x$have_kmod" != "xyes"],
+  [AC_MSG_ERROR([networkd requires kmod])])
 AM_CONDITIONAL(ENABLE_NETWORKD, [test "x$have_networkd" = "xyes"])
 
 # 
--
-- 
1.8.4.5

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


[systemd-devel] remounting root fs outside containers as MS_SHARED

2014-05-13 Thread Ani Sinha
Note: I had sent this email earlier but I realized that I needed to be
subscribed to the mailing list. Now that I have my subscription, I am
resending it again.

Lennart, sorry for the double noise.

---

Hello folks:

The following change started mounting the rootfs as shared :

b3ac5f8cb98757416d8660023d6564a7c411f0a0

The commit log and the corresponding comment in the code says that if
any setups needed the kernel default private mount, one could use
something like :

mount --make-rprivate /

right after the boot.

Unfortunately, we have a setup where we do need the kernel default
private mount and we tried what has been suggested by using a systemd
service file to remount rootfs to private. Unfortunately, while this
works most of the time, this technique is not bullet proof.
Unfortunately glibc (and possibly other libraries) do "telinit u" as a
part of their post installation setup. This re-execs systemd and hence
remounts the root fs as shared again, breaking our system in the
process.

As it is not possible to go and fix all these libraries, I have a
simple request from the systemd hackers here. Can we please have a
configuration option (either as a kernel command line, or a systemd
startup command line or a config file option) that disables this
default behaviour for setups that do need the private rootfs mount?
That way the default remains as is for most systems and yet there will
be a way to override this when one really wants to. It would seem to
give us the best of both worlds.

Any comments?

Thanks in advance,
Ani
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd headers missing and compiling failed

2014-05-13 Thread winew...@qq.com
hi Matthew Monaco,since i want to make and install the whole package, your 
workaround doesn't work for me.anyway, thanks for your reply!Hurry Zeng @ China
> Matthew Monaco matt at monaco.cx 
> Tue May 13 05:38:18 PDT 2014> On 05/13/2014 04:44 AM, winewolf at qq.com 
> wrote:>> hi all,
>> 
>> i tried to compile some source code on archlinux (v 2014.05.01), but i got an
>> error: (header missing ?)
>> fatal error:*systemd/sd-event.h*: No such file or directory
>> #include 
>> ^
>> compilation terminated. 
>> 

> I get this when I try to compile some single binaries to patch and replace. Is
> this what you're doing? My workaround is to just run make for a few seconds,
> ctrl-c, and then make  =) I'm sure there's a real fix, but this has
> worked for me so far.



winew...@qq.com
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Failed to mark scope session-20.scope as abandoned

2014-05-13 Thread Garry T. Williams
On 5-12-14 15:11:46 Michal Sekletar wrote:
> On Sat, May 10, 2014 at 05:12:21PM -0400, Garry T. Williams wrote:
> > This recently stated showing up in the journal on Fedora F20 here:
> > 
> > May 10 17:01:01 vfr systemd[1]: Failed to mark scope session-20.scope 
> > as abandoned : Stale file handle
> 
> I suspect this is caused by race between systemd realizing that
> cgroup for a scope is empty, thus changing its state, and
> dispatching dbus message coming from logind where it asks systemd to
> mark scope as abandoned. I don't think this is a big deal so we
> could log this only if debug is on.
> 
> To make sure if it is the case can you try to reproduce with systemd
> and logind debug turned on. Thanks!

Heh.  Reproducing was an interesting problem.

Based on your suspicion, I created a crontab to run a couple of
logger(1) commands every minute and then tried to create a lot of I/O
on the system in the hope that I could recreate the race.  Luckily, I
caught it.

I see

systemd[1]: session-45.scope changed running -> dead
systemd[1]: Collecting session-45.scope

happening in the log before

systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Scope.Abandon() on 
/org/freedesktop/systemd1/unit/session_2d45_2escope
systemd[1]: Failed to mark scope session-45.scope as abandoned : Stale file 
handle

Is that the race?

systemd[1]: Got D-Bus request: org.freedesktop.DBus.NameOwnerChanged() on 
/org/freedesktop/DBus
systemd-logind[654]: Got message: org.freedesktop.DBus org.freedesktop.DBus 
NameOwnerChanged
systemd-logind[654]: Got message: :1.117 org.freedesktop.login1.Manager 
CreateSession
systemd[1]: Got D-Bus request: 
org.freedesktop.systemd1.Manager.StartTransientUnit() on 
/org/freedesktop/systemd1
systemd[1]: Failed to load configuration for session-45.scope: No such file or 
directory
systemd[1]: SELinux access check scon=system_u:system_r:systemd_logind_t:s0 
tcon=system_u:system_r:init_t:s0 tclass=service perm=start path=(null) 
cmdline=(null): 0
systemd[1]: SELinux access check scon=system_u:system_r:systemd_logind_t:s0 
tcon=system_u:object_r:systemd_unit_file_t:s0 tclass=service perm=start 
path=/run/systemd/system/session-45.scope cmdline=(null): 0
systemd[1]: Trying to enqueue job session-45.scope/start/fail
systemd[1]: Installed new job session-45.scope/start as 3401
systemd[1]: Enqueued job session-45.scope/start as 3401
systemd[1]: Starting Session 45 of user garry.
systemd[1]: session-45.scope changed dead -> running
systemd[1]: Job session-45.scope/start finished, result=done
systemd[1]: Started Session 45 of user garry.
systemd[1]: Got D-Bus request: org.freedesktop.DBus.NameOwnerChanged() on 
/org/freedesktop/DBus
systemd-logind[654]: New session 45 of user garry.
systemd-logind[654]: Got message: org.freedesktop.DBus org.freedesktop.DBus 
NameOwnerChanged
systemd-logind[654]: Got message: :1.118 org.freedesktop.login1.Manager 
CreateSession
systemd[1]: Got D-Bus request: 
org.freedesktop.systemd1.Manager.StartTransientUnit() on 
/org/freedesktop/systemd1
systemd[1]: Failed to load configuration for session-44.scope: No such file or 
directory
systemd[1]: SELinux access check scon=system_u:system_r:systemd_logind_t:s0 
tcon=system_u:system_r:init_t:s0 tclass=service perm=start path=(null) 
cmdline=(null): 0
systemd[1]: SELinux access check scon=system_u:system_r:systemd_logind_t:s0 
tcon=system_u:object_r:systemd_unit_file_t:s0 tclass=service perm=start 
path=/run/systemd/system/session-44.scope cmdline=(null): 0
systemd[1]: Trying to enqueue job session-44.scope/start/fail
systemd[1]: Installed new job session-44.scope/start as 3407
systemd[1]: Enqueued job session-44.scope/start as 3407
systemd[1]: Starting Session 44 of user garry.
systemd-logind[654]: New session 44 of user garry.
systemd-logind[654]: Got message: :1.2 org.freedesktop.systemd1.Manager 
JobRemoved
systemd[1]: session-44.scope changed dead -> running
systemd[1]: Job session-44.scope/start finished, result=done
systemd[1]: Started Session 44 of user garry.
systemd[1]: Got D-Bus request: org.freedesktop.DBus.NameOwnerChanged() on 
/org/freedesktop/DBus
systemd-logind[654]: Got message: org.freedesktop.DBus org.freedesktop.DBus 
NameOwnerChanged
systemd-logind[654]: Got message: :1.2 org.freedesktop.systemd1.Manager 
JobRemoved
systemd-logind[654]: Got message: org.freedesktop.DBus org.freedesktop.DBus 
NameOwnerChanged
systemd-logind[654]: Got message: org.freedesktop.DBus org.freedesktop.DBus 
NameOwnerChanged
systemd-logind[654]: Got message: :1.119 org.freedesktop.login1.Manager 
ReleaseSession
systemd-logind[654]: Got message: org.freedesktop.DBus org.freedesktop.DBus 
NameOwnerChanged
systemd[1]: Got D-Bus request: org.freedesktop.DBus.NameOwnerChanged() on 
/org/freedesktop/DBus
systemd[1]: Got D-Bus request: org.freedesktop.DBus.NameOwnerChanged() on 
/org/freedesktop/DBus
systemd[1]: Got D-Bus request: org.freedesktop.DBus.NameOwnerChanged() on 
/org/freedesktop/DBus
systemd[1]: Got D-Bus

Re: [systemd-devel] Failed to mark scope session-20.scope as abandoned

2014-05-13 Thread Michal Sekletar
On Tue, May 13, 2014 at 11:54:49PM -0400, Garry T. Williams wrote:
> On 5-12-14 15:11:46 Michal Sekletar wrote:
> > On Sat, May 10, 2014 at 05:12:21PM -0400, Garry T. Williams wrote:
> > > This recently stated showing up in the journal on Fedora F20 here:
> > > 
> > > May 10 17:01:01 vfr systemd[1]: Failed to mark scope session-20.scope 
> > > as abandoned : Stale file handle
> > 
> > I suspect this is caused by race between systemd realizing that
> > cgroup for a scope is empty, thus changing its state, and
> > dispatching dbus message coming from logind where it asks systemd to
> > mark scope as abandoned. I don't think this is a big deal so we
> > could log this only if debug is on.
> > 
> > To make sure if it is the case can you try to reproduce with systemd
> > and logind debug turned on. Thanks!
> 
> Heh.  Reproducing was an interesting problem.
> 
> Based on your suspicion, I created a crontab to run a couple of
> logger(1) commands every minute and then tried to create a lot of I/O
> on the system in the hope that I could recreate the race.  Luckily, I
> caught it.
> 
> I see
> 
> systemd[1]: session-45.scope changed running -> dead
> systemd[1]: Collecting session-45.scope
> 
> happening in the log before
> 
> systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Scope.Abandon() 
> on /org/freedesktop/systemd1/unit/session_2d45_2escope
> systemd[1]: Failed to mark scope session-45.scope as abandoned : Stale 
> file handle
> 
> Is that the race?

That would be it! As you can see [0] we proceed in execution of handler code for
Abandon() only for scopes which are either running or already abandoned. However
scope here is, at the time systemd gets to processing D-Bus request, already in 
a dead
state.

I'll wait a bit and if no one objects I'll go ahead and change log level for a
message and also change it to something more sensible so it actually makes 
sense to people.

[0]
http://cgit.freedesktop.org/systemd/systemd-stable/tree/src/core/scope.c#n433

Cheers,

Michal

> 
> systemd[1]: Got D-Bus request: org.freedesktop.DBus.NameOwnerChanged() on 
> /org/freedesktop/DBus
> systemd-logind[654]: Got message: org.freedesktop.DBus org.freedesktop.DBus 
> NameOwnerChanged
> systemd-logind[654]: Got message: :1.117 org.freedesktop.login1.Manager 
> CreateSession
> systemd[1]: Got D-Bus request: 
> org.freedesktop.systemd1.Manager.StartTransientUnit() on 
> /org/freedesktop/systemd1
> systemd[1]: Failed to load configuration for session-45.scope: No such file 
> or directory
> systemd[1]: SELinux access check scon=system_u:system_r:systemd_logind_t:s0 
> tcon=system_u:system_r:init_t:s0 tclass=service perm=start path=(null) 
> cmdline=(null): 0
> systemd[1]: SELinux access check scon=system_u:system_r:systemd_logind_t:s0 
> tcon=system_u:object_r:systemd_unit_file_t:s0 tclass=service perm=start 
> path=/run/systemd/system/session-45.scope cmdline=(null): 0
> systemd[1]: Trying to enqueue job session-45.scope/start/fail
> systemd[1]: Installed new job session-45.scope/start as 3401
> systemd[1]: Enqueued job session-45.scope/start as 3401
> systemd[1]: Starting Session 45 of user garry.
> systemd[1]: session-45.scope changed dead -> running
> systemd[1]: Job session-45.scope/start finished, result=done
> systemd[1]: Started Session 45 of user garry.
> systemd[1]: Got D-Bus request: org.freedesktop.DBus.NameOwnerChanged() on 
> /org/freedesktop/DBus
> systemd-logind[654]: New session 45 of user garry.
> systemd-logind[654]: Got message: org.freedesktop.DBus org.freedesktop.DBus 
> NameOwnerChanged
> systemd-logind[654]: Got message: :1.118 org.freedesktop.login1.Manager 
> CreateSession
> systemd[1]: Got D-Bus request: 
> org.freedesktop.systemd1.Manager.StartTransientUnit() on 
> /org/freedesktop/systemd1
> systemd[1]: Failed to load configuration for session-44.scope: No such file 
> or directory
> systemd[1]: SELinux access check scon=system_u:system_r:systemd_logind_t:s0 
> tcon=system_u:system_r:init_t:s0 tclass=service perm=start path=(null) 
> cmdline=(null): 0
> systemd[1]: SELinux access check scon=system_u:system_r:systemd_logind_t:s0 
> tcon=system_u:object_r:systemd_unit_file_t:s0 tclass=service perm=start 
> path=/run/systemd/system/session-44.scope cmdline=(null): 0
> systemd[1]: Trying to enqueue job session-44.scope/start/fail
> systemd[1]: Installed new job session-44.scope/start as 3407
> systemd[1]: Enqueued job session-44.scope/start as 3407
> systemd[1]: Starting Session 44 of user garry.
> systemd-logind[654]: New session 44 of user garry.
> systemd-logind[654]: Got message: :1.2 org.freedesktop.systemd1.Manager 
> JobRemoved
> systemd[1]: session-44.scope changed dead -> running
> systemd[1]: Job session-44.scope/start finished, result=done
> systemd[1]: Started Session 44 of user garry.
> systemd[1]: Got D-Bus request: org.freedesktop.DBus.NameOwnerChanged() on 
> /org/freedesktop/DBus
> systemd-logind[654]: Got message: org.freedesktop.DBus org.freedesktop.DBus