Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-stable
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
emulab
emulab-stable
Commits
76eb561c
Commit
76eb561c
authored
Jun 21, 2010
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor tweak so that this script can run inside a VM to prepare it.
parent
6eb7aaf3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
13 deletions
+18
-13
tmcd/linux/prepare
tmcd/linux/prepare
+18
-13
No files found.
tmcd/linux/prepare
View file @
76eb561c
...
...
@@ -29,6 +29,7 @@ my $SFSUSERS = "/etc/sfs/sfs_users";
my
$SFSHOSTKEY
=
"
/etc/sfs/sfs_host_key
";
my
$VARACCTDIR
=
"
/var/account
";
my
$IFTAB
=
"
/etc/iftab
";
my
$ANACRON
=
"
/usr/sbin/anacron
";
#
# Dead wood in $BINDIR
...
...
@@ -68,6 +69,7 @@ if (getopts("N", \%options)) {
$noumount
=
1
;
}
}
my
$isvm
=
((
-
e
"
$ETCDIR
/genvmtype
")
?
1
:
0
);
#
# First clean up the node as it would be if free.
...
...
@@ -90,7 +92,7 @@ foreach my $dbfile (@DBFILES) {
# This allows us to clean up /users and /proj. We only do the cleanup if
# if unmount succeeds and even then, we do it in a safe way.
#
if
(
!
$noumount
&&
-
e
"
/share/freebsd
")
{
if
(
!
(
$noumount
||
$isvm
)
&&
-
e
"
/share/freebsd
")
{
print
"
Unmounting NFS filesystems ...
\n
";
if
(
!
system
("
umount -at nfs
"))
{
#
...
...
@@ -113,19 +115,22 @@ if (!$noumount && -e "/share/freebsd") {
# to send mail will hang and eventually timeout. This makes things take a
# lot longer, so we hack and temporarily move sendmail while we run anacron!
#
if
(
-
x
"
/usr/sbin/sendmail
")
{
my
$didrename
=
0
;
print
"
Running cron jobs (might see failed attempts to mail output).
\n
";
if
(
rename
("
/usr/sbin/sendmail
",
"
/usr/sbin/_sendmail
"))
{
$didrename
=
1
;
}
system
("
anacron -d -f -s -n
");
if
(
$didrename
)
{
rename
("
/usr/sbin/_sendmail
",
"
/usr/sbin/sendmail
");
if
(
-
x
"
$ANACRON
")
{
if
(
-
x
"
/usr/sbin/sendmail
")
{
my
$didrename
=
0
;
print
"
Running cron jobs
"
.
"
(might see failed attempts to mail output).
\n
";
if
(
rename
("
/usr/sbin/sendmail
",
"
/usr/sbin/_sendmail
"))
{
$didrename
=
1
;
}
system
("
$ANACRON
-d -f -s -n
");
if
(
$didrename
)
{
rename
("
/usr/sbin/_sendmail
",
"
/usr/sbin/sendmail
");
}
}
else
{
print
"
Running cron jobs.
\n
";
system
("
$ANACRON
-d -f -s -n
");
}
}
else
{
print
"
Running cron jobs.
\n
";
system
("
anacron -d -f -s -n
");
}
#
...
...
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