Fwd: Re: mldonkey.init

Elan Ruusamäe glen at delfi.ee
Sat Jan 15 15:52:53 CET 2005


debugged, pam_limits does reset the priority.
so everything that uses daemon() and --user gets priority reset

it's bug of rc-scripts imho, it should ensure the nice level specified is set 
for program.


# strace nice -n +12 /bin/su mldonkey -s /bin/sh -c "nice" 2>&1|less
...
getpriority(PRIO_PROCESS, 0)            = 20
setpriority(PRIO_PROCESS, 0, 12)        = 0
...
execve("/bin/su", ["/bin/su", "mldonkey", "-s", "/bin/sh", "-c", "nice"], [/* 
59 vars */]) = 0
...
open("/etc/security/limits.conf", O_RDONLY|O_LARGEFILE) = 3
...
setpriority(PRIO_PROCESS, 0, 0)         = 0



----------  Forwarded Message  ----------

Subject: Re: mldonkey.init
Date: Saturday 15 January 2005 16:36
From: Elan Ruusamäe <glen at pld-linux.org>
To: Grzegorz Konopko <kolodko1 at o2.pl>

great!
it doesn't work.
does su, or initlog reset nice level?

+ nice -n +12 initlog -c /bin/su mldonkey -s /bin/sh -c " echo -n
nice:;nice;cd ~mldonkey && exec /usr/bin/mlnetd > /var/log/mldonkey.log
2>&1&"
+ 2>&1
+ errors=+ USER=root HOME=/tmp TMPDIR=/tmp
nice:0
+ [ -n  -a -n  ]
+ log_success echo -n nice:;nice;cd ~mldonkey && exec /usr/bin/mlnetd

> /var/log/mldonkey.log 2>&1 startup

+ ok

On Saturday 15 January 2005 16:07, Elan Ruusamäe wrote:
> hi
>
> daemon() function, from rc-scripts, see /etc/rc.d/init.d/functions
>
> On Saturday 15 January 2005 12:27, Grzegorz Konopko wrote:
> > Hi.
> >
> > Where is read of  $SERVICE_RUN_NICE_LEVEL ??
> >
> > http://cvs.pld-linux.org/cgi-bin/cvsweb/SOURCES/mldonkey.init?r1=1.17&r2=
> >1. 18

--
glen

-------------------------------------------------------

-- 
glen




More information about the pld-devel-en mailing list