Skip to content

Conversation

@BingyuLiu
Copy link
Collaborator

No description provided.

@BingyuLiu BingyuLiu requested review from JumpingYang001, palladia, sarojcare and uashok-zz and removed request for sarojcare and uashok-zz August 17, 2018 19:13
Copy link
Contributor

@JumpingYang001 JumpingYang001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

OS=`uname -s`
mygid=7903
myuid="556"
myuname="jeffcof"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the most part, we don't really care what our uid and gid are. Just let system pick one is ok.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, you can use uid uname options to define what you want.

myhome=/home/$myuname

if [ "$myuid" = "<UID GOES HERE>" -o "$myuname" = "<USERNAME GOES HERE>" ]; then
echo "You need to modify the script with your information"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UID GOES HERE?

# Override default for Solaris
if [ "$OS" = "SunOS" ]; then
myhome=/export/home/$myuname
fi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why force home directory? Useradd will automatically create a home directory. It doesn't matter where.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In SunOS, the user home directory is /export/home/


# Is my group already here?
grep :${mygid}: /etc/group > /dev/null

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't care about gid. Make sure mygrpname is there, not gid.

case "$OS" in
"SunOS"|"AIX" )
useradd -g $mygid -u $myuid -d $myhome -s /bin/bash $myuname
usermod -G staff $myuname

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to add this extra group?


# Check for my username
pwdentrybyname=`grep $myuname /etc/passwd`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

egrep ^${myuname}: /etc/passwd

chown $myuname $myhome
chgrp $mygrpname $myhome
chmod 755 $myhome

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is necessary of if you created the home directory?

@@ -0,0 +1,105 @@
#/bin/bash

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do all our systems have bash? Have you tried /bin/sh and see if this still works?


case "$OS" in
"SunOS"|"AIX" )
useradd -g $mygid -u $myuid -d $myhome -s /bin/bash $myuname

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, I don't think it matters what our uid and gid are, or where our home directory is.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is script used to create account with scxdev group in every platform of pbuild. You can skip to use the script if you want to create an account by yourself. But i tried it, it is convenient, you just cope the script to your server, then run ./addme -uid -uname , that is all.

@BingyuLiu BingyuLiu force-pushed the johnliu-PbuildSeverListForOMI branch from ce723af to 964a3e4 Compare September 21, 2018 22:47
@BingyuLiu BingyuLiu force-pushed the johnliu-PbuildSeverListForOMI branch from 964a3e4 to b21e594 Compare September 21, 2018 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants