Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-stable
Commits
b24c1841
Commit
b24c1841
authored
Aug 30, 2005
by
Russ Fish
Browse files
Work around a passwd file error that only appears on the pc3000.
parent
3433fa8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
tmcd/cygwinxp/liblocsetup.pm
View file @
b24c1841
...
...
@@ -12,7 +12,7 @@ package liblocsetup;
use
Exporter
;
@ISA
=
"
Exporter
";
@EXPORT
=
qw (
$
RM
$CHOWN
$MOUNT
$UMOUNT
$CP
$L
N
$CHMOD
$
T
OU
CH
$EGREP
qw (
$
CP
$LN
$RM
$MV
$TOUCH
$EGREP
$CHOW
N
$CHMOD
$
M
OU
NT
$UMOUNT
$NTS
$NET
$HOSTSFILE
$TMPASSWD
$SFSSD
$SFSCD
$RPMCMD
os_account_cleanup
os_accounts_start
os_accounts_end
os_accounts_sync
...
...
@@ -53,12 +53,13 @@ use librc;
$CP
=
"
/bin/cp
";
$LN
=
"
/bin/ln
";
$RM
=
"
/bin/rm
";
$MV
=
"
/bin/mv
";
$TOUCH
=
"
/bin/touch
";
$EGREP
=
"
/bin/egrep -q
";
$CHOWN
=
"
/bin/chown
";
$CHMOD
=
"
/bin/chmod
";
$TOUCH
=
"
/bin/touch
";
$MOUNT
=
"
/bin/mount
";
$UMOUNT
=
"
/bin/umount
";
$EGREP
=
"
/bin/egrep -q
";
# Cygwin.
$MKPASSWD
=
"
/bin/mkpasswd
";
...
...
@@ -198,10 +199,24 @@ sub os_accounts_sync()
# Apply the users' shell preferences.
$cmd
.=
"
| sed -f
$usershellsfile
"
if
(
-
e
$usershellsfile
);
$cmd
.=
"
> /etc/passwd
";
$cmd
.=
"
> /etc/passwd.new
";
##print "$cmd\n";
if
(
system
("
$cmd
")
!=
0
)
{
warning
("
Could not generate /etc/password.new file: $!
\n
");
return
-
1
;
}
# Work around "/etc/passwd: Device or resource busy".
$cmd
=
"
$MV
/etc/passwd /etc/passwd.prev
";
##print "$cmd\n";
if
(
system
("
$cmd
")
!=
0
)
{
warning
("
Could not
$cmd
$!
\n
");
return
-
1
;
}
$cmd
=
"
$MV
/etc/passwd.new /etc/passwd
";
##print "$cmd\n";
if
(
system
("
$cmd
")
!=
0
)
{
warning
("
Could not
generate /etc/password file:
$!
\n
");
warning
("
Could not
$cmd
$!
\n
");
return
-
1
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment