-
Notifications
You must be signed in to change notification settings - Fork 11
add sample.pbuild.omi #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
JumpingYang001
left a comment
There was a problem hiding this 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" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 | ||
|
|
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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` | ||
|
|
There was a problem hiding this comment.
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 | ||
|
|
There was a problem hiding this comment.
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 | |||
|
|
|||
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
ce723af to
964a3e4
Compare
…sed to omi build environment setting
964a3e4 to
b21e594
Compare
No description provided.