LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-26-2007, 09:48 PM   #1
MQMan
Member
 
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 14.1
Posts: 581

Rep: Reputation: 38
"su -s" in script, different behaviour between distros


I've just installed Slack 12, which now contains /etc/rc.d/init.d/functions, to be a little more compatible with scripts written for RH. However, the daemon function isn't working. The strange thing is, I can use exactly the same command in RH, and it does work.

I patched around both version, so that exactly the same command was issued in each environment, taken from a trace, from a script run by root:

+ su -s /bin/bash - eddie -c '/home/eddie/runfunc.sh /boot'

In RH, this works. But in Slack, it starts another bash shell, and I have to reply "exit" to get the script to continue, and it doesn't issue the command.

The shell used in both environments, for root, and eddie is the same, so I'm at a loss as to why one works, and the other doesn't.

Any ideas.

Cheers,
Eddie
 
Old 09-27-2007, 04:02 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,336

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by MQMan View Post
The shell used in both environments, for root, and eddie is the same, so I'm at a loss as to why one works, and the other doesn't.
Eddie
Different distributions set different levels of security on the use of su. You can change how su security works in /etc/pam.d/su.

----------------
Steve Stites
 
Old 09-27-2007, 08:04 PM   #3
MQMan
Member
 
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 14.1
Posts: 581

Original Poster
Rep: Reputation: 38
I don't think it's security related, as the script is running as root.

If I try running the same commands directly from the command line, I get the same results. In RH, the "runfunc.sh" script runs. In Slack, I get another shell prompt.

If I remove the "-s /bin/bash", then I get an error "No Shell", because the user I'm trying to run this process under has /sbin/nologon as their shell.

Cheers.
 
  


Reply



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
bash script: using "select" to show multi-word options? (like "option 1"/"o zidane_tribal Programming 7 12-19-2015 01:03 AM
Shell Script: Find "Word" Run "Command" granatica Linux - Software 5 07-25-2007 07:42 AM
How to write a bash script to replace all "KH" to "K" in file ABC??? cqmyg5 Slackware 4 07-24-2007 09:00 AM
Can't install "glibmm" library. "configure" script can't find "sigc++-2.0&q kornerr Linux - General 4 05-10-2005 02:32 PM
Monthly Archiving Script... help with "date" & "cron" Supp0rtLinux Linux - Software 3 01-03-2003 09:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:49 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration