Re: [systemd-devel] systemd-logind bug in systemd v35

2011-10-05 Thread Albert Strasheim
Hello

On Wed, Oct 5, 2011 at 1:40 AM, Lennart Poettering
lenn...@poettering.net wrote:
 On Tue, 04.10.11 15:40, Albert Strasheim (full...@gmail.com) wrote:
 Hello all
 I think we've found a bug in systemd-logind with systemd v35
 (specifically, systemd-35-1.fc16.x86_64.rpm).
 After a few thousand ssh logins, we start seeing stuff like this in
 /var/log/secure:
 After a few thousand parallel ssh logins or one after the other?
 This really looks as if we are leaking file descriptors in some way.

 What's the contents of /proc/$(pidof systemd-logind)/fd/ if this
 happens?

There's 1023 entries in that directory.

 What is the contents of /run/systemd/sessions/?

There's about 2000 files in that directory. Filenames with numbers and
the same number.ref.

This is even when no-one is logged into the system.

Regards

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


Re: [systemd-devel] systemd-logind bug in systemd v35

2011-10-05 Thread Albert Strasheim
Hello

On Wed, Oct 5, 2011 at 1:40 AM, Lennart Poettering
lenn...@poettering.net wrote:
 On Tue, 04.10.11 15:40, Albert Strasheim (full...@gmail.com) wrote:
 Hello all
 I think we've found a bug in systemd-logind with systemd v35
 (specifically, systemd-35-1.fc16.x86_64.rpm).
 After a few thousand ssh logins, we start seeing stuff like this in
 /var/log/secure:
 After a few thousand parallel ssh logins or one after the other?

Forgot to answer this one: this is only with a few parallel logins,
but many logins over a period of hours.

Which raises the question: what is systemd-logind going to do when
more than 1024 users log in to a machine at the same time?

Which raises the more general question: what will other services like
systemd-stdout-syslog-bridge do when the number of processes that log
go into the hundreds? I haven't thought about it carefully, but there
seems to be some cases where one could run into the default limit of
1024 open files.

Regards

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


Re: [systemd-devel] [Netatalk-admins] Restart=always and ExecStartPre (netatalk)

2011-10-05 Thread HAT
 well but this is mostly solveable with
 
 /lib/systemd/system/netatalk-afpd.service
 /lib/systemd/system/netatalk-cnid.service
 /lib/systemd/system/netatalk-atalk.service
 
 If using AppleTalk, afpd must wait for starting atalkd.
 If not use AppleTalk afpd must not wait for starting atalkd
 
 Define After=netatalk-cnid.service netatalk-atalk.service
 for netatalk-afpd.service, this is not a hard requirement
 and would provide the right order IF atalk is active

In case of this difinition, afpd is not started if atalkd does not exist.
Is my guess wrong?

 so for most of the things Before= and After= would be enough
 and the configurations should be done via EnvironmentFile and
 /etc/systemconfig-Files for settings this variables

EnvironmentFile does not appear in systemd.service(5).
What is /etc/systemconfig-Files?
What document should I read?

 so we would cleanup/simplify the whole thing and add the ability
 to restart daemons automatically via systemd if they are crashing
 and of course if i have a machine withe the only purpose provide
 fileservices via netatalk/samba and one of the processes are
 crashing for whatever reason they should be restarted before the
 users are calling me :-)

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


Re: [systemd-devel] [Netatalk-admins] Restart=always and ExecStartPre (netatalk)

2011-10-05 Thread Reindl Harald


Am 05.10.2011 12:13, schrieb HAT:
 well but this is mostly solveable with

 /lib/systemd/system/netatalk-afpd.service
 /lib/systemd/system/netatalk-cnid.service
 /lib/systemd/system/netatalk-atalk.service

 If using AppleTalk, afpd must wait for starting atalkd.
 If not use AppleTalk afpd must not wait for starting atalkd

 Define After=netatalk-cnid.service netatalk-atalk.service
 for netatalk-afpd.service, this is not a hard requirement
 and would provide the right order IF atalk is active
 
 In case of this difinition, afpd is not started if atalkd does not exist.
 Is my guess wrong?

no - it means only IF this service started then netatalk-afpd.service
ist started AFTER them, but even if netatalk-atalk.service does not
exist will not make any troubles, this is only ordering and not
dependencies (Deps would be Requires= and should be used very careful)

http://0pointer.de/public/systemd-man/systemd.unit.html

the cool thing at this is that you can define Before/After in different
services and crontrol their ordering depending on what of them are
active/installed without take care if they are really here but say
IF they are here it does matter that B starts before A

 so for most of the things Before= and After= would be enough
 and the configurations should be done via EnvironmentFile and
 /etc/systemconfig-Files for settings this variables
 
 EnvironmentFile does not appear in systemd.service(5).
 What is /etc/systemconfig-Files?
 What document should I read?

http://0pointer.de/public/systemd-man/systemd.exec.html

take a look at the directory-listing
http://0pointer.de/public/systemd-man/

there are a lot of manuals but the most relevant in my opinion are
http://0pointer.de/public/systemd-man/systemd.unit.html
http://0pointer.de/public/systemd-man/systemd.service.html
http://0pointer.de/public/systemd-man/systemd.exec.html

 so we would cleanup/simplify the whole thing and add the ability
 to restart daemons automatically via systemd if they are crashing
 and of course if i have a machine withe the only purpose provide
 fileservices via netatalk/samba and one of the processes are
 crashing for whatever reason they should be restarted before the
 users are calling me :-)

-- 

Reindl Harald
the lounge interactive design GmbH
A-1060 Vienna, Hofmühlgasse 17
CTO / software-development / cms-solutions
p: +43 (1) 595 3999 33, m: +43 (676) 40 221 40
icq: 154546673, http://www.thelounge.net/

http://www.thelounge.net/signature.asc.what.htm



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] F15: PathExistsGlob

2011-10-05 Thread Michal Schmidt

On 10/04/2011 02:22 PM, Reindl Harald wrote:

would it be possible to backport PathExistsGlob for F15
https://bugzilla.redhat.com/show_bug.cgi?id=734435


Possible, yes. The bug is not relevant for F15 though, because cups is a 
SysV/LSB service there.



this means we can not make a backport-rebuild for F15 without
reverting this patch currently :-(


Curious. What's the reason for backporting cups?

Backporting of packages sometimes requires more effort than a simple 
rebuild. That should not be surprising.


That said, if you prepare a cleanly applicable and tested patch against 
the systemd package in F15 to add the feature you need, I can apply it.


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


Re: [systemd-devel] F15: PathExistsGlob

2011-10-05 Thread Reindl Harald


Am 05.10.2011 14:05, schrieb Michal Schmidt:
 On 10/04/2011 02:22 PM, Reindl Harald wrote:
 would it be possible to backport PathExistsGlob for F15
 https://bugzilla.redhat.com/show_bug.cgi?id=734435
 
 Possible, yes. The bug is not relevant for F15 though, because cups is a 
 SysV/LSB service there.

yes and that is why i hate the F15 release in the form it was released
mixing systemd/sysv/lsb all over the system

 this means we can not make a backport-rebuild for F15 without
 reverting this patch currently :-(
 
 Curious. What's the reason for backporting cups?

get F15 to a state what i expected for the release

 Backporting of packages sometimes requires more effort than a simple rebuild. 
 That should not be surprising.
 That said, if you prepare a cleanly applicable and tested patch against the 
 systemd package in F15 to add the
 feature you need, I can apply it

i am not able to make a patch for systemd, thats the reason for my question
if it would be possible to add this feature in teh F15 version




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] systemd-logind bug in systemd v35

2011-10-05 Thread Lennart Poettering
On Wed, 05.10.11 15:34, Albert Strasheim (full...@gmail.com) wrote:

  That looks as if somehow the sessions are leaked there. Can you do a
  fuser -v on the .ref fifos as root? That should tell us if those fds are
  still referenced.
 
 # fuser -v *.ref
  USERPID ACCESS COMMAND
 1310.ref:root  23311 F systemd-logind
 1368.ref:root  23311 f systemd-logind
 1369.ref:root  23311 f systemd-logind
 1370.ref:root  23311 F systemd-logind
 1371.ref:root  23311 f systemd-logind
 1372.ref:root  23311 f systemd-logind
 1373.ref:root  23311 f systemd-logind
 1374.ref:root  23311 f systemd-logind
 1375.ref:root  23311 f systemd-logind
 1376.ref:root  23311 f systemd-logind
 1377.ref:root  23311 f systemd-logind
 1378.ref:root  23311 f systemd-logind
 1379.ref:root  23311 F systemd-logind
 1380.ref:root  23311 F systemd-logind
 
 etc.

Hmm, that suggests that systemd-logind never received an EOF on those
fds, which is really weird.

Or actually it shows with F that it has those fds open for writing which
should never happen. Weird. I'll try to reproduce this here.

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] systemctl and detach in udev RUN

2011-10-05 Thread Albert Strasheim
Hello all

I have the following udev rule in a machine with a bunch of disks:

SUBSYSTEM==block, KERNEL==sd*, TAG+=systemd, ACTION==add,
RUN+=/bin/systemctl restart blockinit@%k.service

The blockinit service is a one-shot service that runs a program that
checks if the block device matches some criteria (right size, etc.),
formats it (if it doesn't have the right file system yet), fscks it
(always) and mounts it.

I always want this service to restart if a block device is added,
because I want to deal with block devices that are unplugged and
replugged, etc.

Since it always fscks, the systemctl restart of the service takes
about 20-30 seconds to complete.

However, the udev manual page says:

RUN
- Add a program to the list of programs to be executed for a specific device.
- This can only be used for very short running tasks.
- Long running tasks need to be immediately detached from the event
process itself.

Is there a way systemd can help me to do this detaching?

Regards

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


[systemd-devel] [PATCH 2/2] Fix close() call on wrong variable

2011-10-05 Thread Thomas Jarosch
Detected by cppcheck (actually it detected a file descriptor leak)

Please CC: comments.

Signed-off-by: Thomas Jarosch thomas.jaro...@intra2net.com
---
 src/util.c |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/util.c b/src/util.c
index 7977ee4..ae9d9bd 100644
--- a/src/util.c
+++ b/src/util.c
@@ -2308,7 +2308,10 @@ int chvt(int vt) {
 };
 
 if (ioctl(fd, TIOCLINUX, tiocl)  0)
-return -errno;
+{
+r = -errno;
+goto fail;
+}
 
 vt = tiocl[0] = 0 ? 1 : tiocl[0];
 }
@@ -2316,7 +2319,8 @@ int chvt(int vt) {
 if (ioctl(fd, VT_ACTIVATE, vt)  0)
 r = -errno;
 
-close_nointr_nofail(r);
+fail:
+close_nointr_nofail(fd);
 return r;
 }
 
-- 
1.7.4.4

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