[gentoo-user] problems with performance when booted using systemd

2014-06-06 Thread covici
Hi.  I am having some strange performance problems when booted under
systemd.  These problems happened a little bit under openrc, but are
much more pronounced with systemd.

I am using just virtual consoles, no gui whatsoever at the moment.  I
also use tmux with 4 windows in one of the vcs.  My system is an i7
processor, quod core and 16g of ram and 2g of swap space which appears
not to be used.  I am using uvesafb for the console, so I get 64x160
screens.

The first problem is that if I don't press any keystrokes for several
minutes and then want to move to another vc, it takes about 3 or 4
seconds after the alt-left arrow or alt-right arrow command to take
effect.  Even within the same vt, if I don't do anything for several
minutes, it takes several seconds till the keystroke echoes and
something happens.  Once I have done this, things act normally, but its
kind of annoying.  Also, my load average seems to always be 1.  I have
looked at top and things seem to be OK, except that my cpu usage is like
this:
Tasks: 934 total,   2 running, 931 sleeping,   0 stopped,   1 zombie
%Cpu(s): 12.5 us,  1.2 sy,  0.0 ni, 86.0 id,  0.2 wa,  0.0 hi,  0.0 si,
0.0 st
KiB Mem:  16450248 total,  9678656 used,  6771592 free,  1084088 buffers
KiB Swap:  2097148 total,4 used,  2097144 free.  1147688 cached
Mem

  PID USER  PR  NIVIRTRESSHR S  %CPU %MEM TIME+
  COMMAND
 9969 root  20   0 708 16  0 R 100.0  0.0   1549:10 v86d
  579 root  30  10   0  0  0 S   9.1  0.0  16:09.93
  speakup
11789 root  20   0   22524   2388   1116 R   0.7  0.0   0:00.03 top
7 root   0 -20   0  0  0 S   0.3  0.0   0:10.41
  kworker/u:0H

and onward ...
This is an awful lot of tasks, I have never seen so many!

Anyone have any ideas?  Thanks much.


-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

 John Covici
 cov...@ccs.covici.com



Re: [gentoo-user] systemd not shutting down all the way

2014-06-06 Thread Bryan Gardiner
On June 6, 2014 01:27:51 cov...@ccs.covici.com wrote:
 Hi.  Whenever I issue the command shutdown -h now to shutdown the
 system, having booted under systemd, the computer never actually shuts
 down.  It does stop some services, but eventually just sits there --
 about the last one I see is something about sound card state and that is
 all, it just waits there forever.  How can I trouble shoot this problem?
 There is no gui running before I issue the shutdown command.
 
 Thanks in advance for any suggestions.

First, try 'systemctl halt' or 'systemctl poweroff', see if that works
any better.  I recall getting some warning on a previous systemd
installation (no longer exists) that the way I was shutting down might
not be working with systemd properly, though it wasn't a problem for
me (I vaguely I recall I was using poweroff and switched to shutdown).

Otherwise, you might want to try some of the debugging choices here:

http://freedesktop.org/wiki/Software/systemd/Debugging/#diagnosingshutdownproblems

Cheers,
Bryan




Re: [gentoo-user] systemd not shutting down all the way

2014-06-06 Thread covici
Bryan Gardiner b...@khumba.net wrote:

 On June 6, 2014 01:27:51 cov...@ccs.covici.com wrote:
  Hi.  Whenever I issue the command shutdown -h now to shutdown the
  system, having booted under systemd, the computer never actually shuts
  down.  It does stop some services, but eventually just sits there --
  about the last one I see is something about sound card state and that is
  all, it just waits there forever.  How can I trouble shoot this problem?
  There is no gui running before I issue the shutdown command.
  
  Thanks in advance for any suggestions.
 
 First, try 'systemctl halt' or 'systemctl poweroff', see if that works
 any better.  I recall getting some warning on a previous systemd
 installation (no longer exists) that the way I was shutting down might
 not be working with systemd properly, though it wasn't a problem for
 me (I vaguely I recall I was using poweroff and switched to shutdown).
 
 Otherwise, you might want to try some of the debugging choices here:
 
 http://freedesktop.org/wiki/Software/systemd/Debugging/#diagnosingshutdownproblems

Thanks, I will try those and see what I get.


-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

 John Covici
 cov...@ccs.covici.com



Re: [gentoo-user] problems with performance when booted using systemd

2014-06-06 Thread J. Roeleveld
On Friday, June 06, 2014 01:59:18 AM cov...@ccs.covici.com wrote:
 Hi.  I am having some strange performance problems when booted under
 systemd.  These problems happened a little bit under openrc, but are
 much more pronounced with systemd.

I don't think it's necessarily systemd itself, just a setting that systemd 
does differently then openrc. See below for more.

 I am using just virtual consoles, no gui whatsoever at the moment.  I
 also use tmux with 4 windows in one of the vcs.  My system is an i7
 processor, quod core and 16g of ram and 2g of swap space which appears
 not to be used.  I am using uvesafb for the console, so I get 64x160
 screens.

Sounds similar to my laptop, except I run KDE and got 16g of swap (for 
hibernate)

 The first problem is that if I don't press any keystrokes for several
 minutes and then want to move to another vc, it takes about 3 or 4
 seconds after the alt-left arrow or alt-right arrow command to take
 effect.  Even within the same vt, if I don't do anything for several
 minutes, it takes several seconds till the keystroke echoes and
 something happens.  Once I have done this, things act normally, but its
 kind of annoying.

Sounds like a powersave setting. I used to get the same on my old laptop with 
spinning rust. SSDs tend to spin-up a lot quicker.

 Also, my load average seems to always be 1.  I have
 looked at top and things seem to be OK, except that my cpu usage is like
 this:
 Tasks: 934 total,   2 running, 931 sleeping,   0 stopped,   1 zombie
 %Cpu(s): 12.5 us,  1.2 sy,  0.0 ni, 86.0 id,  0.2 wa,  0.0 hi,  0.0 si,
 0.0 st
 KiB Mem:  16450248 total,  9678656 used,  6771592 free,  1084088 buffers
 KiB Swap:  2097148 total,4 used,  2097144 free.  1147688 cached
 Mem
 
   PID USER  PR  NIVIRTRESSHR S  %CPU %MEM TIME+
   COMMAND
  9969 root  20   0 708 16  0 R 100.0  0.0   1549:10 v86d
   579 root  30  10   0  0  0 S   9.1  0.0  16:09.93
   speakup
 11789 root  20   0   22524   2388   1116 R   0.7  0.0   0:00.03 top
 7 root   0 -20   0  0  0 S   0.3  0.0   0:10.41
   kworker/u:0H
 
 and onward ...
 This is an awful lot of tasks, I have never seen so many!

That is a lot, I am currently running KDE, firefox and a citrix remote desktop 
thing. (oh, and skype and kopete and a few other items)
KDE is installed with semantic-desktop, but the nepomuk stuff is disabled in 
system-settings.
I have 200 tasks (yes, nice round figure)

 Anyone have any ideas?  Thanks much.

For the amount of tasks, check that you are not starting too many unneeded 
services. For the load-average of 1, shouldn't be too much of an issue, had 
similar in the past with a lot of stuff running and slow disks.

For the freezing, I would suggest checking all the powersave options, 
especially the ones for the harddrives.
Is there anything in the logs when this happens? Eg. check the logs right 
after the system becomes responsible again, maybe there is a hint there what 
is causing this.

--
Joost



Re: [gentoo-user] problems with performance when booted using systemd

2014-06-06 Thread covici
J. Roeleveld jo...@antarean.org wrote:

 On Friday, June 06, 2014 01:59:18 AM cov...@ccs.covici.com wrote:
  Hi.  I am having some strange performance problems when booted under
  systemd.  These problems happened a little bit under openrc, but are
  much more pronounced with systemd.
 
 I don't think it's necessarily systemd itself, just a setting that systemd 
 does differently then openrc. See below for more.
 
  I am using just virtual consoles, no gui whatsoever at the moment.  I
  also use tmux with 4 windows in one of the vcs.  My system is an i7
  processor, quod core and 16g of ram and 2g of swap space which appears
  not to be used.  I am using uvesafb for the console, so I get 64x160
  screens.
 
 Sounds similar to my laptop, except I run KDE and got 16g of swap (for 
 hibernate)
 
  The first problem is that if I don't press any keystrokes for several
  minutes and then want to move to another vc, it takes about 3 or 4
  seconds after the alt-left arrow or alt-right arrow command to take
  effect.  Even within the same vt, if I don't do anything for several
  minutes, it takes several seconds till the keystroke echoes and
  something happens.  Once I have done this, things act normally, but its
  kind of annoying.
 
 Sounds like a powersave setting. I used to get the same on my old laptop with 
 spinning rust. SSDs tend to spin-up a lot quicker.
 
  Also, my load average seems to always be 1.  I have
  looked at top and things seem to be OK, except that my cpu usage is like
  this:
  Tasks: 934 total,   2 running, 931 sleeping,   0 stopped,   1 zombie
  %Cpu(s): 12.5 us,  1.2 sy,  0.0 ni, 86.0 id,  0.2 wa,  0.0 hi,  0.0 si,
  0.0 st
  KiB Mem:  16450248 total,  9678656 used,  6771592 free,  1084088 buffers
  KiB Swap:  2097148 total,4 used,  2097144 free.  1147688 cached
  Mem
  
PID USER  PR  NIVIRTRESSHR S  %CPU %MEM TIME+
COMMAND
   9969 root  20   0 708 16  0 R 100.0  0.0   1549:10 v86d
579 root  30  10   0  0  0 S   9.1  0.0  16:09.93
speakup
  11789 root  20   0   22524   2388   1116 R   0.7  0.0   0:00.03 top
  7 root   0 -20   0  0  0 S   0.3  0.0   0:10.41
kworker/u:0H
  
  and onward ...
  This is an awful lot of tasks, I have never seen so many!
 
 That is a lot, I am currently running KDE, firefox and a citrix remote 
 desktop 
 thing. (oh, and skype and kopete and a few other items)
 KDE is installed with semantic-desktop, but the nepomuk stuff is disabled in 
 system-settings.
 I have 200 tasks (yes, nice round figure)
 
  Anyone have any ideas?  Thanks much.
 
 For the amount of tasks, check that you are not starting too many unneeded 
 services. For the load-average of 1, shouldn't be too much of an issue, had 
 similar in the past with a lot of stuff running and slow disks.
 
 For the freezing, I would suggest checking all the powersave options, 
 especially the ones for the harddrives.
 Is there anything in the logs when this happens? Eg. check the logs right 
 after the system becomes responsible again, maybe there is a hint there what 
 is causing this.

Unless systemd is setting some powersave options, I certainly never set
anything like that, this is a desktop  machine, not even a laptop.  Next
time this happens I will check the logs.  Does systemd set some
powersave options by default?

Thanks.


-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

 John Covici
 cov...@ccs.covici.com



Re: [gentoo-user] problems with performance when booted using systemd

2014-06-06 Thread J. Roeleveld
On Friday, June 06, 2014 03:45:17 AM cov...@ccs.covici.com wrote:
 J. Roeleveld jo...@antarean.org wrote:
  On Friday, June 06, 2014 01:59:18 AM cov...@ccs.covici.com wrote:
   Hi.  I am having some strange performance problems when booted under
   systemd.  These problems happened a little bit under openrc, but are
   much more pronounced with systemd.
  
  I don't think it's necessarily systemd itself, just a setting that systemd
  does differently then openrc. See below for more.
  
   I am using just virtual consoles, no gui whatsoever at the moment.  I
   also use tmux with 4 windows in one of the vcs.  My system is an i7
   processor, quod core and 16g of ram and 2g of swap space which appears
   not to be used.  I am using uvesafb for the console, so I get 64x160
   screens.
  
  Sounds similar to my laptop, except I run KDE and got 16g of swap (for
  hibernate)
  
   The first problem is that if I don't press any keystrokes for several
   minutes and then want to move to another vc, it takes about 3 or 4
   seconds after the alt-left arrow or alt-right arrow command to take
   effect.  Even within the same vt, if I don't do anything for several
   minutes, it takes several seconds till the keystroke echoes and
   something happens.  Once I have done this, things act normally, but its
   kind of annoying.
  
  Sounds like a powersave setting. I used to get the same on my old laptop
  with spinning rust. SSDs tend to spin-up a lot quicker.
  
   Also, my load average seems to always be 1.  I have
   looked at top and things seem to be OK, except that my cpu usage is like
   this:
   Tasks: 934 total,   2 running, 931 sleeping,   0 stopped,   1 zombie
   %Cpu(s): 12.5 us,  1.2 sy,  0.0 ni, 86.0 id,  0.2 wa,  0.0 hi,  0.0 si,
   0.0 st
   KiB Mem:  16450248 total,  9678656 used,  6771592 free,  1084088 buffers
   KiB Swap:  2097148 total,4 used,  2097144 free.  1147688 cached
   Mem
   
 PID USER  PR  NIVIRTRESSHR S  %CPU %MEM TIME+
 COMMAND

9969 root  20   0 708 16  0 R 100.0  0.0   1549:10 v86d

 579 root  30  10   0  0  0 S   9.1  0.0  16:09.93
 speakup
   
   11789 root  20   0   22524   2388   1116 R   0.7  0.0   0:00.03 top
   
   7 root   0 -20   0  0  0 S   0.3  0.0   0:10.41
 
 kworker/u:0H
   
   and onward ...
   This is an awful lot of tasks, I have never seen so many!
  
  That is a lot, I am currently running KDE, firefox and a citrix remote
  desktop thing. (oh, and skype and kopete and a few other items)
  KDE is installed with semantic-desktop, but the nepomuk stuff is disabled
  in system-settings.
  I have 200 tasks (yes, nice round figure)
  
   Anyone have any ideas?  Thanks much.
  
  For the amount of tasks, check that you are not starting too many unneeded
  services. For the load-average of 1, shouldn't be too much of an issue,
  had
  similar in the past with a lot of stuff running and slow disks.
  
  For the freezing, I would suggest checking all the powersave options,
  especially the ones for the harddrives.
  Is there anything in the logs when this happens? Eg. check the logs right
  after the system becomes responsible again, maybe there is a hint there
  what is causing this.
 
 Unless systemd is setting some powersave options, I certainly never set
 anything like that, this is a desktop  machine, not even a laptop.  Next
 time this happens I will check the logs.  Does systemd set some
 powersave options by default?

I do not know that for sure, best wait for more knowledgable systemd users to 
answer that. If it doesn't, then systemd itself is causing more freezes (as 
per your experience) then openrc.

I would guess it does or at least with the default configuration. What you 
describe makes me think the disks are switched to powersave sooner with 
systemd.
Can you provide the output of the following command:
#  hdparm -B /dev/sda
to get the APM settings of the disk. (If you have multiple disks, please run 
it for the others as well.

Question for others as well, how do you get the current setting for the 
spindown timeout set with   hdparm -S value device ?
I couldn't find it.

I am happy with openrc and have no intention on switching to systemd as I 
haven't heard of a single feature that would actually make my life easier.

--
Joost



Re: [gentoo-user] problems with performance when booted using systemd

2014-06-06 Thread covici
J. Roeleveld jo...@antarean.org wrote:

 On Friday, June 06, 2014 01:59:18 AM cov...@ccs.covici.com wrote:
  Hi.  I am having some strange performance problems when booted under
  systemd.  These problems happened a little bit under openrc, but are
  much more pronounced with systemd.
 
 I don't think it's necessarily systemd itself, just a setting that systemd 
 does differently then openrc. See below for more.
 
  I am using just virtual consoles, no gui whatsoever at the moment.  I
  also use tmux with 4 windows in one of the vcs.  My system is an i7
  processor, quod core and 16g of ram and 2g of swap space which appears
  not to be used.  I am using uvesafb for the console, so I get 64x160
  screens.
 
 Sounds similar to my laptop, except I run KDE and got 16g of swap (for 
 hibernate)
 
  The first problem is that if I don't press any keystrokes for several
  minutes and then want to move to another vc, it takes about 3 or 4
  seconds after the alt-left arrow or alt-right arrow command to take
  effect.  Even within the same vt, if I don't do anything for several
  minutes, it takes several seconds till the keystroke echoes and
  something happens.  Once I have done this, things act normally, but its
  kind of annoying.
 
 Sounds like a powersave setting. I used to get the same on my old laptop with 
 spinning rust. SSDs tend to spin-up a lot quicker.
 
  Also, my load average seems to always be 1.  I have
  looked at top and things seem to be OK, except that my cpu usage is like
  this:
  Tasks: 934 total,   2 running, 931 sleeping,   0 stopped,   1 zombie
  %Cpu(s): 12.5 us,  1.2 sy,  0.0 ni, 86.0 id,  0.2 wa,  0.0 hi,  0.0 si,
  0.0 st
  KiB Mem:  16450248 total,  9678656 used,  6771592 free,  1084088 buffers
  KiB Swap:  2097148 total,4 used,  2097144 free.  1147688 cached
  Mem
  
PID USER  PR  NIVIRTRESSHR S  %CPU %MEM TIME+
COMMAND
   9969 root  20   0 708 16  0 R 100.0  0.0   1549:10 v86d
579 root  30  10   0  0  0 S   9.1  0.0  16:09.93
speakup
  11789 root  20   0   22524   2388   1116 R   0.7  0.0   0:00.03 top
  7 root   0 -20   0  0  0 S   0.3  0.0   0:10.41
kworker/u:0H
  
  and onward ...
  This is an awful lot of tasks, I have never seen so many!
 
 That is a lot, I am currently running KDE, firefox and a citrix remote 
 desktop 
 thing. (oh, and skype and kopete and a few other items)
 KDE is installed with semantic-desktop, but the nepomuk stuff is disabled in 
 system-settings.
 I have 200 tasks (yes, nice round figure)
 
  Anyone have any ideas?  Thanks much.
 
 For the amount of tasks, check that you are not starting too many unneeded 
 services. For the load-average of 1, shouldn't be too much of an issue, had 
 similar in the past with a lot of stuff running and slow disks.
 
 For the freezing, I would suggest checking all the powersave options, 
 especially the ones for the harddrives.
 Is there anything in the logs when this happens? Eg. check the logs right 
 after the system becomes responsible again, maybe there is a hint there what 
 is causing this.

Well, not a peep out of the logs -- I did journaldctl -rb right after
one of those pauses and not an entry -- in fact it  looked like mail was
being received, etc right along.


-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

 John Covici
 cov...@ccs.covici.com



Re: [gentoo-user] problems with performance when booted using systemd

2014-06-06 Thread covici
J. Roeleveld jo...@antarean.org wrote:

 On Friday, June 06, 2014 03:45:17 AM cov...@ccs.covici.com wrote:
  J. Roeleveld jo...@antarean.org wrote:
   On Friday, June 06, 2014 01:59:18 AM cov...@ccs.covici.com wrote:
Hi.  I am having some strange performance problems when booted under
systemd.  These problems happened a little bit under openrc, but are
much more pronounced with systemd.
   
   I don't think it's necessarily systemd itself, just a setting that systemd
   does differently then openrc. See below for more.
   
I am using just virtual consoles, no gui whatsoever at the moment.  I
also use tmux with 4 windows in one of the vcs.  My system is an i7
processor, quod core and 16g of ram and 2g of swap space which appears
not to be used.  I am using uvesafb for the console, so I get 64x160
screens.
   
   Sounds similar to my laptop, except I run KDE and got 16g of swap (for
   hibernate)
   
The first problem is that if I don't press any keystrokes for several
minutes and then want to move to another vc, it takes about 3 or 4
seconds after the alt-left arrow or alt-right arrow command to take
effect.  Even within the same vt, if I don't do anything for several
minutes, it takes several seconds till the keystroke echoes and
something happens.  Once I have done this, things act normally, but its
kind of annoying.
   
   Sounds like a powersave setting. I used to get the same on my old laptop
   with spinning rust. SSDs tend to spin-up a lot quicker.
   
Also, my load average seems to always be 1.  I have
looked at top and things seem to be OK, except that my cpu usage is like
this:
Tasks: 934 total,   2 running, 931 sleeping,   0 stopped,   1 zombie
%Cpu(s): 12.5 us,  1.2 sy,  0.0 ni, 86.0 id,  0.2 wa,  0.0 hi,  0.0 si,
0.0 st
KiB Mem:  16450248 total,  9678656 used,  6771592 free,  1084088 buffers
KiB Swap:  2097148 total,4 used,  2097144 free.  1147688 cached
Mem

  PID USER  PR  NIVIRTRESSHR S  %CPU %MEM TIME+
  COMMAND
 
 9969 root  20   0 708 16  0 R 100.0  0.0   1549:10 v86d
 
  579 root  30  10   0  0  0 S   9.1  0.0  16:09.93
  speakup

11789 root  20   0   22524   2388   1116 R   0.7  0.0   0:00.03 top

7 root   0 -20   0  0  0 S   0.3  0.0   0:10.41
  
  kworker/u:0H

and onward ...
This is an awful lot of tasks, I have never seen so many!
   
   That is a lot, I am currently running KDE, firefox and a citrix remote
   desktop thing. (oh, and skype and kopete and a few other items)
   KDE is installed with semantic-desktop, but the nepomuk stuff is disabled
   in system-settings.
   I have 200 tasks (yes, nice round figure)
   
Anyone have any ideas?  Thanks much.
   
   For the amount of tasks, check that you are not starting too many unneeded
   services. For the load-average of 1, shouldn't be too much of an issue,
   had
   similar in the past with a lot of stuff running and slow disks.
   
   For the freezing, I would suggest checking all the powersave options,
   especially the ones for the harddrives.
   Is there anything in the logs when this happens? Eg. check the logs right
   after the system becomes responsible again, maybe there is a hint there
   what is causing this.
  
  Unless systemd is setting some powersave options, I certainly never set
  anything like that, this is a desktop  machine, not even a laptop.  Next
  time this happens I will check the logs.  Does systemd set some
  powersave options by default?
 
 I do not know that for sure, best wait for more knowledgable systemd users to 
 answer that. If it doesn't, then systemd itself is causing more freezes (as 
 per your experience) then openrc.
 
 I would guess it does or at least with the default configuration. What you 
 describe makes me think the disks are switched to powersave sooner with 
 systemd.
 Can you provide the output of the following command:
 #  hdparm -B /dev/sda
 to get the APM settings of the disk. (If you have multiple disks, please run 
 it for the others as well.
 
 Question for others as well, how do you get the current setting for the 
 spindown timeout set with   hdparm -S value device ?
 I couldn't find it.
 
 I am happy with openrc and have no intention on switching to systemd as I 
 haven't heard of a single feature that would actually make my life easier.

I don't have hdparm on the system, is it only for  older disks?  If
memory serves, it did not work at all when I tried it as my disks are
all /dev/sda, etc, but that may be wrong.



-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

 John Covici
 cov...@ccs.covici.com



Re: [gentoo-user] problems with performance when booted using systemd

2014-06-06 Thread Mick
On Friday 06 Jun 2014 06:59:18 cov...@ccs.covici.com wrote:
 I am using uvesafb for the console, so I get 64x160 screens.

Why don't you use KMS?  I am asking in the off-chance that uvesa is not 
working happily with your video card and the native kernel drive performs 
better.

This of course would not explain the high number of tasks; are these only 
evident under systemd?

-- 
Regards,
Mick


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] problems with performance when booted using systemd

2014-06-06 Thread covici
Mick michaelkintz...@gmail.com wrote:

 On Friday 06 Jun 2014 06:59:18 cov...@ccs.covici.com wrote:
  I am using uvesafb for the console, so I get 64x160 screens.
 
 Why don't you use KMS?  I am asking in the off-chance that uvesa is not 
 working happily with your video card and the native kernel drive performs 
 better.
 
 This of course would not explain the high number of tasks; are these only 
 evident under systemd?

Under openrc, I get much fewer tasks and even  when I first booted
systemd, it was fewer, but it was maybe be 400 whereas openrc had 200 or
less.  I am using uvesafb, because when I tried the kernel driver,
nvidia closed source driver was not happy when X was started.


-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

 John Covici
 cov...@ccs.covici.com



Re: [gentoo-user] Use Flags and Updating

2014-06-06 Thread Rich Freeman
On Thu, May 22, 2014 at 3:54 AM, Marc Joliet mar...@gmx.de wrote:
 I think nowadays one would prefer --keep-going, which automatically resumes on
 failure (and recomputes the dependency tree!), and prints a list of failed
 packages when it's finished. However its output is more verbose than just ok
 and failed (it'll print the build.log if it's only one package, IIRC).

Hmm, after using this script for some time I found a problem with this
approach.  If you use --buildpkgonly and ---keep-going then emerge
won't build a single thing if anything in the list is missing a
build-time dependency.  The script I posted will try to emerge
everything individually so at least some of the packages will be
compiled.

That seems like a bug in --buildpkgonly.  If you use it with
--keep-going it should at least compile the packages that aren't
missing build-time options.  I'll file that as a bug if it isn't
already there...

Rich



Re: [gentoo-user] problems with performance when booted using systemd

2014-06-06 Thread J. Roeleveld
On Friday, June 06, 2014 04:46:35 AM cov...@ccs.covici.com wrote:
 J. Roeleveld jo...@antarean.org wrote:
  On Friday, June 06, 2014 03:45:17 AM cov...@ccs.covici.com wrote:
   J. Roeleveld jo...@antarean.org wrote:
On Friday, June 06, 2014 01:59:18 AM cov...@ccs.covici.com wrote:
 Hi.  I am having some strange performance problems when booted under
 systemd.  These problems happened a little bit under openrc, but are
 much more pronounced with systemd.

I don't think it's necessarily systemd itself, just a setting that
systemd
does differently then openrc. See below for more.

 I am using just virtual consoles, no gui whatsoever at the moment. 
 I
 also use tmux with 4 windows in one of the vcs.  My system is an i7
 processor, quod core and 16g of ram and 2g of swap space which
 appears
 not to be used.  I am using uvesafb for the console, so I get 64x160
 screens.

Sounds similar to my laptop, except I run KDE and got 16g of swap (for
hibernate)

 The first problem is that if I don't press any keystrokes for
 several
 minutes and then want to move to another vc, it takes about 3 or 4
 seconds after the alt-left arrow or alt-right arrow command to take
 effect.  Even within the same vt, if I don't do anything for several
 minutes, it takes several seconds till the keystroke echoes and
 something happens.  Once I have done this, things act normally, but
 its
 kind of annoying.

Sounds like a powersave setting. I used to get the same on my old
laptop
with spinning rust. SSDs tend to spin-up a lot quicker.

 Also, my load average seems to always be 1.  I have
 looked at top and things seem to be OK, except that my cpu usage is
 like
 this:
 Tasks: 934 total,   2 running, 931 sleeping,   0 stopped,   1 zombie
 %Cpu(s): 12.5 us,  1.2 sy,  0.0 ni, 86.0 id,  0.2 wa,  0.0 hi,  0.0
 si,
 0.0 st
 KiB Mem:  16450248 total,  9678656 used,  6771592 free,  1084088
 buffers
 KiB Swap:  2097148 total,4 used,  2097144 free.  1147688
 cached
 Mem
 
   PID USER  PR  NIVIRTRESSHR S  %CPU %MEM TIME+
   COMMAND
  
  9969 root  20   0 708 16  0 R 100.0  0.0   1549:10
  v86d
  
   579 root  30  10   0  0  0 S   9.1  0.0  16:09.93
   speakup
 
 11789 root  20   0   22524   2388   1116 R   0.7  0.0   0:00.03
 top
 
 7 root   0 -20   0  0  0 S   0.3  0.0   0:10.41
   
   kworker/u:0H
 
 and onward ...
 This is an awful lot of tasks, I have never seen so many!

That is a lot, I am currently running KDE, firefox and a citrix remote
desktop thing. (oh, and skype and kopete and a few other items)
KDE is installed with semantic-desktop, but the nepomuk stuff is
disabled
in system-settings.
I have 200 tasks (yes, nice round figure)

 Anyone have any ideas?  Thanks much.

For the amount of tasks, check that you are not starting too many
unneeded
services. For the load-average of 1, shouldn't be too much of an
issue,
had
similar in the past with a lot of stuff running and slow disks.

For the freezing, I would suggest checking all the powersave options,
especially the ones for the harddrives.
Is there anything in the logs when this happens? Eg. check the logs
right
after the system becomes responsible again, maybe there is a hint
there
what is causing this.
   
   Unless systemd is setting some powersave options, I certainly never set
   anything like that, this is a desktop  machine, not even a laptop.  Next
   time this happens I will check the logs.  Does systemd set some
   powersave options by default?
  
  I do not know that for sure, best wait for more knowledgable systemd users
  to answer that. If it doesn't, then systemd itself is causing more
  freezes (as per your experience) then openrc.
  
  I would guess it does or at least with the default configuration. What you
  describe makes me think the disks are switched to powersave sooner with
  systemd.
  Can you provide the output of the following command:
  #  hdparm -B /dev/sda
  to get the APM settings of the disk. (If you have multiple disks, please
  run it for the others as well.
  
  Question for others as well, how do you get the current setting for the
  spindown timeout set with   hdparm -S value device ?
  I couldn't find it.
  
  I am happy with openrc and have no intention on switching to systemd as I
  haven't heard of a single feature that would actually make my life easier.
 
 I don't have hdparm on the system, is it only for  older disks?  If
 memory serves, it did not work at all when I tried it as my disks are
 all /dev/sda, etc, but that may be wrong.

It also works on new SATA drives and SSDs:

# smartctl -a /dev/sda

Re: [gentoo-user] Re: Systemd upower

2014-06-06 Thread Rich Freeman
On Fri, Jun 6, 2014 at 1:46 AM, Mick michaelkintz...@gmail.com wrote:
 On Friday 06 Jun 2014 00:15:02 Peter Humphrey wrote:

 I bet you have quite a lot of systemd components lurking in the background
 though, ready to take over the world the next time you aren't looking :-)

 Ha! I can already see this one:

   338 ?Ss 0:00 /lib/systemd/systemd-udevd --daemon

 I have set USE=-systemd, but if/when Gentoo migrates to systemd as the
 default startup I will probably have to remove it and then learn how to use
 systemd.

That would be udev.  It has been around long before systemd, and you
must have missed the huge flamewar when they renamed it to
systemd-udevd.  Maybe we'll see java renamed to
java-by-oracle-with-ask-toolbar next.  :)

If you ever migrate to systemd you really just need to set USE=systemd
and install systemd.  Portage will swap out your udev in the process,
though nothing there will really change as systemd and udev install
the same udev components.  There is a guide for installing systemd
that you should follow which gets into all the details.

Rich



Re: [gentoo-user] problems with performance when booted using systemd

2014-06-06 Thread Walter Dnes
On Fri, Jun 06, 2014 at 05:19:58AM -0400, cov...@ccs.covici.com wrote

 I am using uvesafb, because when I tried the kernel driver, nvidia
 closed source driver was not happy when X was started.

  Have you tried the nouveau open-source drivers for Nvidia cards?  You
don't have to rebuild/upgrade the video driver every time you upgrade
your kernel.

-- 
Walter Dnes waltd...@waltdnes.org
I don't run desktop environments; I run useful applications



Re: [gentoo-user] problems with performance when booted using systemd

2014-06-06 Thread covici
Walter Dnes waltd...@waltdnes.org wrote:

 On Fri, Jun 06, 2014 at 05:19:58AM -0400, cov...@ccs.covici.com wrote
 
  I am using uvesafb, because when I tried the kernel driver, nvidia
  closed source driver was not happy when X was started.
 
   Have you tried the nouveau open-source drivers for Nvidia cards?  You
 don't have to rebuild/upgrade the video driver every time you upgrade
 your kernel.
I did try those, but if X was started, nvidia crapped out.  Also, I was
getting a lot less screen real estate with those drivers than with
uvesafb.

-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

 John Covici
 cov...@ccs.covici.com



[gentoo-user] upower suddenly demands systemd

2014-06-06 Thread Gevisz
After today's emerge-webrsync, I have found out that usual
# emerge --update --deep --with-bdeps=y --newuse --ask world
does not work, trying but being unable to emerge systemd.

As I have found out, the reason for it was that upower
suddenly decided that it needs systemd but, for some
(lucky :) reason, it could not be emerged as my system
uses OpenRC.

The latest news said the following:

UPower discontinued hibernate and suspend support in favor of systemd.
 Because of this, we have created a compability package at
 sys-power/upower-pm-utils which will give you the old UPower with
 sys-power/pm-utils support back.
 Some desktops have integrated the sys-power/pm-utils support directly
 to their code, like Xfce, and as a result, they work also with the new
 UPower as expected.

 All non-systemd users are recommended to choose between:

 # emerge --oneshot --noreplace 'sys-power/upower-pm-utils'

 or

 # emerge --oneshot --noreplace '=sys-power/upower-0.99.0'

 However, all systemd users are recommended to stay with
 sys-power/upower.

However, that news did *not* say that without
# emerge --oneshot --noreplace 'sys-power/upower-pm-utils'
it is impossible to update the system even if you use xfce.

Only after executing the last command, which installed
upower-pm-utils and unistalled upower, the  
# emerge --update --deep --with-bdeps=y --newuse --ask world
worked as desired.

upower was not in my world file, so I think it's a some kind of a bug.



[gentoo-user] dev-ruby/json-1.8.0

2014-06-06 Thread Stephen Reynolds
Hi all

I am trying to emerge dev-ruby/json-1.8.0 and it keeps failing.
I have tried everything I know to fix it, without any success.

Regards



* Package:dev-ruby/json-1.8.0
 * Repository: gentoo
 * Maintainer: r...@gentoo.org
 * USE:amd64 doc elibc_glibc kernel_linux ruby_targets_ruby19
ruby_targets_ruby20 userland_GNU
 * FEATURES:   preserve-libs sandbox userpriv usersandbox
 Unpacking source...
 * Running unpack phase for all ...
 * Unpacking .gem file...
...
[ ok ]
 * Uncompressing metadata
...
[ ok ]
 * Unpacking data.tar.gz
...
[ ok ]
 Source unpacked in /var/tmp/portage/dev-ruby/json-1.8.0/work
 Preparing source in /var/tmp/portage/dev-ruby/json-1.8.0/work ...
 * Running prepare phase for all ...
 * Running source copy phase for ruby19 ...
 * Running source copy phase for ruby20 ...
 Source prepared.
 Configuring source in /var/tmp/portage/dev-ruby/json-1.8.0/work ...
 Source configured.
 Compiling source in /var/tmp/portage/dev-ruby/json-1.8.0/work ...
 * Running compile phase for ruby19 ...
GNU Make 3.82
Built for x86_64-pc-linux-gnu
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html

This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Ragel State Machine Compiler version 6.7 May 2011
Copyright (c) 2001-2009 by Adrian Thurston
Ragel State Machine Compiler version 6.7 May 2011
Copyright (c) 2001-2009 by Adrian Thurston
cd ext/json/ext/parser
/usr/bin/ruby19 extconf.rb
creating Makefile
gmake
compiling parser.c
linking shared-object json/ext/parser.so
cd -
cp ext/json/ext/parser/parser.so ext/json/ext
cd ext/json/ext/generator
/usr/bin/ruby19 extconf.rb
creating Makefile
gmake
compiling generator.c
linking shared-object json/ext/generator.so
cd -
cp ext/json/ext/generator/generator.so ext/json/ext
 * Running compile phase for ruby20 ...
GNU Make 3.82
Built for x86_64-pc-linux-gnu
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html

This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Ragel State Machine Compiler version 6.7 May 2011
Copyright (c) 2001-2009 by Adrian Thurston
Ragel State Machine Compiler version 6.7 May 2011
Copyright (c) 2001-2009 by Adrian Thurston
cd ext/json/ext/parser
/usr/bin/ruby20 extconf.rb
creating Makefile
gmake
compiling parser.c
linking shared-object json/ext/parser.so
cd -
cp ext/json/ext/parser/parser.so ext/json/ext
cd ext/json/ext/generator
/usr/bin/ruby20 extconf.rb
creating Makefile
gmake
compiling generator.c
linking shared-object json/ext/generator.so
cd -
cp ext/json/ext/generator/generator.so ext/json/ext
 * Running compile phase for all ...
GNU Make 3.82
Built for x86_64-pc-linux-gnu
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html

This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Ragel State Machine Compiler version 6.7 May 2011
Copyright (c) 2001-2009 by Adrian Thurston
Ragel State Machine Compiler version 6.7 May 2011
Copyright (c) 2001-2009 by Adrian Thurston
Writing version information for 1.8.0
rdoc -o doc -t 'JSON Implementation for Ruby' -m README.rdoc README.rdoc
lib/json.rb lib/json/add/bigdecimal.rb lib/json/add/complex.rb
lib/json/add/core.rb lib/json/add/date.rb lib/json/add/date_time.rb
lib/json/add/exception.rb lib/json/add/ostruct.rb lib/json/add/range.rb
lib/json/add/rational.rb lib/json/add/regexp.rb lib/json/add/struct.rb
lib/json/add/symbol.rb lib/json/add/time.rb lib/json/common.rb
lib/json/ext.rb lib/json/generic_object.rb lib/json/pure.rb
lib/json/pure/generator.rb lib/json/pure/parser.rb lib/json/version.rb
ext/json/ext/parser/parser.c ext/json/ext/generator/generator.c
sh: rdoc: command not found
rake aborted!
Command failed with status (127): [rdoc -o doc -t 'JSON Implementation for
Ru...]
/var/tmp/portage/dev-ruby/json-1.8.0/work/all/json-1.8.0/Rakefile:346:in
`block in top (required)'
Tasks: TOP = doc
(See full trace by running task with --trace)
 * ERROR: dev-ruby/json-1.8.0::gentoo failed (compile phase):
 *   failed to (re)build documentation
 *
 * Call stack:
 * ebuild.sh, line   93:  Called src_compile
 *   environment, line 4281:  Called ruby-ng_src_compile
 *   environment, line 3939:  Called _ruby_invoke_environment 'all'
'all_ruby_compile'
 *   environment, line  501:  Called all_ruby_compile
 *   environment, line  585:  Called all_fakegem_compile
 *   environment, line  545:  Called die
 * The specific snippet of code:
 *   rake ${RUBY_FAKEGEM_TASK_DOC} || die failed to
(re)build documentation
 *
 * If you need support, post the output of `emerge --info

Re: [gentoo-user] upower suddenly demands systemd

2014-06-06 Thread Alexander Kapshuk
On 06/06/2014 05:34 PM, Gevisz wrote:
 After today's emerge-webrsync, I have found out that usual
 # emerge --update --deep --with-bdeps=y --newuse --ask world
 does not work, trying but being unable to emerge systemd.

 As I have found out, the reason for it was that upower
 suddenly decided that it needs systemd but, for some
 (lucky :) reason, it could not be emerged as my system
 uses OpenRC.

 The latest news said the following:

 UPower discontinued hibernate and suspend support in favor of systemd.
  Because of this, we have created a compability package at
  sys-power/upower-pm-utils which will give you the old UPower with
  sys-power/pm-utils support back.
  Some desktops have integrated the sys-power/pm-utils support directly
  to their code, like Xfce, and as a result, they work also with the new
  UPower as expected.

  All non-systemd users are recommended to choose between:

  # emerge --oneshot --noreplace 'sys-power/upower-pm-utils'

  or

  # emerge --oneshot --noreplace '=sys-power/upower-0.99.0'

  However, all systemd users are recommended to stay with
  sys-power/upower.

 However, that news did *not* say that without
 # emerge --oneshot --noreplace 'sys-power/upower-pm-utils'
 it is impossible to update the system even if you use xfce.

 Only after executing the last command, which installed
 upower-pm-utils and unistalled upower, the  
 # emerge --update --deep --with-bdeps=y --newuse --ask world
 worked as desired.

 upower was not in my world file, so I think it's a some kind of a bug.

The situation you've encountered has been discussed at length on this
mailing list over the last few days.

Please see the threads with upower and systemd as the Subject matter for
further details.




[gentoo-user] Re: quick installs on older/embedded hardware

2014-06-06 Thread James
Alan McKinnon alan.mckinnon at gmail.com writes:


 So how do other vendors do it? If we look at their workflow, perhaps a
 useable method will filter up through the wetware 


I have no idea how to find and convince an appropriate company to share how
they setup for multi image testing on various hardware platforms. If you
know of such an opportunity, I'd be all ears on what they would be willing
to share.

Do tell.


James






Re: [gentoo-user] OT: Mapping random numbers (PRNG)

2014-06-06 Thread meino . cramer
Canek Peláez Valdés can...@gmail.com [14-06-06 17:36]:
 On Thu, Jun 5, 2014 at 9:56 PM,  meino.cra...@gmx.de wrote:
  Hi,
 
  I am experimenting with the C code of the ISAAC pseudo random number 
  generator
  (http://burtleburtle.net/bob/rand/isaacafa.html).
 
  Currently the implementation creates (on my embedded linux) 32 bit
  hexadecimal output.
 
 So it's a 32 bit integer.
 
  From this I want to create random numbers in the range of [a-Za-z0-9]
  *without violating randomness* and (if possible) without throwing
  away bits of the output.
 
 You mean *characters* int the range [A-Za-z0-9]?
 
  How can I do this mathemtically (in concern of the quality of output)
  correct?
 
 The easiest thing to do would be:
 
 ---
 #include time.h
 #include stdio.h
 #include stdlib.h
 
 #define N (26+26+10)
 
 static char S[] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
 'K', 'L', 'M',
 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
 'X', 'Y', 'Z',
 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
 'k', 'l', 'm',
 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
 'x', 'y', 'z',
 '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
 
 int
 next_character()
 {
 // Use the correct call for ISAAC instead of rand()
 unsigned int idx = rand() % N;
 return S[idx];
 }
 
 int
 main(int argc, char* argv[])
 {
 // Use the correct call for initializing the ISAAC seed
 srand((unsigned int)time(NULL));
 for (int i = 0; i  20; i++) // --std=c99
 printf(%c\n, next_character());
 return 0;
 }
 ---
 
 If the ISAAC RNG has a good distribution, then the next_character()
 function will give a good distribution among the set [A-Za-z0-9].
 
 Unless I missunderstood what you meant with create random numbers in
 the range of [a-Za-z0-9].
 
 Regards.
 -- 
 Canek Peláez Valdés
 Profesor de asignatura, Facultad de Ciencias
 Universidad Nacional Autónoma de México
 

Hi,

Thank you very much for the input! :)

I have a question about the algorithm:
Suppose rand() has an equal distribution of numbers and furthermore
one has a count of 2^32 random numbers listed in numerical sort
order.
In this list each number would appear (nearly) with the same count: 1

To get an better imagination of that...suppose the rand() would only 
return numbers in the range of 1...12 and the alphabet has only 8
characters (as 2^32 is not devideable by 62)

rand():
1 2 3 4 5 6 7 8 9 10 11 12

rand()%N : rand()%7
1 2 3 4 5 6 7 0 1  2  3  4  

or in other words: An even distribution of numbers of rand() 
would result in a unevenly distributed sequence of characters...or?
This would break the quality of ISAACs output.

I am sure I did something wrong here...but where is the logic trap?


Thank you very much for any help in advance!
Best regards,
mcc










Re: [gentoo-user] Re: Systemd upower

2014-06-06 Thread Mick
On Friday 06 Jun 2014 12:18:09 Rich Freeman wrote:

 That would be udev.  It has been around long before systemd, and you
 must have missed the huge flamewar when they renamed it to
 systemd-udevd.  Maybe we'll see java renamed to
 java-by-oracle-with-ask-toolbar next.  :)

TBH I wouldn't be surprised.  At least java offers a choice of avoiding it.  
;-)


 If you ever migrate to systemd you really just need to set USE=systemd
 and install systemd.  Portage will swap out your udev in the process,
 though nothing there will really change as systemd and udev install
 the same udev components.  There is a guide for installing systemd
 that you should follow which gets into all the details.

I didn't miss the flamewar.  Actually I recall joining in the fun and posting 
the odd message about systemd.  I know that I could use eudev or systemd-udev 
(or even mdev as kindly shared in this list by Walter).

I am mostly happy with openrc and therefore have no reason to move to the 
systemd monoculture, unless gentoo falls in line with Debian et al. and leaves 
me no choice.

-- 
Regards,
Mick


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Re: Systemd upower

2014-06-06 Thread Rich Freeman
On Fri, Jun 6, 2014 at 3:13 PM, Mick michaelkintz...@gmail.com wrote:

 I am mostly happy with openrc and therefore have no reason to move to the
 systemd monoculture, unless gentoo falls in line with Debian et al. and leaves
 me no choice.


I don't really see that happening anytime soon - it will be more
likely to become an issue for the more complex desktop environments
(Gnome is already going this way - KDE may very well go this way
later).  Historically they're the first packages to require things
like HAL, udev, dbus, pulseaudio, etc (and on Gentoo the maintainers
tend to do a good job of minimizing dependencies).

I think many will switch to systemd anyway, simply because that is the
way the wind is blowing and it does have some benefits depending on
your situation (but so do a number of other configurations).  I tend
to use it by default on new installs, and anytime I find myself
tweaking my monit rules I keep bumping up migrating entirely to
systemd a little higher on my to-do list.

Rich



Re: [gentoo-user] OT: Mapping random numbers (PRNG)

2014-06-06 Thread null_ptr

On 06/06/14 20:39, meino.cra...@gmx.de wrote:

To get an better imagination of that...suppose the rand() would only
return numbers in the range of 1...12 and the alphabet has only 8
characters (as 2^32 is not devideable by 62)

rand():
1 2 3 4 5 6 7 8 9 10 11 12

rand()%N : rand()%7
1 2 3 4 5 6 7 0 1  2  3  4

or in other words: An even distribution of numbers of rand()
would result in a unevenly distributed sequence of characters...or?
This would break the quality of ISAACs output.

I am sure I did something wrong here...but where is the logic trap?


You thought on that is totally right.
Let's say random numbers have the rande [0..RAND_MAX]
Blindly calculating modulus
creates a bias towards lower numbers if RAND_MAX+1 is not divisible
by N. For most applications this bias is negligible. If you really
want the same distribution you have to discard numbers greater than
RAND_MAX - ((RAND_MAX+1)%N)
(Beware the undefined behaviour in the above line if you try C.)
Basically you want one less than the largest by N dividable number
in your range.

With numbers:
rand():
0 1 2 3 4 5 6 7 8 9 10 11 12
rand()%5 with discarding 12-((12+1)%5)=9:
0 1 2 3 4 0 1 2 3 4 discarded

---
null_ptr
Please don't follow me.



Re: [gentoo-user] OT: Mapping random numbers (PRNG)

2014-06-06 Thread Canek Peláez Valdés
On Fri, Jun 6, 2014 at 1:39 PM,  meino.cra...@gmx.de wrote:
 Canek Peláez Valdés can...@gmail.com [14-06-06 17:36]:
 On Thu, Jun 5, 2014 at 9:56 PM,  meino.cra...@gmx.de wrote:
  Hi,
 
  I am experimenting with the C code of the ISAAC pseudo random number 
  generator
  (http://burtleburtle.net/bob/rand/isaacafa.html).
 
  Currently the implementation creates (on my embedded linux) 32 bit
  hexadecimal output.

 So it's a 32 bit integer.

  From this I want to create random numbers in the range of [a-Za-z0-9]
  *without violating randomness* and (if possible) without throwing
  away bits of the output.

 You mean *characters* int the range [A-Za-z0-9]?

  How can I do this mathemtically (in concern of the quality of output)
  correct?

 The easiest thing to do would be:

 ---
 #include time.h
 #include stdio.h
 #include stdlib.h

 #define N (26+26+10)

 static char S[] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
 'K', 'L', 'M',
 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
 'X', 'Y', 'Z',
 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
 'k', 'l', 'm',
 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
 'x', 'y', 'z',
 '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };

 int
 next_character()
 {
 // Use the correct call for ISAAC instead of rand()
 unsigned int idx = rand() % N;
 return S[idx];
 }

 int
 main(int argc, char* argv[])
 {
 // Use the correct call for initializing the ISAAC seed
 srand((unsigned int)time(NULL));
 for (int i = 0; i  20; i++) // --std=c99
 printf(%c\n, next_character());
 return 0;
 }
 ---

 If the ISAAC RNG has a good distribution, then the next_character()
 function will give a good distribution among the set [A-Za-z0-9].

 Unless I missunderstood what you meant with create random numbers in
 the range of [a-Za-z0-9].

 Regards.
 --
 Canek Peláez Valdés
 Profesor de asignatura, Facultad de Ciencias
 Universidad Nacional Autónoma de México


 Hi,

 Thank you very much for the input! :)

 I have a question about the algorithm:
 Suppose rand() has an equal distribution of numbers and furthermore
 one has a count of 2^32 random numbers listed in numerical sort
 order.
 In this list each number would appear (nearly) with the same count: 1

 To get an better imagination of that...suppose the rand() would only
 return numbers in the range of 1...12 and the alphabet has only 8
 characters (as 2^32 is not devideable by 62)

 rand():
 1 2 3 4 5 6 7 8 9 10 11 12

 rand()%N : rand()%7
 1 2 3 4 5 6 7 0 1  2  3  4

 or in other words: An even distribution of numbers of rand()
 would result in a unevenly distributed sequence of characters...or?
 This would break the quality of ISAACs output.

 I am sure I did something wrong here...but where is the logic trap?

In theory, it doesn't matter if the number of random characters you
want is not multiple of the size of the set of characters. In
practice, it doesn't matter if the number of random characters you
want is big enough.

Consider the following modification to my program (I changed the order
of the array S so it's sorted and I can do binary search):

--
#include time.h
#include stdio.h
#include stdlib.h

#define N (10+26+26)

static char S[] = {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
};

static int
index_of_aux(char c, int a, int b)
{
if (a  b)
return -1;
int m = (a + b) / 2;
if (S[m] == c)
return m;
if (S[m]  c)
return index_of_aux(c, a, m-1);
return index_of_aux(c, m+1, b);
}

static int
index_of(char c)
{
return index_of_aux(c, 0, N-1);
}

int
next_character()
{
// Use the correct call for isaac instead of rand()
unsigned int idx = rand() % N;
return S[idx];
}

int
main(int argc, char* argv[])
{
srand((unsigned int)time(NULL));
int total = 100;

// Size = 62
int count[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};

for (int i = 0; i  total; i++) {
char c = next_character();
count[index_of(c)]++;
}

int min = 

Re: [gentoo-user] OT: Mapping random numbers (PRNG)

2014-06-06 Thread Matti Nykyri
On Thu, Jun 05, 2014 at 10:58:51PM -0500, Canek Peláez Valdés wrote:
 On Thu, Jun 5, 2014 at 9:56 PM,  meino.cra...@gmx.de wrote:
  Hi,
 
  I am experimenting with the C code of the ISAAC pseudo random number 
  generator
  (http://burtleburtle.net/bob/rand/isaacafa.html).
 
  Currently the implementation creates (on my embedded linux) 32 bit
  hexadecimal output.
 
 So it's a 32 bit integer.
 
  From this I want to create random numbers in the range of [a-Za-z0-9]
  *without violating randomness* and (if possible) without throwing
  away bits of the output.
 
 You mean *characters* int the range [A-Za-z0-9]?

Well this isn't as simple problem as it sounds. A random 32 bit integer 
has 32 bits of randomness. If you take a divison reminder of 62 from this 
integer you will get only 5,95419631039 bits of randomness 
(log(62)/log(2)). So you are wasting 81,4% of your random data. Which is 
quite much and usually random data is quite expensive. You can save your 
precious random data by taking only 6 bit from your 32 bit integer and 
dividing it by 62. Then you will be wasting only 0,8% of random data. 
Another problem is alignment, but that is about mathematical correctness.

  How can I do this mathemtically (in concern of the quality of output)
  correct?
 
 The easiest thing to do would be:

The easiest is not mathematically correct though. Random data will stay 
random only if you select and modify it so that randomness is preserved. 
If you take devison reminder of 62 from 32 bit integer there are 69 273 
667 possibilities of the reminder to be 3 or less. For the reminder to 4 
or more the number of possibilities is 69 273 666. In mathematically 
ideal case the probability for every index of the list should be same: 
1/62 = 1,61290322581%. But the modulo 62 modifies this probability: for 
index 0-3 the probability is 69 273 667/2^32 = 1,61290324759%. And for 
indexes 4-61 the probability will be 69 273 666/2^32 = 1,6129032243%.

If you wish not to waste those random bits the probabilities will get 
worse. With 6 bits of random the probability for index 0-1 will be 2/64 
and for 2-63 it will be 1/64. This is a very significant change because 
first and second index will appear twice as much as the rest. If you add 
2 characters to your list you will perfect alignment and you can take 6 
bits of data without it modifying probabilities.

If you are looking a mathematically perfect solution there is a simple 
one even if your list is not in the power of 2! Take 6 bits at a time of 
the random data. If the result is 62 or 63 you will discard the data and 
get the next 6 bits. This selectively modifies the random data but keeps 
the probabilities in correct balance. Now the probability for index of 
0-61 is 1/62 because the probability to get 62-63 out of 64 if 0.

 ---
 #include time.h
 #include stdio.h
 #include stdlib.h
 
 #define N (26+26+10)
 
 static char S[] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
 'K', 'L', 'M',
 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
 'X', 'Y', 'Z',
 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
 'k', 'l', 'm',
 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
 'x', 'y', 'z',
 '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
 
 int
 next_character()
 {
 // Use the correct call for ISAAC instead of rand()
 unsigned int idx = rand() % N;
 return S[idx];
 }

so modify the next_char function:

char next_character()
{
static unsigned int rand = 0; //(sizeof(int) = 32)
static char bit_avail = 0;
char result = 0;
char move_bits = 0;
char bits_moved = 0;

do {
if (!bits_avail) {
// Use the correct call for ISAAC instead of rand()
rand = rand();

bit_avail = 32;
}

move_bits = bits_avail = 6 ? 6 : bits_avail;
result = move_bits;
result = (result | rand  (0xFF  (8 - move_bits)))  0x3F;
bits_avail -= move_bits;
bits_moved += move_bits;
rand = move_bits;

} while (bits_moved != 6  result  61);

return result;
}

This function will give perfect distribution of 1/62 probability for 
every index. It will waste 6 bits with the probability of 1/32 (2/64).

 int
 main(int argc, char* argv[])
 {
 // Use the correct call for initializing the ISAAC seed
 srand((unsigned int)time(NULL));
 for (int i = 0; i  20; i++) // --std=c99
 printf(%c\n, next_character());
 return 0;
 }
 ---
 
 If the ISAAC RNG has a good distribution, then the next_character()
 function will give a good distribution 

Re: [gentoo-user] OT: Mapping random numbers (PRNG)

2014-06-06 Thread Matti Nykyri
On Fri, Jun 06, 2014 at 08:39:28PM +0200, meino.cra...@gmx.de wrote:
 Canek Peláez Valdés can...@gmail.com [14-06-06 17:36]:
  On Thu, Jun 5, 2014 at 9:56 PM,  meino.cra...@gmx.de wrote:
   Hi,
  
   I am experimenting with the C code of the ISAAC pseudo random number 
   generator
   (http://burtleburtle.net/bob/rand/isaacafa.html).
  
   Currently the implementation creates (on my embedded linux) 32 bit
   hexadecimal output.
  
  So it's a 32 bit integer.
  
   From this I want to create random numbers in the range of [a-Za-z0-9]
   *without violating randomness* and (if possible) without throwing
   away bits of the output.
  
  You mean *characters* int the range [A-Za-z0-9]?
  
   How can I do this mathemtically (in concern of the quality of output)
   correct?
  
  The easiest thing to do would be:
  
  ---
  #include time.h
  #include stdio.h
  #include stdlib.h
  
  #define N (26+26+10)
  
  static char S[] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
  'K', 'L', 'M',
  'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
  'X', 'Y', 'Z',
  'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
  'k', 'l', 'm',
  'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
  'x', 'y', 'z',
  '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
  
  int
  next_character()
  {
  // Use the correct call for ISAAC instead of rand()
  unsigned int idx = rand() % N;
  return S[idx];
  }
  
  int
  main(int argc, char* argv[])
  {
  // Use the correct call for initializing the ISAAC seed
  srand((unsigned int)time(NULL));
  for (int i = 0; i  20; i++) // --std=c99
  printf(%c\n, next_character());
  return 0;
  }
  ---
  
  If the ISAAC RNG has a good distribution, then the next_character()
  function will give a good distribution among the set [A-Za-z0-9].
  
  Unless I missunderstood what you meant with create random numbers in
  the range of [a-Za-z0-9].
  
  Regards.
  -- 
  Canek Peláez Valdés
  Profesor de asignatura, Facultad de Ciencias
  Universidad Nacional Autónoma de México
  
 
 Hi,
 
 Thank you very much for the input! :)
 
 I have a question about the algorithm:
 Suppose rand() has an equal distribution of numbers and furthermore
 one has a count of 2^32 random numbers listed in numerical sort
 order.
 In this list each number would appear (nearly) with the same count: 1
 
 To get an better imagination of that...suppose the rand() would only 
 return numbers in the range of 1...12 and the alphabet has only 8
 characters (as 2^32 is not devideable by 62)
 
 rand():
 1 2 3 4 5 6 7 8 9 10 11 12
 
 rand()%N : rand()%7
 1 2 3 4 5 6 7 0 1  2  3  4  
 
 or in other words: An even distribution of numbers of rand() 
 would result in a unevenly distributed sequence of characters...or?
 This would break the quality of ISAACs output.
 
 I am sure I did something wrong here...but where is the logic trap?
 

This is the thing I explained in my message.

-- 
-Matti



[gentoo-user] Re: dev-ruby/json-1.8.0

2014-06-06 Thread walt
On 06/06/2014 09:48 AM, Stephen Reynolds wrote:
 rdoc -o doc -t 'JSON Implementation for Ruby' -m README.rdoc
snip
 ext/json/ext/generator/generator.c sh: rdoc: command not found

You apparently have ruby19 and ruby20 installed, is this right?

Do you have a version of ruby eselected?  eselect ruby show

I'm using ruby19, so I have:

#ls -l /usr/bin/rdoc
/usr/bin/rdoc - rdoc19

That symlink to rdoc19 was created by using eselect ruby set to
choose between ruby19 and ruby20.

Is all of the above familiar to you?  If not, you may need more
help with managing multiple ruby versions.  I find it a large PITA
and I could use more help myself :)





Re: [gentoo-user] upower suddenly demands systemd

2014-06-06 Thread Alan McKinnon
On 06/06/2014 16:34, Gevisz wrote:
 After today's emerge-webrsync, I have found out that usual
 # emerge --update --deep --with-bdeps=y --newuse --ask world
 does not work, trying but being unable to emerge systemd.
 
 As I have found out, the reason for it was that upower
 suddenly decided that it needs systemd but, for some
 (lucky :) reason, it could not be emerged as my system
 uses OpenRC.
 
 The latest news said the following:
 
 UPower discontinued hibernate and suspend support in favor of systemd.
  Because of this, we have created a compability package at
  sys-power/upower-pm-utils which will give you the old UPower with
  sys-power/pm-utils support back.
  Some desktops have integrated the sys-power/pm-utils support directly
  to their code, like Xfce, and as a result, they work also with the new
  UPower as expected.
 
  All non-systemd users are recommended to choose between:
 
  # emerge --oneshot --noreplace 'sys-power/upower-pm-utils'
 
  or
 
  # emerge --oneshot --noreplace '=sys-power/upower-0.99.0'
 
  However, all systemd users are recommended to stay with
  sys-power/upower.
 
 However, that news did *not* say that without
 # emerge --oneshot --noreplace 'sys-power/upower-pm-utils'
 it is impossible to update the system even if you use xfce.


The news item is a compromise as the problem you ran into is really a
very minor one; it's the presence of systemd and two blocking upower
packages that cause confusion. Extra points for the magic flame
war-inducing trigger-word systemd - see the enormous threads here and
on -dev for proof.

So the news item clarifies that you are not being forced to use systemd
and explains the alternatives in a concise manner.

Once you have that done, anything that comes next is simple routine
portage blockers which you are expected to know how to deal with, and
are not at all worthy of mention in a news item.


 Only after executing the last command, which installed
 upower-pm-utils and unistalled upower, the  
 # emerge --update --deep --with-bdeps=y --newuse --ask world
 worked as desired.
 
 upower was not in my world file, so I think it's a some kind of a bug.


It's not a bug and upower is not supposed to be in world. It's a simple
dep library that portage will pull in if you have any other packages
that need it. Keep it and upower-pm-utils out of world so that Samuli's
 next planned phase of this change in UPower will go smoothly.

The reason for all the confusion is due to how portage works internally.
Briefly, it sees you have a choice between upower and upower-pm-utils
and usually ends up picking upower.

It's similar to virtuals where portage doesn't know what you want so
just picks the first in the list. If you want the second, then you have
to emerge it yourself first, stopping portage from deciding.

As I said above, this simple package addition produces the magic
flamewar trigger word systemd whcih always gets half the audience very
very upset indeed.




-- 
Alan McKinnon
alan.mckin...@gmail.com




Re: [gentoo-user] Re: quick installs on older/embedded hardware

2014-06-06 Thread Alan McKinnon
On 06/06/2014 19:20, James wrote:
 Alan McKinnon alan.mckinnon at gmail.com writes:
 
 
 So how do other vendors do it? If we look at their workflow, perhaps a
 useable method will filter up through the wetware 
 
 
 I have no idea how to find and convince an appropriate company to share how
 they setup for multi image testing on various hardware platforms. If you
 know of such an opportunity, I'd be all ears on what they would be willing
 to share.
 
 Do tell.


Sorry, I have no idea myself. I was hoping that this stuff would be
reasonably common knowledge but apparently in the embedded space people
guard their stuff jealously.

In my space (ISPs) we tend to proudly show off our deployment magic at
every chance and every seminar, mostly to get bragging rights and
brownie points plus a good healthy dose of one-upmanship.

And everyone knows everyone else anyway, half of us have worked at every
other ISP at least once  - no such thing as keeping your internal
systems secret :-)



-- 
Alan McKinnon
alan.mckin...@gmail.com




Re: [gentoo-user] Use Flags and Updating

2014-06-06 Thread Alan McKinnon
On 06/06/2014 12:44, Rich Freeman wrote:
 On Thu, May 22, 2014 at 3:54 AM, Marc Joliet mar...@gmx.de wrote:
 I think nowadays one would prefer --keep-going, which automatically resumes 
 on
 failure (and recomputes the dependency tree!), and prints a list of failed
 packages when it's finished. However its output is more verbose than just 
 ok
 and failed (it'll print the build.log if it's only one package, IIRC).
 
 Hmm, after using this script for some time I found a problem with this
 approach.  If you use --buildpkgonly and ---keep-going then emerge
 won't build a single thing if anything in the list is missing a
 build-time dependency.  The script I posted will try to emerge
 everything individually so at least some of the packages will be
 compiled.
 
 That seems like a bug in --buildpkgonly.  If you use it with
 --keep-going it should at least compile the packages that aren't
 missing build-time options.  I'll file that as a bug if it isn't
 already there...



I don't think it's a bug, it's more like a difference in interpretation.
From the man page:


   --buildpkgonly (-B)
  Creates binary packages for all ebuilds processed  without
  actually merging the packages.  This comes with the caveat
  that all build-time dependencies must already  be  emerged
  on the system.
   --keep-going [ y | n ]
  Continue as much as possible after an error. When an error
  occurs,  dependencies are recalculated for remaining pack‐
  ages and any with unsatisfied dependencies  are  automati‐
  cally dropped. Also see the related --skipfirst option.


So, decisions about --buildpkgonly are made at the start of an emerge
and --keep-going kicks in only when an error occurs at the end, and the
former must have higher precedence than the latter.

It doesn't make sense to expect portage to change it's behaviour about
it's initial decisions just because you also have an entirely unrelated
option set that is only a convenience in the event of a build failure.
That seems to me too much of an unexpected side effect


-- 
Alan McKinnon
alan.mckin...@gmail.com