mirror of
https://git.freebsd.org/ports.git
synced 2025-07-17 09:19:15 -04:00
Conditionally take advantage of the new get_pidfile_from_conf in rc.subr
PR: ports/156594 Submitted by: me Approved by: maintainer
This commit is contained in:
parent
75b07ada89
commit
38d15fa6e8
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=273409
2 changed files with 15 additions and 2 deletions
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
PORTNAME= slim
|
PORTNAME= slim
|
||||||
PORTVERSION= 1.3.2
|
PORTVERSION= 1.3.2
|
||||||
PORTREVISION= 1
|
PORTREVISION= 2
|
||||||
CATEGORIES= x11
|
CATEGORIES= x11
|
||||||
MASTER_SITES= ${MASTER_SITE_BERLIOS} \
|
MASTER_SITES= ${MASTER_SITE_BERLIOS} \
|
||||||
http://depot.fsck.ch/mirror/distfiles/
|
http://depot.fsck.ch/mirror/distfiles/
|
||||||
|
|
|
@ -30,12 +30,23 @@ load_rc_config $name
|
||||||
|
|
||||||
command=%%PREFIX%%/bin/slim
|
command=%%PREFIX%%/bin/slim
|
||||||
command_args="-d"
|
command_args="-d"
|
||||||
pidfile=/var/run/slim.pid
|
|
||||||
|
find_pidfile()
|
||||||
|
{
|
||||||
|
if type get_pidfile_from_conf >/dev/null 2>&1 &&
|
||||||
|
get_pidfile_from_conf lockfile %%PREFIX%%/etc/${name}.conf; then
|
||||||
|
pidfile="$_pidfile_from_conf"
|
||||||
|
else
|
||||||
|
pidfile="/var/run/${name}.pid"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
slim_rmfile ()
|
slim_rmfile ()
|
||||||
{
|
{
|
||||||
local file
|
local file
|
||||||
|
|
||||||
|
[ -z "$pidfile" ] && find_pidfile
|
||||||
|
|
||||||
for file in $pidfile /var/run/slim.auth; do
|
for file in $pidfile /var/run/slim.auth; do
|
||||||
[ -e "$file" ] && unlink $file
|
[ -e "$file" ] && unlink $file
|
||||||
done
|
done
|
||||||
|
@ -47,6 +58,8 @@ slim_prestop ()
|
||||||
{
|
{
|
||||||
local xpid
|
local xpid
|
||||||
|
|
||||||
|
find_pidfile
|
||||||
|
|
||||||
xpid=`ps -axww | grep '/bin/[X] .* -auth /var/run/slim.auth'`
|
xpid=`ps -axww | grep '/bin/[X] .* -auth /var/run/slim.auth'`
|
||||||
xpid="${xpid## }"
|
xpid="${xpid## }"
|
||||||
[ -n "$xpid" ] && kill ${xpid%% *}
|
[ -n "$xpid" ] && kill ${xpid%% *}
|
||||||
|
|
Loading…
Add table
Reference in a new issue