mirror of
https://git.FreeBSD.org/ports.git
synced 2024-10-20 20:09:11 +00:00
Improve RC scripts. The previous script didn't check if the process
was already running before attempting to start a new one (or if it was running before stopping it). This improved version does the necessary checks. Pointed out by: Radim Kolar PR: ports/74512 Submitted by: maintainer
This commit is contained in:
parent
34b40822ef
commit
6614218c46
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=123331
@ -7,6 +7,7 @@
|
||||
|
||||
PORTNAME= dnetc
|
||||
PORTVERSION= ${VERSION}
|
||||
PORTREVISION= 1
|
||||
PORTEPOCH= 1
|
||||
CATEGORIES= misc
|
||||
MASTER_SITES= ftp://ftp.distributed.net/pub/dcti/%SUBDIR%/ \
|
||||
|
@ -23,14 +23,22 @@ stop_cmd="${name}_stop"
|
||||
|
||||
dnetc_start()
|
||||
{
|
||||
echo -n " dnetc"
|
||||
su -m ${user} -c "${dir}/dnetc -quiet" 2>/dev/null >/dev/null
|
||||
if ps -U${user} >/dev/null; then
|
||||
echo "${name} already running?"
|
||||
else
|
||||
su -m ${user} -c "${dir}/${name} -quiet" >/dev/null 2>&1
|
||||
echo -n " ${name}"
|
||||
fi
|
||||
}
|
||||
|
||||
dnetc_stop()
|
||||
{
|
||||
su -m ${user} -c "${dir}/dnetc -shutdown" 2>/dev/null >/dev/null
|
||||
echo -n " dnetc"
|
||||
if ps -U${user} >/dev/null; then
|
||||
su -m ${user} -c "${dir}/${name} -shutdown" >/dev/null 2>&1
|
||||
echo -n " ${name}"
|
||||
else
|
||||
echo "${name} not running?"
|
||||
fi
|
||||
}
|
||||
|
||||
load_rc_config $name
|
||||
|
Loading…
Reference in New Issue
Block a user