Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
nginx
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nginx
nginx
Commits
febb8ab3
Commit
febb8ab3
authored
12 years ago
by
Kartik Mistry
Browse files
Options
Downloads
Patches
Plain Diff
#695374: nginx.init doesn't check start-stop-daemon exit status
parent
5c0ba7c2
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
debian/nginx-common.nginx.init
+35
-35
35 additions, 35 deletions
debian/nginx-common.nginx.init
with
35 additions
and
35 deletions
debian/nginx-common.nginx.init
+
35
−
35
View file @
febb8ab3
...
...
@@ -26,58 +26,66 @@ set -e
.
/lib/lsb/init-functions
PID
=
$(
awk
-F
'[ ;]'
'/[^#]pid/ {print $2}'
/etc/nginx/nginx.conf
)
if
[
-z
"
$PID
"
]
then
PID
=
/run/nginx.pid
fi
# Check if the ULIMIT is set in /etc/default/nginx
if
[
-n
"
$ULIMIT
"
]
;
then
# Set the ulimits
ulimit
$ULIMIT
fi
test_nginx_config
()
{
if
$DAEMON
-t
$DAEMON_OPTS
>
/dev/null 2>&1
;
then
ret
urn
0
else
$DAEMON
-t
$DAEMON_OPTS
return
$?
fi
$DAEMON
-t
$DAEMON_OPTS
>
/dev/null 2>&1
ret
var
=
$?
if
[
$retvar
-ne
0
]
then
exit
$retvar
fi
}
start
()
{
test_nginx_config
# Check if the ULIMIT is set in /etc/default/nginx
if
[
-n
"
$ULIMIT
"
]
;
then
# Set the ulimits
ulimit
$ULIMIT
fi
log_daemon_msg
"Starting
$DESC
"
"
$NAME
"
start-stop-daemon
--start
--quiet
--pidfile
/run/
$NAME
.pid
\
--retry
5
--exec
$DAEMON
--
$DAEMON_OPTS
||
true
log_end_msg
$?
start-stop-daemon
--start
--quiet
--pidfile
$PID
\
--retry
5
--exec
$DAEMON
--oknodo
--
$DAEMON_OPTS
}
stop
()
{
log_daemon_msg
"Stopping
$DESC
"
"
$NAME
"
start-stop-daemon
--stop
--quiet
--pidfile
/run/
$NAME
.pid
\
--retry
5
--exec
$DAEMON
||
true
log_end_msg
$?
start-stop-daemon
--stop
--quiet
--pidfile
$PID
\
--retry
5
--oknodo
--exec
$DAEMON
}
case
"
$1
"
in
start
)
test_nginx_config
log_daemon_msg
"Starting
$DESC
"
"
$NAME
"
start
log_end_msg
$?
;;
stop
)
log_daemon_msg
"Stopping
$DESC
"
"
$NAME
"
stop
log_end_msg
$?
;;
restart|force-reload
)
log_daemon_msg
"Restarting
$DESC
"
test_nginx_config
log_daemon_msg
"Restarting
$DESC
"
"
$NAME
"
stop
sleep
1
start
log_end_msg
0
log_end_msg
$?
;;
reload
)
log_daemon_msg
"Reloading
$DESC
configuration..."
test_nginx_config
start-stop-daemon
--stop
--signal
HUP
--quiet
--pidfile
/run/
$NAME
.pid
\
--exec
$DAEMON
||
true
log_end_msg 0
log_daemon_msg
"Reloading
$DESC
configuration"
"
$NAME
"
start-stop-daemon
--stop
--signal
HUP
--quiet
--pidfile
$PID
\
--oknodo
--exec
$DAEMON
log_end_msg
$?
;;
configtest|testconfig
)
...
...
@@ -91,15 +99,7 @@ case "$1" in
;;
status
)
status_of_proc
-p
/run/
$NAME
.pid
"
$DAEMON
"
nginx
&&
exit
0
||
exit
$?
status
=
$?
if
[
$status
-eq
0
]
;
then
log_success_msg
"
$DESC
is running"
else
log_failure_msg
"
$DESC
is not running"
fi
exit
$status
status_of_proc
-p
$PID
"
$DAEMON
"
nginx
;;
*
)
...
...
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