Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
slapos
Commits
78cb1683
Commit
78cb1683
authored
Sep 23, 2024
by
Thomas Gambier
🚴🏼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stack/monitor: more robust httpd wrapper
This is a fixup of
nexedi/slapos!1418
parent
ffbc9bc2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
stack/monitor/buildout.hash.cfg
stack/monitor/buildout.hash.cfg
+1
-1
stack/monitor/templates/template-monitor-httpd-wrapper.sh.in
stack/monitor/templates/template-monitor-httpd-wrapper.sh.in
+9
-1
No files found.
stack/monitor/buildout.hash.cfg
View file @
78cb1683
...
...
@@ -22,7 +22,7 @@ md5sum = 0540fc5cc439a06079e9e724a5a55a70
[template-monitor-httpd-wrapper]
_update_hash_filename_ = templates/template-monitor-httpd-wrapper.sh.in
md5sum =
45929a22527b71620555326f4dd78c34
md5sum =
0e2adaa78ba05fd80be3a88cb90499dc
[monitor-template-wrapper]
_update_hash_filename_ = templates/wrapper.in
...
...
stack/monitor/templates/template-monitor-httpd-wrapper.sh.in
View file @
78cb1683
...
...
@@ -9,8 +9,8 @@ if [ -f "$pid_file" ]; then
pid=$(cat "$pid_file")
result=$(ps aux | grep "^\S*\s*$pid\s")
# The process with the specified PID is running
if [ -n "$result" ]; then
# The process with the specified PID is running
echo "there is a process running with the same pid"
# Get the command line of the process and replace null characters with spaces
cmdline=$(tr '\0' ' ' < "/proc/$pid/cmdline")
...
...
@@ -21,6 +21,14 @@ if [ -f "$pid_file" ]; then
echo "The process is not running with the monitor_httpd_conf"
rm -f {{ pid_file }};
fi
else
# No process is running with this PID. If we do nothing, httpd should
# be able to start. However, we already experienced some case where
# httpd was not able to recover. For example, a thread with TID equal
# to PID would lead to a failure from httpd to start. So we "help"
# httpd by removing the file proactively.
echo "No process is running with PID $pid, removing the pid file"
rm -f {{ pid_file }};
fi
fi
...
...
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