Re: [systemd-devel] [PATCH] main: fix error message if PR_SET_CHILD_REAPER is not available

2012-08-21 Thread Lennart Poettering
On Thu, 16.08.12 18:38, Marius Tolzmann (tolzm...@molgen.mpg.de) wrote:

Heya,

 ---
  src/core/main.c |4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/src/core/main.c b/src/core/main.c
 index cdd77c1..8973637 100644
 --- a/src/core/main.c
 +++ b/src/core/main.c
 @@ -1511,8 +1511,8 @@ int main(int argc, char *argv[]) {
  /* Become reaper of our children */
  r = prctl(PR_SET_CHILD_SUBREAPER, 1);
  if (r  0)
 -log_error(Failed to prctl(PR_SET_CHILD_SUBREAPER): 
 %s, strerror(-r));
 -if (r == -EINVAL)
 +log_error(Failed to prctl(PR_SET_CHILD_SUBREAPER): 
 %m);
 +if (r  0  errno == EINVAL)
  log_error(Perhaps the kernel version is too old ( 
 3.4?));
  }

Actually, the error code is returned in errno, not in the retval. I now
commited a fix that corrects this properly.

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] [PATCH] main: fix error message if PR_SET_CHILD_REAPER is not available

2012-08-21 Thread shawn
On Fri, 2012-08-17 at 11:15 +0200, Marius Tolzmann wrote:
 
 But 'git grep PR_SET_CHILD_SUBREAPER' on the 3.3.8 (EOL) branch did
 not
 return any matches for me. So I guess it may be correct to mention
 3.4
 here. Also a 'git br -a --contains ebec18a6' states linux-3.4.y as the
 first branch to contain Lennarts commit. 

oh you are right, my bad. 

v3.3-6165-gebec18a means included in 3.4
-- 
-Shawn Landden

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


Re: [systemd-devel] [PATCH] main: fix error message if PR_SET_CHILD_REAPER is not available

2012-08-21 Thread Lennart Poettering
On Tue, 21.08.12 13:38, shawn (shawnland...@gmail.com) wrote:

 
 On Fri, 2012-08-17 at 11:15 +0200, Marius Tolzmann wrote:
  
  But 'git grep PR_SET_CHILD_SUBREAPER' on the 3.3.8 (EOL) branch did
  not
  return any matches for me. So I guess it may be correct to mention
  3.4
  here. Also a 'git br -a --contains ebec18a6' states linux-3.4.y as the
  first branch to contain Lennarts commit. 
 
 oh you are right, my bad. 
 
 v3.3-6165-gebec18a means included in 3.4

OK, corrected this now.

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] [PATCH] main: fix error message if PR_SET_CHILD_REAPER is not available

2012-08-21 Thread Marius Tolzmann

Hey..

On 21.08.2012 22:38, shawn wrote:

On Fri, 2012-08-17 at 11:15 +0200, Marius Tolzmann wrote:


But 'git grep PR_SET_CHILD_SUBREAPER' on the 3.3.8 (EOL) branch did
not
return any matches for me. So I guess it may be correct to mention
3.4
here. Also a 'git br -a --contains ebec18a6' states linux-3.4.y as the
first branch to contain Lennarts commit.


oh you are right, my bad.

v3.3-6165-gebec18a means included in 3.4


ok.. I really got confused and started to mistrust the way i do check 
this..  (actually git br -a --contains won't show cherry-picked commits 
as far as I know (now)..)


Thanks for checking it again 8)

Best, marius..


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


Re: [systemd-devel] [PATCH] main: fix error message if PR_SET_CHILD_REAPER is not available

2012-08-17 Thread Marius Tolzmann

Hi..

On 08/17/12 02:44, shawn wrote:
 On Thu, 2012-08-16 at 18:38 +0200, Marius Tolzmann wrote: 
 ---
 +if (r  0  errno == EINVAL)
  log_error(Perhaps the kernel version is too old ( 
 3.4?));
 
 PR_SET_CHILD_SUBREAPER made it into 3.3, so this should be say (3.3?)

I actually just changed the error handling logic and did not care much
about the content of error messages.. Because this fixes *my* problem..
8) Thats what I like at open source the most: I fix *my* problems and
(try to) share 8)

But 'git grep PR_SET_CHILD_SUBREAPER' on the 3.3.8 (EOL) branch did not
return any matches for me. So I guess it may be correct to mention 3.4
here. Also a 'git br -a --contains ebec18a6' states linux-3.4.y as the
first branch to contain Lennarts commit.

As mentioned before, it may be reasonable to change those message to
log_warning() since it may still be ok not to reparent all childs to
systemd --user. At least if the error is EINVAL, which seems to be the
only error setting PR_SET_CHILD_SUBREAPER may raise (at the moment).

Or if this is worth a log_error(), changing the requirements section in
the README to reflect that linux kernel = 3.4 is required (for the
systemd --user usecase) may be a good idea.

As far as I understand this feature, it is not just to have a stylish
process-list but to be able to predictable handle dying child processes.

Best, marius..

-- 
Dipl.-Inf. Marius Tolzmann marius.tolzm...@molgen.mpg.de
--.--
MPI f. molekulare Genetik |
Ihnestrasse 63-73, D-14195 Berlin |   == MarIuX GNU/Linux ==
Phone: +49 (0)30 8413 1709|
--^--
God put me on earth to accomplish a certain number of things.
Right now I am so far behind..
   ..I will never die. by calvin from calvinhobbes ;)



smime.p7s
Description: S/MIME Cryptographic Signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] main: fix error message if PR_SET_CHILD_REAPER is not available

2012-08-16 Thread Marius Tolzmann
---
 src/core/main.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/core/main.c b/src/core/main.c
index cdd77c1..8973637 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1511,8 +1511,8 @@ int main(int argc, char *argv[]) {
 /* Become reaper of our children */
 r = prctl(PR_SET_CHILD_SUBREAPER, 1);
 if (r  0)
-log_error(Failed to prctl(PR_SET_CHILD_SUBREAPER): 
%s, strerror(-r));
-if (r == -EINVAL)
+log_error(Failed to prctl(PR_SET_CHILD_SUBREAPER): 
%m);
+if (r  0  errno == EINVAL)
 log_error(Perhaps the kernel version is too old ( 
3.4?));
 }
 
-- 
1.7.5.2

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


Re: [systemd-devel] [PATCH] main: fix error message if PR_SET_CHILD_REAPER is not available

2012-08-16 Thread shawn
On Thu, 2012-08-16 at 18:38 +0200, Marius Tolzmann wrote: 
 ---
  src/core/main.c |4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/src/core/main.c b/src/core/main.c
 index cdd77c1..8973637 100644
 --- a/src/core/main.c
 +++ b/src/core/main.c
 @@ -1511,8 +1511,8 @@ int main(int argc, char *argv[]) {
  /* Become reaper of our children */
  r = prctl(PR_SET_CHILD_SUBREAPER, 1);
  if (r  0)
 -log_error(Failed to prctl(PR_SET_CHILD_SUBREAPER): 
 %s, strerror(-r));
 -if (r == -EINVAL)
 +log_error(Failed to prctl(PR_SET_CHILD_SUBREAPER): 
 %m);
 +if (r  0  errno == EINVAL)
  log_error(Perhaps the kernel version is too old ( 
 3.4?));
  }
  

PR_SET_CHILD_SUBREAPER made it into 3.3, so this should be say (3.3?)
-- 
-Shawn Landden

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


Re: [systemd-devel] [PATCH] main: fix error message if PR_SET_CHILD_REAPER is not available

2012-08-16 Thread shawn
On Thu, 2012-08-16 at 18:38 +0200, Marius Tolzmann wrote: 
 ---
  src/core/main.c |4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/src/core/main.c b/src/core/main.c
 index cdd77c1..8973637 100644
 --- a/src/core/main.c
 +++ b/src/core/main.c
 @@ -1511,8 +1511,8 @@ int main(int argc, char *argv[]) {
  /* Become reaper of our children */
  r = prctl(PR_SET_CHILD_SUBREAPER, 1);
  if (r  0)
 -log_error(Failed to prctl(PR_SET_CHILD_SUBREAPER): 
 %s, strerror(-r));
 -if (r == -EINVAL)
 +log_error(Failed to prctl(PR_SET_CHILD_SUBREAPER): 
 %m);
 +if (r  0  errno == EINVAL)
  log_error(Perhaps the kernel version is too old ( 
 3.4?));
  }
  

PR_SET_CHILD_SUBREAPER made it into 3.3, so this should be say (3.3?)
-- 
-Shawn Landden

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