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
2 changed files with 13 additions and 4 deletions
|
@ -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 a new issue