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
ff80fad3
Commit
ff80fad3
authored
13 years ago
by
Tomáš Plesník
Browse files
Options
Downloads
Patches
Plain Diff
zmena exit statusu pro testu spustitelnosti; zmena nazvu funkci
parent
23e3eebe
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/warden-server/bin/wardend
+11
-10
11 additions, 10 deletions
src/warden-server/bin/wardend
with
11 additions
and
10 deletions
src/warden-server/bin/wardend
+
11
−
10
View file @
ff80fad3
...
@@ -50,7 +50,7 @@ LOCK_FILE="/var/lock/warden-server"
...
@@ -50,7 +50,7 @@ LOCK_FILE="/var/lock/warden-server"
SCRIPTNAME
=
`
basename
"
$0
"
`
SCRIPTNAME
=
`
basename
"
$0
"
`
# check if daemon is present and executable
# check if daemon is present and executable
test
-x
$DAEMON
||
exit
1
test
-x
$DAEMON
||
exit
0
if
[
$UID
-ne
0
]
;
then
if
[
$UID
-ne
0
]
;
then
echo
"You must be root for runnnig this script!"
echo
"You must be root for runnnig this script!"
...
@@ -63,7 +63,8 @@ usage() {
...
@@ -63,7 +63,8 @@ usage() {
}
}
check_status
()
{
check_status
()
{
if
/bin/ps axo pid,comm |
grep
-q
"warden-server*"
;
then
/bin/ps axo pid,comm |
grep
-q
"warden-server*"
;
RET_VAL
=
`
echo
$?
`
if
[
$RET_VAL
-eq
0
]
;
then
STATUS
=
1
# true - warden is running
STATUS
=
1
# true - warden is running
else
else
STATUS
=
0
# false - warden is not running
STATUS
=
0
# false - warden is not running
...
@@ -75,7 +76,7 @@ get_pid() {
...
@@ -75,7 +76,7 @@ get_pid() {
return
$PID
return
$PID
}
}
start
()
{
warden_
start
()
{
check_status
check_status
if
[
$STATUS
-eq
1
]
;
then
if
[
$STATUS
-eq
1
]
;
then
get_pid PID
get_pid PID
...
@@ -89,7 +90,7 @@ start() {
...
@@ -89,7 +90,7 @@ start() {
fi
fi
}
}
stop
()
{
warden_
stop
()
{
check_status
check_status
if
[
$STATUS
-eq
1
]
;
then
if
[
$STATUS
-eq
1
]
;
then
logger
-s
"Stopping Warden server daemon ..."
logger
-s
"Stopping Warden server daemon ..."
...
@@ -106,7 +107,7 @@ stop() {
...
@@ -106,7 +107,7 @@ stop() {
fi
fi
}
}
status
()
{
warden_
status
()
{
check_status
check_status
if
[
$STATUS
-eq
1
]
;
then
if
[
$STATUS
-eq
1
]
;
then
get_pid PID
get_pid PID
...
@@ -118,7 +119,7 @@ status() {
...
@@ -118,7 +119,7 @@ status() {
fi
fi
}
}
force_stop
()
{
warden_
force_stop
()
{
check_status
check_status
if
[
$STATUS
-eq
1
]
;
then
if
[
$STATUS
-eq
1
]
;
then
logger
-s
"Force stopping Warden server daemon ..."
logger
-s
"Force stopping Warden server daemon ..."
...
@@ -135,16 +136,16 @@ force_stop() {
...
@@ -135,16 +136,16 @@ force_stop() {
case
$1
in
case
$1
in
status
)
status
)
status
warden_
status
;;
;;
start
)
start
)
start
warden_
start
;;
;;
stop
)
stop
)
stop
warden_
stop
;;
;;
force-stop
)
force-stop
)
force_stop
warden_
force_stop
;;
;;
restart
)
restart
)
$0
stop
$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