Quote:
Originally Posted by Didier Spaier
Else you could just "ln -s /bin/su /bin/runuser" as suggested in this thread.
|
There's something not quite correct with that approach.
With the symlink:
Code:
root@testbed:~# /etc/rc.d/rc.mongodb start
Starting mongod: No directory, logging in with HOME=/
[ OK ]
Without the symlink and my suggested version:
Code:
root@testbed:~# /etc/rc.d/rc.mongodb start
Starting mongod: [ OK ]
The command line handling between runuser and su is not exactly the same. That's why I'm replacing
Code:
$nice runuser -s /bin/bash - $user -c "$corelimit >/dev/null 2>&1 ; $*"
with
Code:
$nice su -s /bin/bash $user -c "$corelimit >/dev/null 2>&1 ; $*"
Note the omitted dash.
It may well be the case that the "su" code looks to see what name was used to invoke it and attempts to act accordingly. (I haven't bothered to look since this is a problem encountered when solving another problem.) If that's the case, the attempt appears to not be working 100%. I find the error message troubling but haven't checked to see what the ramifications are. The daemon in question appears to be otherwise running correctly.
I didn't quote it, but your comment about users that install PAM would have a problem with this change is a fair point.
FWIW, I've looked at a current CentOS system (well, we use RedHat at work damn it) and the current versions of the functions file contains cgroup support which I should think those users would also miss.
Since the symlink approach appears to work (despite the error message), I'll mark this as SOLVED.