Re: [systemd-devel] device units rely on udev rules?

2011-05-10 Thread Koen Kooi

Op 9 mei 2011, om 22:23 heeft Kay Sievers het volgende geschreven:

 On Mon, May 9, 2011 at 22:08, Lennart Poettering lenn...@poettering.net 
 wrote:
 On Mon, 09.05.11 22:02, Lennart Poettering (lenn...@poettering.net) wrote:
 
 It's still in the 10 second range on a 600MHz cortex-a8 machine
 booting from an SD card. I need to dig out my 400MHz arm920t to see
 how long it takes there. So having udev-less operation in systemd
 would be nice, even if it's only used on 'embedded'
 
 Have you checked what precisely takes so long? My guess is that some
 driver has a slow sysfs uevent trigger callback, and that might be
 fixable in the driver. You might want to use strace with timestamps to
 figure out why udev trigger might be so slow.
 
 Also note that only very few devices are exposed and depended on by
 systemd. In an embedded env you might be able to simple trigger those
 explicitly first, and then trigger the rest afterwards. That way you
 don't have to wait 10s, and the triggering will be dispatched in the bg,
 but you still get the flexibility that udev can handle hotplugged
 devices.
 
 Kay, opinions?
 
 Guess that should work fine. I guess we could short-cut some stuff too
 if it helps for custom setups, so systemd would look if the device is
 already there, instead of wait for the tag to show up. But we would
 need to find out if that really helps.
 
 Real numbers of the most recent udev on such systems would help, so we
 get an idea what we are dealing with.
 
 Things like:
  time (udevadm trigger; udevadm settle)

root@beagleboard-systemd:~# time ( udevadm trigger ; udevadm settle)

real3m0.475s
user0m0.008s
sys 0m0.117s



 would be good to know too. If that looks like something to fix, the output of:
  udevadm monitor

monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[1305015564.600250] change   /devices/omapdss/display0 (omapdss)
KERNEL[1305015564.600768] change   /devices/omapdss/display1 (omapdss)
KERNEL[1305015564.601165] change   /devices/platform/arm-pmu.0 (platform)
KERNEL[1305015564.601501] change   /devices/platform/ehci-omap.0 (platform)
KERNEL[1305015564.601959] change   /devices/platform/ehci-omap.0/usb1 (usb)
KERNEL[1305015564.602386] change   /devices/platform/ehci-omap.0/usb1/1-0:1.0 
(usb)
KERNEL[1305015564.602813] change   /devices/platform/ehci-omap.0/usb1/1-2 (usb)
KERNEL[1305015564.603240] change   /devices/platform/ehci-omap.0/usb1/1-2/1-2.1 
(usb)
KERNEL[1305015564.603698] change   
/devices/platform/ehci-omap.0/usb1/1-2/1-2.1/1-2.1:1.0 (usb)
KERNEL[1305015564.604125] change   
/devices/platform/ehci-omap.0/usb1/1-2/1-2.1/1-2.1:1.0/0003:04F2:0402.0001 (hid)
KERNEL[1305015564.604736] change   
/devices/platform/ehci-omap.0/usb1/1-2/1-2.1/1-2.1:1.0/input/input2 (input)
KERNEL[1305015564.605163] change   
/devices/platform/ehci-omap.0/usb1/1-2/1-2.1/1-2.1:1.0/input/input2/event2 
(input)
KERNEL[1305015564.606628] change   
/devices/platform/ehci-omap.0/usb1/1-2/1-2.1/1-2.1:1.1 (usb)
KERNEL[1305015564.607177] change   
/devices/platform/ehci-omap.0/usb1/1-2/1-2.1/1-2.1:1.1/0003:04F2:0402.0002 (hid)
KERNEL[1305015564.608245] change   
/devices/platform/ehci-omap.0/usb1/1-2/1-2.1/1-2.1:1.1/input/input3 (input)
UDEV  [1305015564.609832] change   /devices/omapdss/display0 (omapdss)
KERNEL[1305015564.610351] change   
/devices/platform/ehci-omap.0/usb1/1-2/1-2.1/1-2.1:1.1/input/input3/event3 
(input)
KERNEL[1305015564.610778] change   
/devices/platform/ehci-omap.0/usb1/1-2/1-2.1/usb_device/usbdev1.3 (usb_device)
KERNEL[1305015564.612091] change   /devices/platform/ehci-omap.0/usb1/1-2/1-2.2 
(usb)
KERNEL[1305015564.614013] change   
/devices/platform/ehci-omap.0/usb1/1-2/1-2.2/1-2.2:1.0 (usb)
UDEV  [1305015564.614166] change   /devices/omapdss/display1 (omapdss)
KERNEL[1305015564.614654] change   
/devices/platform/ehci-omap.0/usb1/1-2/1-2.2/1-2.2:1.0/0003:046D:C00E.0003 (hid)
KERNEL[1305015564.615661] change   
/devices/platform/ehci-omap.0/usb1/1-2/1-2.2/1-2.2:1.0/input/input4 (input)
KERNEL[1305015564.616729] change   
/devices/platform/ehci-omap.0/usb1/1-2/1-2.2/1-2.2:1.0/input/input4/event4 
(input)
KERNEL[1305015564.619232] change   
/devices/platform/ehci-omap.0/usb1/1-2/1-2.2/1-2.2:1.0/input/input4/mouse0 
(input)
KERNEL[1305015564.619781] change   
/devices/platform/ehci-omap.0/usb1/1-2/1-2.2/usb_device/usbdev1.4 (usb_device)
KERNEL[1305015564.620269] change   /devices/platform/ehci-omap.0/usb1/1-2/1-2.4 
(usb)
KERNEL[1305015564.620727] change   
/devices/platform/ehci-omap.0/usb1/1-2/1-2.4/1-2.4:1.0 (usb)
KERNEL[1305015564.621978] change   
/devices/platform/ehci-omap.0/usb1/1-2/1-2.4/usb_device/usbdev1.5 (usb_device)
KERNEL[1305015564.623962] change   
/devices/platform/ehci-omap.0/usb1/1-2/1-2:1.0 (usb)
KERNEL[1305015564.624450] change   
/devices/platform/ehci-omap.0/usb1/1-2/usb_device/usbdev1.2 (usb_device)
KERNEL[1305015564.624847] change   

Re: [systemd-devel] device units rely on udev rules?

2011-05-10 Thread Kay Sievers
On Tue, May 10, 2011 at 10:26, Koen Kooi k...@dominion.thruhere.net wrote:
 Op 9 mei 2011, om 22:23 heeft Kay Sievers het volgende geschreven:

 Things like:
  time (udevadm trigger; udevadm settle)

 root@beagleboard-systemd:~# time ( udevadm trigger ; udevadm settle)

 real    3m0.475s

3 Minutes?

 UDEV  [1305015564.609832] change   /devices/omapdss/display0 (omapdss)
...
 UDEV  [1305015572.270141] change   /devices/virtual/block/loop1 (block)

Between the first and last event are 7 seconds. Where are the 3
minutes spent? What do I miss?

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


Re: [systemd-devel] device units rely on udev rules?

2011-05-10 Thread Harald Hoyer

Am 10.05.2011 10:36, schrieb Kay Sievers:

On Tue, May 10, 2011 at 10:26, Koen Kooik...@dominion.thruhere.net  wrote:

Op 9 mei 2011, om 22:23 heeft Kay Sievers het volgende geschreven:



Things like:
  time (udevadm trigger; udevadm settle)


root@beagleboard-systemd:~# time ( udevadm trigger ; udevadm settle)

real3m0.475s


3 Minutes?


UDEV  [1305015564.609832] change   /devices/omapdss/display0 (omapdss)

...

UDEV  [1305015572.270141] change   /devices/virtual/block/loop1 (block)


Between the first and last event are 7 seconds. Where are the 3
minutes spent? What do I miss?

Kay


monitor does not show, when a event has finished/settled
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] device units rely on udev rules?

2011-05-10 Thread Koen Kooi

Op 10 mei 2011, om 10:36 heeft Kay Sievers het volgende geschreven:

 On Tue, May 10, 2011 at 10:26, Koen Kooi k...@dominion.thruhere.net wrote:
 Op 9 mei 2011, om 22:23 heeft Kay Sievers het volgende geschreven:
 
 Things like:
  time (udevadm trigger; udevadm settle)
 
 root@beagleboard-systemd:~# time ( udevadm trigger ; udevadm settle)
 
 real3m0.475s
 
 3 Minutes?

It's 3 minutes exactly (+trigger and shell overhead) every time, so I guess I'm 
hitting some kind of timeout

 
 UDEV  [1305015564.609832] change   /devices/omapdss/display0 (omapdss)
 ...
 UDEV  [1305015572.270141] change   /devices/virtual/block/loop1 (block)
 
 Between the first and last event are 7 seconds. Where are the 3
 minutes spent? What do I miss?
 
 Kay

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


Re: [systemd-devel] device units rely on udev rules?

2011-05-10 Thread Kay Sievers
On Tue, May 10, 2011 at 11:26, Koen Kooi k...@dominion.thruhere.net wrote:

 Op 10 mei 2011, om 10:36 heeft Kay Sievers het volgende geschreven:

 On Tue, May 10, 2011 at 10:26, Koen Kooi k...@dominion.thruhere.net wrote:
 Op 9 mei 2011, om 22:23 heeft Kay Sievers het volgende geschreven:

 Things like:
  time (udevadm trigger; udevadm settle)

 root@beagleboard-systemd:~# time ( udevadm trigger ; udevadm settle)

 real    3m0.475s

 3 Minutes?

 It's 3 minutes exactly (+trigger and shell overhead) every time, so I guess 
 I'm hitting some kind of timeout

It's 180 sec, yeah. Doesn't it print what device it waited for?

If you add: ... settle --timeout=10 does it print something?

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


Re: [systemd-devel] device units rely on udev rules?

2011-05-10 Thread Koen Kooi

Op 10 mei 2011, om 11:55 heeft Kay Sievers het volgende geschreven:

 On Tue, May 10, 2011 at 11:26, Koen Kooi k...@dominion.thruhere.net wrote:
 
 Op 10 mei 2011, om 10:36 heeft Kay Sievers het volgende geschreven:
 
 On Tue, May 10, 2011 at 10:26, Koen Kooi k...@dominion.thruhere.net wrote:
 Op 9 mei 2011, om 22:23 heeft Kay Sievers het volgende geschreven:
 
 Things like:
  time (udevadm trigger; udevadm settle)
 
 root@beagleboard-systemd:~# time ( udevadm trigger ; udevadm settle)
 
 real3m0.475s
 
 3 Minutes?
 
 It's 3 minutes exactly (+trigger and shell overhead) every time, so I guess 
 I'm hitting some kind of timeout
 
 It's 180 sec, yeah. Doesn't it print what device it waited for?

udevadm doesn't

 If you add: ... settle --timeout=10 does it print something?

root@beagleboard-systemd:~# time ( udevadm trigger ; udevadm settle 
--timeout=10)   


real0m10.427s
user0m0.023s
sys 0m0.102s

Changing it to '1' doesn't print anything either. Should udev-monitor print the 
device it's waiting for?

regards,

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


Re: [systemd-devel] device units rely on udev rules?

2011-05-10 Thread Kay Sievers
On Tue, May 10, 2011 at 12:22, Koen Kooi k...@dominion.thruhere.net wrote:

 It's 3 minutes exactly (+trigger and shell overhead) every time, so I guess 
 I'm hitting some kind of timeout

 It's 180 sec, yeah. Doesn't it print what device it waited for?

 udevadm doesn't

 If you add: ... settle --timeout=10 does it print something?

 root@beagleboard-systemd:~# time ( udevadm trigger ; udevadm settle 
 --timeout=10)

 real    0m10.427s
 user    0m0.023s
 sys     0m0.102s

 Changing it to '1' doesn't print anything either. Should udev-monitor print 
 the device it's waiting for?

Hmm, settle should print it like (I added sleep 15 to /dev/null):

  time (udevadm trigger; udevadm settle --timeout=10)

  udevadm settle - timeout of 10 seconds reached, the event queue contains:
/sys/devices/virtual/mem/null (5709)

  real  0m10.131s

What udev version is that? I'm running current -git, maybe something
was broken, don't know it though.

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


Re: [systemd-devel] device units rely on udev rules?

2011-05-10 Thread Harald Hoyer

Am 10.05.2011 14:09, schrieb Lennart Poettering:

On Tue, 10.05.11 13:47, Koen Kooi (k...@dominion.thruhere.net) wrote:


What udev version is that? I'm running current -git, maybe something
was broken, don't know it though.


[  122.891967]27udevd[88]: unable to receive ctrl connection: Function not 
implemented

Time to rebuild eglibc I guess.


Hmm, does your kernel lack AF_UNIX/SOCK_SEQPACKET support?

Lennart



Might be time, for a .config list of required features :-)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] device units rely on udev rules?

2011-05-10 Thread Lennart Poettering
On Tue, 10.05.11 14:11, Harald Hoyer (harald.ho...@gmail.com) wrote:

 
 Am 10.05.2011 14:09, schrieb Lennart Poettering:
 On Tue, 10.05.11 13:47, Koen Kooi (k...@dominion.thruhere.net) wrote:
 
 What udev version is that? I'm running current -git, maybe something
 was broken, don't know it though.
 
 [  122.891967]27udevd[88]: unable to receive ctrl connection: Function 
 not implemented
 
 Time to rebuild eglibc I guess.
 
 Hmm, does your kernel lack AF_UNIX/SOCK_SEQPACKET support?
 
 Lennart
 
 
 Might be time, for a .config list of required features :-)

Neither accept4 nor AF_UNIX/SOCK_SEQPACKET are optional kernel
features. However, they are relatively new kernel features and some
archs had trouble keeping up in enabling them even though the code
exists in the kernel.

Currently our README mentions that we need kernel = 2.6.30. It might
make sense to include another line mentioning that on ARM/MIPS/others
you need an even newer one.

Lennart

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


Re: [systemd-devel] device units rely on udev rules?

2011-05-10 Thread Koen Kooi

Op 10 mei 2011, om 14:14 heeft Lennart Poettering het volgende geschreven:

 On Tue, 10.05.11 14:11, Harald Hoyer (harald.ho...@gmail.com) wrote:
 
 
 Am 10.05.2011 14:09, schrieb Lennart Poettering:
 On Tue, 10.05.11 13:47, Koen Kooi (k...@dominion.thruhere.net) wrote:
 
 What udev version is that? I'm running current -git, maybe something
 was broken, don't know it though.
 
 [  122.891967]27udevd[88]: unable to receive ctrl connection: Function 
 not implemented
 
 Time to rebuild eglibc I guess.
 
 Hmm, does your kernel lack AF_UNIX/SOCK_SEQPACKET support?
 
 Lennart
 
 
 Might be time, for a .config list of required features :-)
 
 Neither accept4 nor AF_UNIX/SOCK_SEQPACKET are optional kernel
 features. However, they are relatively new kernel features and some
 archs had trouble keeping up in enabling them even though the code
 exists in the kernel.
 
 Currently our README mentions that we need kernel = 2.6.30. It might
 make sense to include another line mentioning that on ARM/MIPS/others
 you need an even newer one.

Udev has this: 
http://git.kernel.org/?p=linux/hotplug/udev.git;a=patch;h=67a77c8bf299f6264f001677becd056316ebce2f

I backported that kernel patch to 2.6.32 since I can test that, but the systemd 
tests were all run with 2.6.37. The problem is that eglibc was built against 
yet another different version of headers, which lacked the syscall for arm.

regards,

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


Re: [systemd-devel] Parallel startup with sockets and without killing the machine?

2011-05-10 Thread Lennart Poettering
On Mon, 09.05.11 19:52, Scott James Remnant (sc...@netsplit.com) wrote:

 On Mon, May 9, 2011 at 12:16 PM, Gustavo Sverzut Barbieri 
 barbi...@profusion.mobi wrote:
 
 
  Well, right now let's make clear that Firefox/Chromium or other X clients
  won't be started by systemd as they are user session applications, and
  systemd itself will just deal with system context (ie: up to GDM/KDM...).
 
 
  Really?
 
 A major feature of systemd I understood was that it would also manage user
 sessions as a seamless part of boot along with the system session. Is that
 not the case?

Right now you can run systemd as the user, and it will startup and work
fine. Which is very handy for debugging purposes. However, we have not
integrated that with D-Bus or GNOME or anything yet. This is something
we want to do for F16:

http://lwn.net/Articles/441328/

Lennart

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


[systemd-devel] how make reload=restart

2011-05-10 Thread Alexey Shabalin
Hello!

Our logrotate after finish run script syslog-reload (detect syslog
daemon - sysklogd or syslog-ng or rsyslog, and run service foo reload)
But some services do not support reload, for example rsyslog.
In init.d/rsyslog i can add reload=restart
Very necessary add option to foo.service like
Reload=Restart
or
ExecReload=Restart

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


Re: [systemd-devel] Parallel startup with sockets and without killing the machine?

2011-05-10 Thread Scott James Remnant
On Tue, May 10, 2011 at 7:41 AM, Gustavo Sverzut Barbieri 
barbi...@profusion.mobi wrote:

 I'm not following all the user-session discussion, but AFAIU this
 management will be done by the same code, but not same process (it's not
 PID1). PAM (or another entity that has a role in the login/logout) will talk
 to systemd (PID1) and ask for a new service to be started to handle this
 user-session. This will still be the same code, but of course on the user
 context and not handle things like actual reboot/halt of the machine,
 mounting system filesystems. But again, I'm not following it closely and I
 might be wrong here.

 That's a shame. Having it as a separate process would mean the user session
would be started all at once in one go at the end of the boot, rather than
with the rest of the boot :-(

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


Re: [systemd-devel] how make reload=restart

2011-05-10 Thread Jóhann B. Guðmundsson

On 05/10/2011 04:03 PM, Alexey Shabalin wrote:

Hello!

Our logrotate after finish run script syslog-reload (detect syslog
daemon - sysklogd or syslog-ng or rsyslog, and run service foo reload)
But some services do not support reload, for example rsyslog.
In init.d/rsyslog i can add reload=restart
Very necessary add option to foo.service like
Reload=Restart
or
ExecReload=Restart



Why dont you just tell your script to restart rsyslog instead of 
reloading it?


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


Re: [systemd-devel] Parallel startup with sockets and without killing the machine?

2011-05-10 Thread Lennart Poettering
On Tue, 10.05.11 09:25, Scott James Remnant (sc...@netsplit.com) wrote:

 On Tue, May 10, 2011 at 7:41 AM, Gustavo Sverzut Barbieri 
 barbi...@profusion.mobi wrote:
 
  I'm not following all the user-session discussion, but AFAIU this
  management will be done by the same code, but not same process (it's not
  PID1). PAM (or another entity that has a role in the login/logout) will talk
  to systemd (PID1) and ask for a new service to be started to handle this
  user-session. This will still be the same code, but of course on the user
  context and not handle things like actual reboot/halt of the machine,
  mounting system filesystems. But again, I'm not following it closely and I
  might be wrong here.
 
 That's a shame. Having it as a separate process would mean the user session
 would be started all at once in one go at the end of the boot, rather than
 with the rest of the boot :-(

We have considered doing all of this in the same process, however
ultimiately stepped away from it for security reasons. Adopting a
PID1-for-everything scheme also means that you need to add a fairly
complex authorization and credentials system to systemd, because you
need to validate every single bus call and other operation and map it to
a specific user context.

Since the kernel and D-Bus are fairly good at doing access control and
privilege separation between users we hence decided to make the best of
it in systemd and went for the one-systemd-for-each-user scheme.

Note that you need to delay execution of user code after the base system
is set up anyway, in order to ensure that the right perms are set on the
volatile and other directories. That means having a single transaction
for both user and system services effectively wins you very little.

Lennart

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


Re: [systemd-devel] how make reload=restart

2011-05-10 Thread Lennart Poettering
On Tue, 10.05.11 20:03, Alexey Shabalin (a.shaba...@gmail.com) wrote:

 Hello!
 
 Our logrotate after finish run script syslog-reload (detect syslog
 daemon - sysklogd or syslog-ng or rsyslog, and run service foo reload)
 But some services do not support reload, for example rsyslog.
 In init.d/rsyslog i can add reload=restart
 Very necessary add option to foo.service like
 Reload=Restart
 or
 ExecReload=Restart

reloading implies that a service stays available all the
time. restarting usually means there's a window where the service is not
available. We do not want to blur this difference in systemd, hence we
do not turn reload requests into restart requests automatically.

If you want an automatic fallback to restarting if reloading is not
available for a service please use systemctl reload-or-restart ...
which will to exactly that for you.

Lennart

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


Re: [systemd-devel] how make reload=restart

2011-05-10 Thread Alexey Shabalin
2011/5/10 Jóhann B. Guðmundsson johan...@gmail.com:
 On 05/10/2011 04:03 PM, Alexey Shabalin wrote:

 Hello!

 Our logrotate after finish run script syslog-reload (detect syslog
 daemon - sysklogd or syslog-ng or rsyslog, and run service foo reload)
 But some services do not support reload, for example rsyslog.
 In init.d/rsyslog i can add reload=restart
 Very necessary add option to foo.service like
 Reload=Restart
 or
 ExecReload=Restart


Our logrotate script is universal. He support sysklogd, syslog-ng and rsyslog.
For sysklogd and syslog-ng (and old rsyslog) was enough send -HUP
signal after logrotate.

in man rsyslog-v5:
HUPing  rsyslogd is an extremely expensive operation and should only
be done when
actually necessary. Actually, it is a rsyslgod stop immediately
followed by a restart. Future ver‐
sions  will  remove this restart functionality of HUP (it will go away
in v5). So it is advised to
use HUP only for closing files, and a real restart (e.g.
/etc/rc.d/rsyslogd restart) to activate
configuration changes.


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


Re: [systemd-devel] [PATCH 1/2] create dbussystemservicedir

2011-05-10 Thread Lennart Poettering
On Wed, 04.05.11 11:01, Michael Olbrich (m.olbr...@pengutronix.de) wrote:

 otherwise building fails if it doesn't exist:
 
 ( cd DESTDIR/usr/share/dbus-1/services  \
 rm -f org.freedesktop.systemd1.service  \
 ln -s ../system-services/org.freedesktop.systemd1.service 
 org.freedesktop.systemd1.service )
 /bin/sh: line 0: cd: DESTDIR/usr/share/dbus-1/services: No such file or 
 directory

Thanks! Applied.

Lennart

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


Re: [systemd-devel] how make reload=restart

2011-05-10 Thread Alexey Shabalin
2011/5/10 Lennart Poettering lenn...@poettering.net:
 On Tue, 10.05.11 20:03, Alexey Shabalin (a.shaba...@gmail.com) wrote:

 Hello!

 Our logrotate after finish run script syslog-reload (detect syslog
 daemon - sysklogd or syslog-ng or rsyslog, and run service foo reload)
 But some services do not support reload, for example rsyslog.
 In init.d/rsyslog i can add reload=restart
 Very necessary add option to foo.service like
 Reload=Restart
 or
 ExecReload=Restart

 reloading implies that a service stays available all the
 time. restarting usually means there's a window where the service is not
 available. We do not want to blur this difference in systemd, hence we
 do not turn reload requests into restart requests automatically.

 If you want an automatic fallback to restarting if reloading is not
 available for a service please use systemctl reload-or-restart ...
 which will to exactly that for you.

Can i use in rsyslog.service?
ExecReload=/bin/systemctl restart rsyslog.service

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


Re: [systemd-devel] [PATCH 2/2] user-sessions: don't report errors unless /{etc, run}/nologin exists and cannot be removed

2011-05-10 Thread Lennart Poettering
On Wed, 04.05.11 11:01, Michael Olbrich (m.olbr...@pengutronix.de) wrote:

 on a read-only file-system 'unlink' returns EROFS (Read-only file
 system) even if the file does not exists. To avoid false errors,
 check if the file exists first.

I now commited a different fix for this. Please test!

 -if (unlink(/run/nologin)  0  errno != ENOENT) {
 +if (stat(/run/nologin, buffer) == 0  
 unlink(/run/nologin)  0  errno != ENOENT) {
  log_error(Failed to remove /run/nologin file: %m);
  r = -errno;
  }

/run/nologin *must* be writable, hence this check is not really applicable.

 -if (unlink(/etc/nologin)  0  errno != ENOENT) {
 +if (stat(/etc/nologin, buffer) == 0  
 unlink(/etc/nologin)  0  errno != ENOENT) {
  log_error(Failed to remove /etc/nologin file: %m);
  q = -errno;
  }

access(F_OK) is usually nicer than stat() for this purpose. Also, I
think we should do unlink() first, and suppress the error message for
EROFS only if the file really doesn't exist. The patch I commited now
does that.

Lennart

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


Re: [systemd-devel] how make reload=restart

2011-05-10 Thread Lennart Poettering
On Tue, 10.05.11 20:50, Alexey Shabalin (a.shaba...@gmail.com) wrote:

 
 2011/5/10 Lennart Poettering lenn...@poettering.net:
  On Tue, 10.05.11 20:03, Alexey Shabalin (a.shaba...@gmail.com) wrote:
 
  Hello!
 
  Our logrotate after finish run script syslog-reload (detect syslog
  daemon - sysklogd or syslog-ng or rsyslog, and run service foo reload)
  But some services do not support reload, for example rsyslog.
  In init.d/rsyslog i can add reload=restart
  Very necessary add option to foo.service like
  Reload=Restart
  or
  ExecReload=Restart
 
  reloading implies that a service stays available all the
  time. restarting usually means there's a window where the service is not
  available. We do not want to blur this difference in systemd, hence we
  do not turn reload requests into restart requests automatically.
 
  If you want an automatic fallback to restarting if reloading is not
  available for a service please use systemctl reload-or-restart ...
  which will to exactly that for you.
 
 Can i use in rsyslog.service?
 ExecReload=/bin/systemctl restart rsyslog.service

No. This will neither work, nor do I like the idea. Services should
behave reliable. I think it is a bad idea blurring the lines between
reload and restart. We shouldn't do this neither globally, nor for
specific services.

Instead, just use systemctl reload-or-restart ... in your client code
and things will work fine. We added reload-or-restart precisely for
use cases like this, so, go, use it!

Lennart

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


Re: [systemd-devel] device units rely on udev rules?

2011-05-10 Thread Kay Sievers
On Tue, May 10, 2011 at 17:34, Koen Kooi k...@dominion.thruhere.net wrote:

 So after rebuilding eglibc against 2.6.37 headers and udev from git:

 root@beagleboard-systemd:~# time ( udevadm trigger ; udevadm settle )

 real    0m10.475s

Ok, at least the timeout issue seems gone.

How many device do you have?
  find /sys -name uevent | wc -l

How many devices have a modalias:
  find /sys -name modalias | wc -l

 And the matching systemd-analyze plot: 
 http://dominion.thruhere.net/koen/angstrom/systemd/git-with-accept4.svg

What does:
  time udevadm test /sys/class/tty/ttyO0
show?

If you run it only for certain subsystems, what does it give you:
  time ( udevadm trigger -s block; udevadm settle )
  time ( udevadm trigger -s tty; udevadm settle )

 I'll do some more digging after linuxtag.

I'll be around Fri+Sat. Maybe we'll walk into each other ...

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


Re: [systemd-devel] [PATCH] {locale, vconsole}-setup.c: unconditionally read config file settings

2011-05-10 Thread Lennart Poettering
On Wed, 04.05.11 10:28, Harald Hoyer (har...@redhat.com) wrote:

 
 Am 03.05.2011 18:02, schrieb Lennart Poettering:
  On Tue, 03.05.11 16:39, har...@redhat.com (har...@redhat.com) wrote:
  
  From: Harald Hoyer har...@redhat.com
 
  systemd-vconsole-setup did not process any configuration files, if it
  found at least one parameter on the kernel command line.
 
  First we should read all config file parameter settings and let them
  be overwritten by kernel command line parameters afterwards.
  
  Hmm, we actually did things like this on purpose, in order to avoid
  mixed configurations. i.e. if you set LANG=de_DE on the kernel
  command line you would probably be very much annoyed if LC_MESSAGES=C
  which you set in the config file would still hold.
  
  Hence we decided to either take the set of config options altogther or
  none at all, but not try to merge them.
  
  Does that make sense to you?
 
 No it does not. If I set a different keymap, I want the font to be the same as
 before.

Hmm, it makes sense to make keymap and font independently settable, that
is true.

I'd be happy to take a patch for that, and also added this to the TODO
list.

Basically, the scheme should reset KEYMAP_TOGGLE= when KEYMAP is
overriden, and FONT_MAP=, FONT_UNITMAP= if FONT= is overriden.


Lennart

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


Re: [systemd-devel] how make reload=restart

2011-05-10 Thread Lennart Poettering
On Tue, 10.05.11 21:18, Alexey Shabalin (a.shaba...@gmail.com) wrote:

 
  Instead, just use systemctl reload-or-restart ... in your client code
  and things will work fine. We added reload-or-restart precisely for
  use cases like this, so, go, use it!

 Sorry, but we must provide good support systemd and SysV in our discributive.
 Our service knows nothing about reload-or-restart :(

Then add it into your /bin/service compat glue, not in the services themselves.

Lennart

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


Re: [systemd-devel] device units rely on udev rules?

2011-05-10 Thread Koen Kooi

Op 10 mei 2011, om 19:01 heeft Kay Sievers het volgende geschreven:

 On Tue, May 10, 2011 at 17:34, Koen Kooi k...@dominion.thruhere.net wrote:
 
 So after rebuilding eglibc against 2.6.37 headers and udev from git:
 
 root@beagleboard-systemd:~# time ( udevadm trigger ; udevadm settle )
 
 real0m10.475s
 
 Ok, at least the timeout issue seems gone.
 
 How many device do you have?
  find /sys -name uevent | wc -l

root@beagleboard-systemd:/usr/bin#  find /sys -name uevent | wc -l
462

 How many devices have a modalias:
  find /sys -name modalias | wc -l

root@beagleboard-systemd:/usr/bin# find /sys -name modalias | wc -l
84



 And the matching systemd-analyze plot: 
 http://dominion.thruhere.net/koen/angstrom/systemd/git-with-accept4.svg
 
 What does:
  time udevadm test /sys/class/tty/ttyO0
 show?

root@beagleboard-systemd:/usr/bin# time udevadm test /sys/class/tty/ttyO0
run_command: calling: test
udevadm_test: version 168
This program is for debugging only, it does not run any program,
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.

parse_file: reading '/lib/udev/rules.d/42-qemu-usb.rules' as rules file
parse_file: reading '/lib/udev/rules.d/50-firmware.rules' as rules file
parse_file: reading '/etc/udev/rules.d/50-udev-default.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-cdrom_id.rules' as rules file
parse_file: reading '/lib/udev/rules.d/60-floppy.rules' as rules file
parse_file: reading '/etc/udev/rules.d/60-persistent-alsa.rules' as rules file
parse_file: reading '/etc/udev/rules.d/60-persistent-input.rules' as rules file
parse_file: reading '/etc/udev/rules.d/60-persistent-serial.rules' as rules file
parse_file: reading '/etc/udev/rules.d/60-persistent-storage-tape.rules' as 
rules file
parse_file: reading '/etc/udev/rules.d/60-persistent-storage.rules' as rules 
file
parse_file: reading '/lib/udev/rules.d/60-persistent-v4l.rules' as rules file
parse_file: reading '/lib/udev/rules.d/61-mobile-action.rules' as rules file
parse_file: reading '/lib/udev/rules.d/61-persistent-storage-edd.rules' as 
rules file
parse_file: reading '/lib/udev/rules.d/70-acl.rules' as rules file
parse_file: reading '/lib/udev/rules.d/70-hid2hci.rules' as rules file
parse_file: reading '/lib/udev/rules.d/75-cd-aliases-generator.rules' as rules 
file
parse_file: reading '/etc/udev/rules.d/75-net-description.rules' as rules file
parse_file: reading '/lib/udev/rules.d/75-persistent-net-generator.rules' as 
rules file
parse_file: reading '/lib/udev/rules.d/75-probe_mtd.rules' as rules file
parse_file: reading '/etc/udev/rules.d/75-tty-description.rules' as rules file
parse_file: reading '/etc/udev/rules.d/78-sound-card.rules' as rules file
parse_file: reading '/etc/udev/rules.d/80-drivers.rules' as rules file
parse_file: reading '/lib/udev/rules.d/95-keyboard-force-release.rules' as 
rules file
parse_file: reading '/lib/udev/rules.d/95-keymap.rules' as rules file
parse_file: reading '/etc/udev/rules.d/95-udev-late.rules' as rules file
parse_file: reading '/lib/udev/rules.d/97-bluetooth-hid2hci.rules' as rules file
parse_file: reading '/lib/udev/rules.d/97-bluetooth.rules' as rules file
parse_file: reading '/lib/udev/rules.d/99-systemd.rules' as rules file
parse_file: reading '/etc/udev/rules.d/local.rules' as rules file
parse_file: reading '/etc/udev/rules.d/permissions.rules' as rules file
parse_file: reading '/etc/udev/rules.d/run.rules' as rules file
parse_file: reading '/etc/udev/rules.d/udev.rules' as rules file
udev_rules_new: rules use 27348 bytes tokens (2279 * 12 bytes), 15978 bytes 
buffer
udev_rules_new: temporary index used 16860 bytes (843 * 20 bytes)
udev_device_new_from_syspath: device 0x1fd50d0 has devpath 
'/devices/platform/omap/omap_uart.0/tty/ttyO0'
udev_device_new_from_syspath: device 0x1fe48e0 has devpath 
'/devices/platform/omap/omap_uart.0/tty/ttyO0'
udev_device_read_db: device 0x1fe48e0 filled with db file data
udev_rules_apply_to_event: GROUP 20 /etc/udev/rules.d/50-udev-default.rules:11
udev_device_new_from_syspath: device 0x1fdf078 has devpath 
'/devices/platform/omap/omap_uart.0'
udev_device_new_from_syspath: device 0x1fdf2b8 has devpath 
'/devices/platform/omap'
udev_device_new_from_syspath: device 0x1fdf438 has devpath '/devices/platform'
udev_rules_apply_to_event: GROUP 20 /etc/udev/rules.d/permissions.rules:43
udev_rules_apply_to_event: RUN 'socket:/org/kernel/udev/monitor' 
/etc/udev/rules.d/run.rules:2
udev_event_execute_rules: no node name set, will use kernel supplied name 
'ttyO0'
udev_node_add: creating device node '/dev/ttyO0', devnum=252:0, mode=0660, 
uid=0, gid=20
udev_node_mknod: preserve file '/dev/ttyO0', because it has correct dev_t
udev_node_mknod: preserve permissions /dev/ttyO0, 020660, uid=0, gid=20
node_symlink: preserve already existing symlink '/dev/char/252:0' to '../ttyO0'
udev_device_update_db: created db file '/run/udev/data/c252:0' for 

Re: [systemd-devel] device units rely on udev rules?

2011-05-10 Thread Kay Sievers
On Tue, May 10, 2011 at 20:37, Koen Kooi k...@dominion.thruhere.net wrote:

 root@beagleboard-systemd:~# time ( udevadm trigger ; udevadm settle )

 real    0m10.475s

 Ok, at least the timeout issue seems gone.

 How many device do you have?
  find /sys -name uevent | wc -l

 root@beagleboard-systemd:/usr/bin#  find /sys -name uevent | wc -l
 462

 How many devices have a modalias:
  find /sys -name modalias | wc -l

 root@beagleboard-systemd:/usr/bin# find /sys -name modalias | wc -l
 84

That looks all fine.

 parse_file: reading '/etc/udev/rules.d/50-udev-default.rules' as rules file
 parse_file: reading '/etc/udev/rules.d/95-udev-late.rules' as rules file
 parse_file: reading '/etc/udev/rules.d/local.rules' as rules file
 parse_file: reading '/etc/udev/rules.d/permissions.rules' as rules file
 parse_file: reading '/etc/udev/rules.d/run.rules' as rules file
 parse_file: reading '/etc/udev/rules.d/udev.rules' as rules file

What are these files? There is no default udev rules file in /etc.
'late' is years old, and the ones without number prefix look like they
come from something else, and they shouldn't be there.

 real    0m0.065s

 If you run it only for certain subsystems, what does it give you:
  time ( udevadm trigger -s block; udevadm settle )

 That triggers a preempt bug and oopses the kernel.

Great! :)

  time ( udevadm trigger -s tty; udevadm settle )

 root@beagleboard-systemd:~#  time ( udevadm trigger -s tty; udevadm settle )

 real    0m1.203s
 user    0m0.000s
 sys     0m0.031s

That's seems very long compared to the above run for a single tty.

 I'll be around Fri+Sat. Maybe we'll walk into each other ...

 I'll attend the systemd talk :)

Good. See you there.

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


[systemd-devel] minimal-uclibc: systemd fails with `src/manager.c:257:42: error: 'EPOLL_CLOEXEC' undeclared (first use in this function)`

2011-05-10 Thread Paul Menzel
Dear OE folks,


task compile of `systemd_git.bb` fails with the following error message
using `minimal-uclibc` for `MACHINE = beagleboard`. Using `minimal`,
i. e. EGLIBC, works.

[…]
|   CC src/libsystemd_core_la-manager.lo
| src/manager.c: In function 'manager_new':
| src/manager.c:257:9: warning: implicit declaration of function 
'epoll_create1' [-Wimplicit-function-declaration]
| src/manager.c:257:42: error: 'EPOLL_CLOEXEC' undeclared (first use in 
this function)
| src/manager.c:257:42: note: each undeclared identifier is reported 
only once for each function it appears in
| src/manager.c: In function 'manager_process_notify_fd':
| src/manager.c:1956:25: warning: cast increases required alignment of 
target type [-Wcast-align]
[…]

`manager.c` includes

#include sys/epoll.h
#include fcntl.h

which I read should contain that definition. But looking at `fcntl.h` I
could not find it. I then looked in


./minimal-uclibc-dev/sysroots/armv7a-oe-linux-uclibceabi/usr/include/sys/epoll.h

where it is defined for EGLIBC but not for uClibc. I also found the
patch for uClibc [1] but there `EPOLL_CLOEXEC` is enclosed in `#if 0`.

I am no uClibc expert, but do you know if uClibc will provide
`EPOLL_CLOEXEC` in the near future? How should systemd fix that?

Please find attached a patch updating systemd to a newer including a
commit fixing another problem with systemd and uClibc.


Thanks,

Paul


[1] http://lists.uclibc.org/pipermail/uclibc-cvs/2011-March/028879.html
From a135d73cfc7f4c0eb8da344d5bf0d49668ffdbf9 Mon Sep 17 00:00:00 2001
From: Paul Menzel paulepan...@users.sourceforge.net
Date: Tue, 10 May 2011 09:19:02 +0200
Subject: [PATCH] systemd: bump srcrev
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

• better uClibc support [1], but still fails in `src/manager.c`
• Ȧngström support merged upstream [2]

Still needs native docbook-xsl which is not available in OE.

[1] http://cgit.freedesktop.org/systemd/commit/?id=ec2002f84928c0b5921a961cb2b8637563f29daa
[2] http://cgit.freedesktop.org/systemd/commit/?id=1bd8b8184ee3bc7fc023d6d6dfb2ca99fb6612f3

Signed-off-by: Paul Menzel paulepan...@users.sourceforge.net
---
 .../systemd-v26/0003-Angstrom-support.patch|  165 
 recipes/systemd/systemd_git.bb |3 +-
 2 files changed, 1 insertions(+), 167 deletions(-)
 delete mode 100644 recipes/systemd/systemd-v26/0003-Angstrom-support.patch

diff --git a/recipes/systemd/systemd-v26/0003-Angstrom-support.patch b/recipes/systemd/systemd-v26/0003-Angstrom-support.patch
deleted file mode 100644
index c75cee4..000
--- a/recipes/systemd/systemd-v26/0003-Angstrom-support.patch
+++ /dev/null
@@ -1,165 +0,0 @@
-From 0fa5b59c5f484c80453e9d3201b87e4253f8bec3 Mon Sep 17 00:00:00 2001
-From: Koen Kooi k...@dominion.thruhere.net
-Date: Thu, 5 May 2011 17:15:41 +0200
-Subject: [PATCH 3/3] Angstrom support
-
-This commit consists of the initial work to include Angstrom as a ported
-distribution for systemd.
-
-Angstrom tries to follow the debian way as much as possible, but deviates
-where it doesn't make sense for 'embedded'.
-
-Signed-off-by: Koen Kooi k...@dominion.thruhere.net

- Makefile.am|7 +++
- configure.ac   |7 +++
- src/locale-setup.c |2 +-
- src/service.c  |   10 +-
- src/util.c |   12 
- 5 files changed, 32 insertions(+), 6 deletions(-)
-
-diff --git a/Makefile.am b/Makefile.am
-index 49d2ee8..f3f7818 100644
 a/Makefile.am
-+++ b/Makefile.am
-@@ -96,6 +96,12 @@ AM_CPPFLAGS += \
- 	-DKBD_SETFONT=\/bin/setfont\ \
- 	-DDEFAULT_FONT=\LatArCyrHeb-16\
- else
-+if TARGET_ANGSTROM
-+AM_CPPFLAGS += \
-+	-DKBD_LOADKEYS=\/usr/bin/loadkeys\ \
-+	-DKBD_SETFONT=\/usr/bin/setfont\ \
-+	-DDEFAULT_FONT=\LatArCyrHeb-16\
-+else
- AM_CPPFLAGS += \
- 	-DKBD_LOADKEYS=\/bin/loadkeys\ \
- 	-DKBD_SETFONT=\/bin/setfont\ \
-@@ -105,6 +111,7 @@ endif
- endif
- endif
- endif
-+endif
- 
- rootbin_PROGRAMS = \
- 	systemd \
-diff --git a/configure.ac b/configure.ac
-index dcd4b9d..b5b7ac3 100644
 a/configure.ac
-+++ b/configure.ac
-@@ -295,6 +295,7 @@ if test z$with_distro = z; then
- test -f /etc/altlinux-release  with_distro=altlinux
- test -f /etc/mandriva-release  with_distro=mandriva
- test -f /etc/meego-release  with_distro=meego
-+test -f /etc/angstrom-version  with_distro=angstrom
- if test x`lsb_release -is 2/dev/null` = xUbuntu; then
- with_distro=ubuntu
- fi
-@@ -375,6 +376,11 @@ case $with_distro in
- AC_DEFINE(TARGET_MEEGO, [], [Target is MeeGo])
- M4_DISTRO_FLAG=-DTARGET_MEEGO=1
- 		;;
-+angstrom)
-+SYSTEM_SYSVRCND_PATH=/etc
-+AC_DEFINE(TARGET_ANGSTROM, [], [Target is Ångström])
-+   

Re: [systemd-devel] Failed to connect to socket /org/freedesktop/systemd1/private

2011-05-10 Thread Daniel Drake
On 9 May 2011 22:46, Lennart Poettering lenn...@poettering.net wrote:
 You are lacking autofs4 support in the kernel. You should fix this first.

I'm not, autofs4 is present, we're working on figuring out on why
systemd complains at
https://bugs.freedesktop.org/show_bug.cgi?id=36993

 Your udev in your initrd is a different version than on your system. You
 should really fix that too.

Ah, that explains that part. Done.

 /etc/mtab is not a symlink to /proc/mounts. Please fix.

Done.

 Your systemd userspace seems to be out-of-date, and not from the same
 package that installed /bin/systemd. i.e. the abstract namespace socket
 /org/freedesktop/systemd1/private was used in older systemd versions,
 but has since moved to /run/systemd/private. Your userspace still tries
 to access the old socket, but systemd 26 (which you appear to be
 running) uses the new one.

This image is freshly made, starting from an empty disk, from Fedora
rawhide as of yesterday, so there should be no mixing going on.

But I've debugged it a little to see why its using the wrong path:

We are reaching bus_connect() in dbus-common.c.
It first tries to connect to /run/systemd/private, but this fails.
It then falls back on /org/freedesktop/systemd1/private. This fails
too. So it then returns error and it only logs the last error (which
was about /org/freedesktop/systemd1/private)

If I log the error after it tries to connect to /run/systemd/private, I get:
Failed to connect to socket /run/systemd/private: No such file or directory

Indeed, there's nothing at that path, and the only thing in
/run/systemd/ is an empty directory at /run/systemd/ask-password

So I then looked on the systemd side of things, bus_init_private() in
dbus.c does create this socket just fine (via to dbus_server_listen).
So the question is when and why does it disappear? I sprinkled debug
statements throughout the code and determined that the socket
disappears after manager_loop() has iterated around 47 times.

Does this give you any ideas? Any suggestions for next debugging
steps? Is there an easy way to make manager_loop() log exactly what it
does on each iteration?

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


Re: [systemd-devel] minimal-uclibc: systemd fails with `src/manager.c:257:42: error: 'EPOLL_CLOEXEC' undeclared (first use in this function)`

2011-05-10 Thread Paul Menzel
Dear systemd folks,


I am sorry for this message. I first wanted it to send to systemd-devel
but decided to send it to openembedded-devel instead and forgot to
update the address. If you have any insight though it is most welcome.


Thanks,

PAul


signature.asc
Description: This is a digitally signed message part
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] SELINUX: add /sys/fs/selinux mount point to put selinuxfs

2011-05-10 Thread Greg KH

From: Greg Kroah-Hartman gre...@suse.de

In the interest of keeping userspace from having to create new root
filesystems all the time, let's follow the lead of the other in-kernel
filesystems and provide a proper mount point for it in sysfs.

For selinuxfs, this mount point should be in /sys/fs/selinux/

Cc: Stephen Smalley s...@tycho.nsa.gov
Cc: James Morris jmor...@namei.org
Cc: Eric Paris epa...@parisplace.org
Cc: Lennart Poettering mzerq...@0pointer.de
Cc: Daniel J Walsh dwa...@redhat.com
Signed-off-by: Greg Kroah-Hartman gre...@suse.de

---

Resend, due to lack of response.

Note, patch is untested, I don't have any selinux-based machines here,
sorry.


diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index ea39cb7..2381c16 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -1897,6 +1897,7 @@ static struct file_system_type sel_fs_type = {
 };
 
 struct vfsmount *selinuxfs_mount;
+static struct kobject *selinuxfs_kobj;
 
 static int __init init_sel_fs(void)
 {
@@ -1904,9 +1905,16 @@ static int __init init_sel_fs(void)
 
if (!selinux_enabled)
return 0;
+
+   selinux_kobj = kobject_create_and_add(selinux, fs_kobj);
+   if (!selinux_kobj)
+   return -ENOMEM;
+
err = register_filesystem(sel_fs_type);
-   if (err)
+   if (err) {
+   kobject_put(selinux_kobj);
return err;
+   }
 
selinuxfs_mount = kern_mount(sel_fs_type);
if (IS_ERR(selinuxfs_mount)) {
@@ -1923,6 +1931,7 @@ __initcall(init_sel_fs);
 #ifdef CONFIG_SECURITY_SELINUX_DISABLE
 void exit_sel_fs(void)
 {
+   kobjext_put(selinux_kobj);
unregister_filesystem(sel_fs_type);
 }
 #endif
___
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] SELINUX: add /sys/fs/selinux mount point to put selinuxfs

2011-05-10 Thread Casey Schaufler
On 5/10/2011 3:34 PM, Greg KH wrote:
 From: Greg Kroah-Hartman gre...@suse.de

 In the interest of keeping userspace from having to create new root
 filesystems all the time, let's follow the lead of the other in-kernel
 filesystems and provide a proper mount point for it in sysfs.

 For selinuxfs, this mount point should be in /sys/fs/selinux/

It seems that we might want this to be an LSM interface standard.
Is the call to kobject_create_and_add and associated cleanup all
that's required? I would want Smack to follow the convention as
well.


 Cc: Stephen Smalley s...@tycho.nsa.gov
 Cc: James Morris jmor...@namei.org
 Cc: Eric Paris epa...@parisplace.org
 Cc: Lennart Poettering mzerq...@0pointer.de
 Cc: Daniel J Walsh dwa...@redhat.com
 Signed-off-by: Greg Kroah-Hartman gre...@suse.de

 ---

 Resend, due to lack of response.

 Note, patch is untested, I don't have any selinux-based machines here,
 sorry.


 diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
 index ea39cb7..2381c16 100644
 --- a/security/selinux/selinuxfs.c
 +++ b/security/selinux/selinuxfs.c
 @@ -1897,6 +1897,7 @@ static struct file_system_type sel_fs_type = {
  };
  
  struct vfsmount *selinuxfs_mount;
 +static struct kobject *selinuxfs_kobj;
  
  static int __init init_sel_fs(void)
  {
 @@ -1904,9 +1905,16 @@ static int __init init_sel_fs(void)
  
   if (!selinux_enabled)
   return 0;
 +
 + selinux_kobj = kobject_create_and_add(selinux, fs_kobj);
 + if (!selinux_kobj)
 + return -ENOMEM;
 +
   err = register_filesystem(sel_fs_type);
 - if (err)
 + if (err) {
 + kobject_put(selinux_kobj);
   return err;
 + }
  
   selinuxfs_mount = kern_mount(sel_fs_type);
   if (IS_ERR(selinuxfs_mount)) {
 @@ -1923,6 +1931,7 @@ __initcall(init_sel_fs);
  #ifdef CONFIG_SECURITY_SELINUX_DISABLE
  void exit_sel_fs(void)
  {
 + kobjext_put(selinux_kobj);
   unregister_filesystem(sel_fs_type);
  }
  #endif
 ___
 systemd-devel mailing list
 systemd-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel
 --
 To unsubscribe from this list: send the line unsubscribe 
 linux-security-module in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html



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


Re: [systemd-devel] minimal-uclibc: systemd fails with `src/manager.c:257:42: error: 'EPOLL_CLOEXEC' undeclared (first use in this function)`

2011-05-10 Thread Thierry Reding
* Paul Menzel wrote:
 Dear OE folks,
 
 
 task compile of `systemd_git.bb` fails with the following error message
 using `minimal-uclibc` for `MACHINE = beagleboard`. Using `minimal`,
 i. e. EGLIBC, works.
 
 […]
 |   CC src/libsystemd_core_la-manager.lo
 | src/manager.c: In function 'manager_new':
 | src/manager.c:257:9: warning: implicit declaration of function 
 'epoll_create1' [-Wimplicit-function-declaration]
 | src/manager.c:257:42: error: 'EPOLL_CLOEXEC' undeclared (first use 
 in this function)
 | src/manager.c:257:42: note: each undeclared identifier is reported 
 only once for each function it appears in
 | src/manager.c: In function 'manager_process_notify_fd':
 | src/manager.c:1956:25: warning: cast increases required alignment 
 of target type [-Wcast-align]
 […]
 
 `manager.c` includes
 
 #include sys/epoll.h
 #include fcntl.h
 
 which I read should contain that definition. But looking at `fcntl.h` I
 could not find it. I then looked in
 
 
 ./minimal-uclibc-dev/sysroots/armv7a-oe-linux-uclibceabi/usr/include/sys/epoll.h
 
 where it is defined for EGLIBC but not for uClibc. I also found the
 patch for uClibc [1] but there `EPOLL_CLOEXEC` is enclosed in `#if 0`.
 
 I am no uClibc expert, but do you know if uClibc will provide
 `EPOLL_CLOEXEC` in the near future? How should systemd fix that?

uClibc is also missing an implementation of the epoll_create1() syscall. I'm
using a patch against uClibc to fix a similar issue in udev but haven't
gotten around to sending it upstream yet.

Thierry


pgpHEt4PQnZBY.pgp
Description: PGP signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel