LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 03-28-2001, 11:10 AM   #1
Copenhagen Cowboy
Member
 
Registered: Mar 2001
Location: D/FW
Posts: 75

Rep: Reputation: 15
Angry


This is really beginning to irritate me.

I have taken the adduser script from Slackware 7.1 and am trying to modify it to work on Red Hat 7. The script will run up to actually making the account. Then I get error:

useradd: invalid numeric argument '-g'

-g is the initial group, which would be "users". What am I doing wrong??
 
Old 03-28-2001, 08:31 PM   #2
crabboy
Moderator
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 120Reputation: 120
I'm not sure what you are doing wrong, but I can suggest a way to debug.

Run the adduser script using bash debug features.

# bash -x adduser

This will display each line of the script as it executes. After you have entered all the required info. Watch for the call to the useradd program. After the script has errored out, type in the useradd command exactly as the script tried to execute it.

Now you can modify the useradd command line until the user gets added. Take the successful parameter sequence and/or format and modify the script write the useradd command that way.

If you really feel that useradd will not take the group command as it should, then download the useradd source and debug it.

Good Luck
 
Old 03-29-2001, 09:55 AM   #3
Copenhagen Cowboy
Member
 
Registered: Mar 2001
Location: D/FW
Posts: 75

Original Poster
Rep: Reputation: 15
I found where the problem lies. When it goes through the command line, it doesn't read the variable for user id. It's leaving that blank. So, it shows the next thing on the line to be "-g" for user id.

The portion of the script for user id reads:

echo
echo -n "User id for $LOGIN [default to next available]: "
read ID
GUID="-u $ID
if [ -z "$ID" ]; then
GUID=""
fi

This is exactly how it is written in Slackware.

Any ideas??
 
Old 03-29-2001, 12:03 PM   #4
Copenhagen Cowboy
Member
 
Registered: Mar 2001
Location: D/FW
Posts: 75

Original Poster
Rep: Reputation: 15
Ok, I've got the script working as long as I actually enter a user id number. It will actually go through and finish the script and make the account, but I would like to have it assign the user number automatically. Is there a way to do that??
 
Old 03-29-2001, 02:01 PM   #5
Copenhagen Cowboy
Member
 
Registered: Mar 2001
Location: D/FW
Posts: 75

Original Poster
Rep: Reputation: 15
FYI

I figured out the problem last mentioned. All I needed to do is add a line in there under if:

ID=""

Once I added that in, it automatically started assigned UID's.

Thanks for the debug command, crabboy. Once I got that, I was able to figure it out.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accept(): Invalid Argument bonhomme Programming 6 07-14-2012 10:12 PM
alsamixer invalid argument subaruwrx Linux - Software 1 03-12-2005 01:34 PM
KDSKBENT: Invalid Argument tommytomato Linux - Newbie 6 08-27-2004 10:23 PM
[ Invalid Argument on 'iptables' ] benleung Linux - Security 1 09-23-2003 12:25 AM
xawtv - invalid argument liguorir Linux - Software 0 06-17-2003 08:55 PM


All times are GMT -5. The time now is 12:31 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