Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Warden
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pavel Valach
Warden
Commits
2c5c43fa
Commit
2c5c43fa
authored
13 years ago
by
Tomáš Plesník
Browse files
Options
Downloads
Patches
Plain Diff
doplneny exit stavy do funkce status; prejmenovany funkce start, stop, status
parent
1dbe3da4
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
src/warden-server/bin/wardend
+13
-12
13 additions, 12 deletions
src/warden-server/bin/wardend
with
13 additions
and
12 deletions
src/warden-server/bin/wardend
+
13
−
12
View file @
2c5c43fa
...
...
@@ -50,7 +50,7 @@ LOCK_FILE="/var/lock/warden-server"
SCRIPTNAME
=
`
basename
"
$0
"
`
# check if daemon is present and executable
test
-x
$DAEMON
||
exit
0
test
-x
$DAEMON
||
exit
1
if
[
$UID
-ne
0
]
;
then
echo
"You must be root for runnnig this script!"
...
...
@@ -63,8 +63,7 @@ usage() {
}
check_status
()
{
/bin/ps axo pid,comm |
grep
-q
"warden-server*"
;
RET_VAL
=
`
echo
$?
`
if
[
$RET_VAL
-eq
0
]
;
then
if
/bin/ps axo pid,comm |
grep
-q
"warden-server*"
;
then
STATUS
=
1
# true - warden is running
else
STATUS
=
0
# false - warden is not running
...
...
@@ -76,7 +75,7 @@ get_pid() {
return
$PID
}
warden_
start
()
{
start
()
{
check_status
if
[
$STATUS
-eq
1
]
;
then
get_pid PID
...
...
@@ -90,7 +89,7 @@ warden_start() {
fi
}
warden_
stop
()
{
stop
()
{
check_status
if
[
$STATUS
-eq
1
]
;
then
logger
-s
"Stopping Warden server daemon ..."
...
...
@@ -98,7 +97,7 @@ warden_stop() {
PID
=
`
cat
$PID_FILE
`
kill
-1
$PID
rm
-f
$LOCK_FILE
logger
-s
"Warden server daemon
is stopped (pid
$PID
)
."
logger
-s
"Warden server daemon
(pid
$PID
) is stopped
."
else
echo
"Unable to stop Warden server daemon. Try to use:
$SCRIPTNAME
force-stop"
fi
...
...
@@ -107,17 +106,19 @@ warden_stop() {
fi
}
warden_
status
()
{
status
()
{
check_status
if
[
$STATUS
-eq
1
]
;
then
get_pid PID
echo
"Warden daemon is running (pid
$PID
)."
exit
0
else
echo
"Warden daemon is NOT running."
exit
1
fi
}
warden_
force_stop
()
{
force_stop
()
{
check_status
if
[
$STATUS
-eq
1
]
;
then
logger
-s
"Force stopping Warden server daemon ..."
...
...
@@ -134,16 +135,16 @@ warden_force_stop() {
case
$1
in
status
)
warden_
status
status
;;
start
)
warden_
start
start
;;
stop
)
warden_
stop
stop
;;
force-stop
)
warden_
force_stop
force_stop
;;
restart
)
$0
stop
...
...
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