Don Badrak wrote:
> On Wed, 2 Feb 2000 sasha@stripped wrote:
> > dbadrak@stripped wrote:
> > >
> > > >Description:
> > >
> > > After building 3.22.30 the same way I've been doing for many versions, I
> get this when
> > > trying to use it:
> > >
> > > dbadrak@sequoia [~] mysql -p
> > > Enter password:
> > > ERROR 1135: Can't create a new thread (errno 1). If you are not out of
> available memory, you can consult the manual for a possible OS-dependent bug
> > >
> > > On another system (6.5.3f), the server wouldn't even start. This is what I
> had in the errror
> > > log:
> > >
> > > 000114 14:30:31 Can't create interrupt-thread (error 1, errno: 1)
> > >
> > On the second thought, I think I have an idea of what the problem is -- can you
> > check your documentations to see if you need to do configure your system in a
> > certain way to be able to call pthread_create() -- does you man pthread_create
> > say anything about any kind of special permissions or kernel options? If there
> > is nothing and SGI cannot explain it, just patch your OS and re-build mysqld
> > just to be sure -- this could be a bug in the thread library.
> Thank you. This sent me in the right direction. After quite a bit of
> searching, I found this was the case.
> In sql/mysqld.cc:
> 858 pthread_attr_setscope(&thr_attr,PTHREAD_SCOPE_SYSTEM);
> According to the man page for pthread_attr_setscope(3P):
> Threads created with system scope have a direct effect on scheduling by
> the kernel [see pthread_attr_setschedpolicy() and
> pthread_attr_setschedparam()]. System scope threads are therefore
> suitable for real-time applications [see realtime]. For example a system
> scope thread may run at a higher priority than interrupt threads and
> system daemons. Creation of system scope threads requires the
> CAP_SCHED_MGT capability [see capability].
> I looked through the capability(4) man page. It's got stuff on a whole bunch of
> and refers to capabilities(4) man page, where we see:
> Privilege to issue restricted scheduler calls, such as the real time
> scheduler interfaces.
> This is about the POSIX P1003.1e Capability features, which are available under IRIX
> (where I'm guessing that "x" is at least 3, since that's the place it first
> I use the username "mysql" to run the databases. When I changed to root, it worked.
> I don't want that.
> Under IRIX 6.5, you can set capabilities per process, where there's some code to
> this magic out. This part I haven't figured out.
> But, I did find a way. You can set the capabilities on the file. After
> installation, I did this:
> # chcap "CAP_SCHED_MGT+epi" /opt/mysql/libexec/mysqld
> And, then it started fine under the user mysql.
> I'm not sure if this is the most correct way of doing so, since this
> capability stuff is new to me. Anyone out there with experience with it
> on IRIX please correct me. I'd suggest putting something into the
> autoconf to check for this.
You're doing the correct thing, as far as I know. You might also check out the
Chapter 4 of Irix Admin: Backup, Security, and Accounting talks about capabilities as
MySQL developers: would setting the scheduling scope to PTHREAD_SCOPE_PROCESS instead of
PTHREAD_SCOPE_SYSTEM make a difference?