Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
6394b8f4
Commit
6394b8f4
authored
7 years ago
by
Arno Schoenmakers
Browse files
Options
Downloads
Patches
Plain Diff
TAsk #11022, #10902: Fixing swlevel for cobalt
parent
9d68a856
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MAC/APL/APLCommon/src/swlevel
+16
-16
16 additions, 16 deletions
MAC/APL/APLCommon/src/swlevel
with
16 additions
and
16 deletions
MAC/APL/APLCommon/src/swlevel
+
16
−
16
View file @
6394b8f4
...
@@ -238,7 +238,7 @@ start_prog()
...
@@ -238,7 +238,7 @@ start_prog()
fi
fi
# Check if program is already running
# Check if program is already running
/sbin/
pidof
-x
${
prog
}
1>/dev/null 2>&1
pidof
-x
${
prog
}
1>/dev/null 2>&1
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
curdate
=
`
date
+%Y%m%dT%H%M%S
`
curdate
=
`
date
+%Y%m%dT%H%M%S
`
# PVSS needs special treatment
# PVSS needs special treatment
...
@@ -269,7 +269,7 @@ start_prog()
...
@@ -269,7 +269,7 @@ start_prog()
fi
fi
if
[
"
$prog
"
=
"TBBDriver"
]
;
then
if
[
"
$prog
"
=
"TBBDriver"
]
;
then
# Check if RSPDriver is already running; if not, do not start either!
# Check if RSPDriver is already running; if not, do not start either!
/sbin/
pidof RSPDriver 1>/dev/null 2>&1
pidof RSPDriver 1>/dev/null 2>&1
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
echo
"RSPDriver not running, so not starting TBBDriver either"
echo
"RSPDriver not running, so not starting TBBDriver either"
exit
exit
...
@@ -292,7 +292,7 @@ start_prog()
...
@@ -292,7 +292,7 @@ start_prog()
$BINDIR
/
$prog
1>>
$LOGDIR
/
$prog
.stdout.
${
curdate
}
2>&1 &
$BINDIR
/
$prog
1>>
$LOGDIR
/
$prog
.stdout.
${
curdate
}
2>&1 &
fi
fi
fi
fi
u
sleep 25
0000
sleep
0.
25
ps
-ef
|
grep
-v
grep
| egrep
'[0-9][0-9] [a-zA-Z0-9/_.]*/'
${
prog
}
ps
-ef
|
grep
-v
grep
| egrep
'[0-9][0-9] [a-zA-Z0-9/_.]*/'
${
prog
}
fi
fi
}
}
...
@@ -321,7 +321,7 @@ stop_prog()
...
@@ -321,7 +321,7 @@ stop_prog()
fi
fi
# get processlist
# get processlist
/sbin/
pidof
-x
${
prog
}
1>/dev/null 2>&1
pidof
-x
${
prog
}
1>/dev/null 2>&1
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
return
return
fi
fi
...
@@ -348,41 +348,41 @@ stop_prog()
...
@@ -348,41 +348,41 @@ stop_prog()
fi
fi
# first try normal kill
# first try normal kill
for
pid
in
`
/sbin/
pidof
-x
${
prog
}
`
for
pid
in
`
pidof
-x
${
prog
}
`
do
do
echo
"Softly killing
${
prog
}
(
${
pid
}
)"
echo
"Softly killing
${
prog
}
(
${
pid
}
)"
$asroot
kill
$pid
1>/dev/null 2>&1
$asroot
kill
$pid
1>/dev/null 2>&1
u
sleep
500000
sleep
0.25
done
done
# when normal kill did not work, kill is with -9
# when normal kill did not work, kill is with -9
for
pid
in
`
/sbin/
pidof
-x
${
prog
}
`
for
pid
in
`
pidof
-x
${
prog
}
`
do
do
echo
"Hard killing
${
prog
}
(
${
pid
}
)"
echo
"Hard killing
${
prog
}
(
${
pid
}
)"
$asroot
kill
-9
$pid
1>/dev/null 2>&1
$asroot
kill
-9
$pid
1>/dev/null 2>&1
u
sleep
500000
sleep
0.25
done
done
# if user0 or lofarsys, try normal kill as root
# if user0 or lofarsys, try normal kill as root
for
pid
in
`
/sbin/
pidof
-x
${
prog
}
`
for
pid
in
`
pidof
-x
${
prog
}
`
do
do
if
[
"
$user
"
==
"user0"
-o
"
$user
"
==
"lofarsys"
]
;
then
if
[
"
$user
"
==
"user0"
-o
"
$user
"
==
"lofarsys"
]
;
then
sudo kill
$pid
1>/dev/null 2>&1
sudo kill
$pid
1>/dev/null 2>&1
u
sleep
50000
sleep
0.25
fi
fi
done
done
# if user0 or lofarsys, try hard kill as root
# if user0 or lofarsys, try hard kill as root
for
pid
in
`
/sbin/
pidof
-x
${
prog
}
`
for
pid
in
`
pidof
-x
${
prog
}
`
do
do
if
[
"
$user
"
==
"user0"
-o
"
$user
"
==
"lofarsys"
]
;
then
if
[
"
$user
"
==
"user0"
-o
"
$user
"
==
"lofarsys"
]
;
then
sudo kill
-9
$pid
1>/dev/null 2>&1
sudo kill
-9
$pid
1>/dev/null 2>&1
u
sleep
50000
sleep
0.25
fi
fi
done
done
# if still alive, write a message
# if still alive, write a message
for
pid
in
`
/sbin/
pidof
-x
${
prog
}
`
for
pid
in
`
pidof
-x
${
prog
}
`
do
do
echo
-n
"Could not kill
${
prog
}
(
${
pid
}
); "
echo
-n
"Could not kill
${
prog
}
(
${
pid
}
); "
if
[
"
$user
"
==
"user0"
-o
"
$user
"
==
"lofarsys"
]
;
then
if
[
"
$user
"
==
"user0"
-o
"
$user
"
==
"lofarsys"
]
;
then
...
@@ -442,9 +442,9 @@ status_prog()
...
@@ -442,9 +442,9 @@ status_prog()
# find out the processID of the possibly (running) process
# find out the processID of the possibly (running) process
obsid
=()
obsid
=()
pid_user
=()
pid_user
=()
/sbin/
pidof
-x
${
prog
}
1>/dev/null 2>&1
pidof
-x
${
prog
}
1>/dev/null 2>&1
if
[
$?
-eq
0
]
;
then
if
[
$?
-eq
0
]
;
then
pid
=(
`
/sbin/
pidof
-x
${
prog
}
`
)
pid
=(
`
pidof
-x
${
prog
}
`
)
i
=
0
i
=
0
for
apid
in
${
pid
[@]
}
for
apid
in
${
pid
[@]
}
do
do
...
@@ -522,7 +522,7 @@ goto_level()
...
@@ -522,7 +522,7 @@ goto_level()
# set rcumode to 0 (power save) when entering level 1
# set rcumode to 0 (power save) when entering level 1
if
[
${
newlevel
}
-le
1
]
;
then
if
[
${
newlevel
}
-le
1
]
;
then
if
[
${
curlevel
}
-ge
2
]
;
then
if
[
${
curlevel
}
-ge
2
]
;
then
/sbin/
pidof RSPDriver 1>/dev/null 2>&1
pidof RSPDriver 1>/dev/null 2>&1
if
[
$?
-eq
0
]
;
then
if
[
$?
-eq
0
]
;
then
status
=
`
(
rspctl
--version
|
grep
"0.0"
)
>
& /dev/null
;
echo
$?
`
status
=
`
(
rspctl
--version
|
grep
"0.0"
)
>
& /dev/null
;
echo
$?
`
if
[
$status
==
1
]
;
then
if
[
$status
==
1
]
;
then
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment