Bugzilla – Attachment 120702 Details for
Bug 12169
Improve reliability of sip_shutdown script
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12169: Use pid file in sipserver shutdown
Bug-12169-Use-pid-file-in-sipserver-shutdown.patch (text/plain), 2.91 KB, created by
Kyle M Hall (khall)
on 2021-05-07 15:20:20 UTC
(
hide
)
Description:
Bug 12169: Use pid file in sipserver shutdown
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2021-05-07 15:20:20 UTC
Size:
2.91 KB
patch
obsolete
>From cf1dd2065cacab3cb6e0e22641c64452ee8a9ac0 Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Thu, 1 May 2014 15:17:44 +0100 >Subject: [PATCH] Bug 12169: Use pid file in sipserver shutdown > >Change sample SIPConfig to request server writes a pid file > >Use this pid in shutdown rather than the current open to error >method. > >Have also added to the Config parameters to ensure that the sipserver >runs as the correct user and sets its own session id. These are always >useful but makes it easier for users to run up the sipserver as root at >boot time similarly to apache, mysql etc > >Added to the sample config where to locate other server parameter >documentation. > >Removed from the sample config the unedifying, unwanted and >purely historical http example > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > etc/SIPconfig.xml | 9 ++++++++- > misc/bin/sip_shutdown.sh | 19 +++++-------------- > 2 files changed, 13 insertions(+), 15 deletions(-) > >diff --git a/etc/SIPconfig.xml b/etc/SIPconfig.xml >index 4277004f00..f30fbf6f9c 100644 >--- a/etc/SIPconfig.xml >+++ b/etc/SIPconfig.xml >@@ -5,6 +5,10 @@ > <!-- > Set Net::Server::PreFork runtime parameters > syslog_ident will identify SIP2 Koha server entries in syslog >+ See documentation for Net::Server >+ user and group select what user the service should run as >+ if started as root (e.g. in server startup ) the server will switch to >+ this user after binding to the socket it is listening on > For OpenSolaris, add: syslog_logsock=stream > --> > <server-params >@@ -13,6 +17,10 @@ > log_file='Sys::Syslog' > syslog_ident='koha_sip' > syslog_facility='local6' >+ setsid="1" >+ user='koha' >+ group='koha' >+ pid_file='/var/run/sipserver.pid' > /> > > <listeners> >@@ -121,4 +129,3 @@ in our case "ILS". > <AllFinesNeedOverride>0</AllFinesNeedOverride> > </syspref_overrides> > >-</acsconfig> >diff --git a/misc/bin/sip_shutdown.sh b/misc/bin/sip_shutdown.sh >index 07abbce3f1..3545df9c92 100755 >--- a/misc/bin/sip_shutdown.sh >+++ b/misc/bin/sip_shutdown.sh >@@ -1,19 +1,10 @@ > #!/bin/bash > >-. $HOME/.bash_profile >+#Terminates the session leader Sipserver which should terminate the children >+# The pidfile name is specified as a server parameter in the configuration >+# file > >-# this is brittle: the primary server must have the lowest PPID >-# this is brittle: ps behavior is very platform-specific, only tested on Debian Etch >+PID_FILE=/var/run/sipserver.pid > >-target="SIPServer"; >-PROCPID=$(ps x -o pid,ppid,args --sort ppid | grep "$target" | grep -v grep | head -1 | awk '{print $1}'); >+kill `cat $PID_FILE` > >-if [ ! $PROCPID ] ; then >- echo "No processes found for $target"; >- exit; >-fi >- >-echo "SIP Processes for this user ($USER):"; >-ps x -o pid,ppid,args --sort ppid | grep "$target" | grep -v grep ; >-echo "Killing process #$PROCPID"; >-kill $PROCPID; >-- >2.24.3 (Apple Git-128)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12169
:
27878
|
99533
|
119001
| 120702 |
120703