Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 123132 - Init script for dev-db/mysql-5.0.18 has errors when enabling nicelevel
Summary: Init script for dev-db/mysql-5.0.18 has errors when enabling nicelevel
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High trivial (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-16 20:39 UTC by steveb
Modified: 2006-02-20 01:55 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fix_init_d_nice_bug123132.patch (fix_init_d_nice_bug123132.patch,938 bytes, patch)
2006-02-18 06:30 UTC, Francesco R. (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description steveb 2006-02-16 20:39:19 UTC
If you enable the nice=value in /etc/conf.d/mysql, then the init script complains about unrecognized option --nicelevel:
nautilus / # /etc/init.d/mysql restart
 * Caching service dependencies ...                                                                                                                                              [ ok ]
 *  ...
 * working on mysql_slot_0
 * Starting mysqld0 (/etc/mysql/my.cnf)
/sbin/start-stop-daemon: unrecognized option `--nicelevel -15'
Try `/sbin/start-stop-daemon --help' for more information.
 * MySQL NOT started (3)                                                                                                                                                         [ !! ]
nautilus / # 



The problem is this line in /etc/init.d/mysql:
${NICE:+"--nicelevel "}${NICE} \

To get the nicelevel stuff working, this line should be:
${NICE:+"--nicelevel="}${NICE} \


After adding the = after the --nicelevel parameter, the init script does start mysql with the specified nice level from /etc/conf.d/mysql.


cheers

SteveB
Comment 1 Francesco R. (RETIRED) gentoo-dev 2006-02-17 02:23:11 UTC
@ steveb, please provide also the output from "/sbin/start-stop-daemon --version"

@ base-system
here it work with "start-stop-daemon 1.13.11+gentoo" from sys-apps/baselayout-1.12.0_pre15

fex, running it as user it _correctly_ return an error that cannot renice:

#/sbin/start-stop-daemon  --nicelevel -15 --start --exec /bin/ls
/sbin/start-stop-daemon: Unable to alter nice level by -15: Permission denied (Permission denied)
Comment 2 steveb 2006-02-17 13:30:21 UTC
(In reply to comment #1)
> @ steveb, please provide also the output from "/sbin/start-stop-daemon
> --version"
> 
start-stop-daemon 1.13.11+gentoo

The problem is, that if you run the command in bash, then it works. If you run the exactly same command in the init script then it does NOT work.

Try it. You will see, that there is a difference if you run it from script and runing it from bash.
Comment 3 Francesco R. (RETIRED) gentoo-dev 2006-02-18 06:30:20 UTC
Created attachment 80095 [details, diff]
fix_init_d_nice_bug123132.patch

Since I cannot understund the bug (but it's reproducible), here is a workaround,
apply with:

patch -i fix_init_d_nice_bug123132.patch /etc/init.d/mysql
Comment 4 Francesco R. (RETIRED) gentoo-dev 2006-02-18 06:33:28 UTC
Patch in c#3 things work here, if it's not the same for you please reopen the bug.

The same workaround will be committed in the cvs tree.

Thanks Steveb to pointing this out, and the different behaviour under baselayout  and the normal user environment.
Comment 5 Francesco R. (RETIRED) gentoo-dev 2006-02-18 06:49:17 UTC
baah, I could rephrase that awfull english if needed, but before try to understud it anyway also that way.

Also forget to comment on why the road of "--nicelevel=-15" has not been followed: This way to specify options is undocumented, and the behaviour under the wide range of baselayouts installed may be different and break things again. So sticky to "--nicelevel -15" for now.
Comment 6 Roy Marples (RETIRED) gentoo-dev 2006-02-20 01:55:07 UTC
Looks like it's because you're passing "--nicelevel -15" as one option because it's quoted, so your patch is correct. This is not a baselayout bug.