aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorpgollucci <pgollucci@FreeBSD.org>2009-12-10 13:07:07 +0800
committerpgollucci <pgollucci@FreeBSD.org>2009-12-10 13:07:07 +0800
commit4a5f8b43c6abb66734a9c8569727299fdf00b745 (patch)
treec341ad20e3c050ad8a42b347d99f872f54477fa6 /mail
parente61461bca3513127dd6cbfdab28d4e165c06eda7 (diff)
downloadfreebsd-ports-gnome-4a5f8b43c6abb66734a9c8569727299fdf00b745.tar.gz
freebsd-ports-gnome-4a5f8b43c6abb66734a9c8569727299fdf00b745.tar.zst
freebsd-ports-gnome-4a5f8b43c6abb66734a9c8569727299fdf00b745.zip
Apply the following fixes to the rc.d script
- contains a typo - does not daemonize the process by default - does not check if the process is currently running - does not provide output to STDOUT on start-up, shutdown, or when errors are encountered PR: ports/141330 Submitted by: Glen Barber <glen.j.barber@gmail.com>
Diffstat (limited to 'mail')
-rw-r--r--mail/p5-qpsmtpd/files/qpsmtpd.in25
1 files changed, 23 insertions, 2 deletions
diff --git a/mail/p5-qpsmtpd/files/qpsmtpd.in b/mail/p5-qpsmtpd/files/qpsmtpd.in
index 7ec7533403b6..2c6866ff4a17 100644
--- a/mail/p5-qpsmtpd/files/qpsmtpd.in
+++ b/mail/p5-qpsmtpd/files/qpsmtpd.in
@@ -68,12 +68,33 @@ start_precmd()
start_cmd()
{
- eval $command -p $qpsmtpd_port -c $qpsmtpd_max_connections -u $qpsmtpd_users -m $qpsmtpd_max_per_ip -l $qpsmtpd_listen_on --pid-file $pidfile
+ if [ -e $pidfile ]; then
+ echo "$name already running as PID `cat $pidfile`."
+ exit 1
+ else
+ eval $command \
+ -p $qpsmtpd_port \
+ -c $qpsmtpd_max_connections \
+ -u $qpsmtpd_user \
+ -m $qpsmtpd_max_per_ip \
+ -l $qpsmtpd_listen_on \
+ --pid-file $pidfile \
+ -d \
+ && echo "$name started as PID `cat $pidfile`." \
+ || echo "Failed to start $name"
+ fi
}
stop_cmd()
{
- kill `cat $pidfile`
+ if [ -e $pidfile ]; then
+ kill `cat $pidfile` \
+ && echo "$name stopped." \
+ || echo "Could not stop `cat $pidfile`."
+ else
+ echo "Cannot find $pidfile - $name not running?"
+ exit 1
+ fi
}
run_rc_command "$1"