LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 03-14-2014, 02:33 PM   #1
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.1
Posts: 1,530

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
Since Slackware doesn't provide the runuser command...


...could the Slackware maintainers change line 226 in /etc/rc.d/init.d/functions from
Code:
$nice runuser -s /bin/bash - $user -c "$corelimit >/dev/null 2>&1 ; $*"
to
Code:
$nice su -s /bin/bash $user -c "$corelimit >/dev/null 2>&1 ; $*"
...?

That line is in the daemon function defined in the file and it just won't work if you attempt to run a service as some user other than root.


This is all coming about from my recompiling mongoDB with SSL support. If anyone else wants to do that, make sure that:
  1. You have 8G of free space available on the partition where you are building it.
  2. You don't attempt to compile the stable version (2.4.9). The current unstable version (2.5.5) compiles just fine and you can tell it to use the system boost and system pcre libraries.
 
Old 03-14-2014, 03:07 PM   #2
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad T61 6457-4XG
Posts: 4,391

Rep: Reputation: 1091Reputation: 1091Reputation: 1091Reputation: 1091Reputation: 1091Reputation: 1091Reputation: 1091Reputation: 1091
Someone *could* want to install runuser (and PAM). Else you could just "ln -s /bin/su /bin/runuser" as suggested in this thread.

Oh, and in the sentence "...could the Slackware maintainers [...]" the plural form is not necessary, as AFAIK there is only one Slackware maintainer
 
1 members found this post helpful.
Old 03-14-2014, 07:09 PM   #3
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.1
Posts: 1,530

Original Poster
Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
Quote:
Originally Posted by Didier Spaier View Post
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.

Last edited by Richard Cranium; 03-14-2014 at 07:13 PM. Reason: Decided to mark as SOLVED.
 
Old 03-14-2014, 08:45 PM   #4
mancha
Member
 
Registered: Aug 2012
Posts: 341

Rep: Reputation: Disabled
Maybe we can default to runuser and fallback to su:

Code:
--- a/etc/init.d/functions
+++ b/etc/init.d/functions
@@ -223,7 +223,8 @@ daemon() {
        if [ -z "$user" ]; then
           $nice /bin/bash -c "$corelimit >/dev/null 2>&1 ; $*"
        else
-          $nice runuser -s /bin/bash - $user -c "$corelimit >/dev/null 2>&1 ; $*"
+          [ -n "$(which runuser 2>/dev/null)" ] && RUNUSERCOMM="runuser -s /bin/bash -" || RUNUSERCOMM="su -s /bin/bash"
+          $nice $RUNUSERCOMM $user -c "$corelimit >/dev/null 2>&1 ; $*"
        fi
        [ "$?" -eq 0 ] && success $"$base startup" || failure $"$base startup"
 }
--mancha
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware 14.1 /etc/init.d/functions runuser not found jabolopes Slackware 2 01-15-2014 11:46 PM
[SOLVED] GDB doesn't provide the correct line in the source code napx Programming 3 01-23-2011 07:16 PM
DHCP doesn't provide fixed addresses newk Linux - Server 1 04-09-2010 02:43 PM
Slackware 10.2 setup command doesn't detect partions User Name. Linux - Newbie 2 09-22-2006 03:51 AM
/sbin/runuser or /bin/runuser davidkline Linux - Newbie 4 02-05-2006 04:16 PM


All times are GMT -5. The time now is 02:08 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration