Index: etc/faxsetup.sh.in
--- etc/faxsetup.sh.in.orig
+++ etc/faxsetup.sh.in
@@ -45,7 +45,7 @@ PATH=/bin:/usr/bin:/etc
 test -d /usr/ucb  && PATH=$PATH:/usr/ucb		# Sun and others
 test -d /usr/bsd  && PATH=$PATH:/usr/bsd		# Silicon Graphics
 test -d /usr/5bin && PATH=/usr/5bin:$PATH:/usr/etc	# Sun and others
-test -d /usr/sbin && PATH=/usr/sbin:$PATH		# 4.4BSD-derived
+test -d /sbin && PATH=/sbin:$PATH			# 4.4BSD-derived
 test -d /usr/local/bin && PATH=$PATH:/usr/local/bin	# for GNU tools
 test -d /usr/gnu/bin && PATH=$PATH:/usr/gnu/bin		# for GNU tools (SCO)
 
@@ -76,8 +76,8 @@ UUENCODE=@UUENCODE@		# uuencode command to dump in set
 
 FAX=@FAXUID@			# identity of the fax user
 SERVICES=/etc/services		# location of services database
-INETDCONF=/usr/etc/inetd.conf	# default location of inetd configuration file
-ALIASES=/usr/lib/aliases	# default location of mail aliases database file
+INETDCONF=/etc/inetd.conf	# default location of inetd configuration file
+ALIASES=/etc/mail/aliases	# default location of mail aliases database file
 PASSWD=/etc/passwd		# where to go for password entries
 PROTOUID=@FAXUID@		# user who's uid we use for FAX user
 defPROTOUID=3			# use this uid if PROTOUID doesn't exist
@@ -1259,34 +1259,67 @@ if onClient; then
 			}	
 		'
 	}
+	genFontmap()
+	{
+	    FONTMAP_FILE=$1
+	    Note ""
+	    Note "Generating Fontmap $FONTMAP_FILE."
+	    Note ""
+
+	    $ECHO "% HylaFAX FontMap file generated by faxsetup on `date 2>/dev/null`" > $FONTMAP_FILE
+	    for d in `$ECHO $2 | $SED 's/:/ /g'`; do
+		if [ -d "$d" ]; then
+		    cd $d
+		    for f in `ls | grep '\.afm'`; do
+			$AWK -F '[ ]' '/FontName/ {print "/"$2"\t("FILENAME")\t;"; exit}; // {}' $f >> $FONTMAP_FILE
+		    done
+		fi
+	    done
+	    if [ -z "`$GREP Courier $FONTMAP_FILE`" ]; then
+	    Note ""
+	    Note "Adding aliases to Fontmap $FONTMAP_FILE."
+	    Note ""
+		$ECHO "" >> $FONTMAP_FILE
+		$ECHO "% Aliases" >> $FONTMAP_FILE
+		$ECHO "" >> $FONTMAP_FILE
+		$ECHO "/Courier		/NimbusMonL-Regu ;" >> $FONTMAP_FILE
+		$ECHO "/Courier-Bold		/NimbusMonL-Bold ;" >> $FONTMAP_FILE
+		$ECHO "/Helvetica		/NimbusSanL-Regu ;" >> $FONTMAP_FILE
+		$ECHO "/Helvetica-Oblique	/NimbusSanL-ReguItal ;" >> $FONTMAP_FILE
+		$ECHO "/Helvetica-Bold		/NimbusSanL-Bold ;" >> $FONTMAP_FILE
+		$ECHO "/Times-Bold		/NimbusRomNo9L-Medi ;" >> $FONTMAP_FILE
+	    fi
+	}
 	# If configure --with-PATH_AFM=<path> was used then we need to include it first.
 	RUNTIME_PATH_AFM=$PATH_AFM:`getGSFonts`
 	if [ -n "$RUNTIME_PATH_AFM" \
 				-a "$RUNTIME_PATH_AFM" != "$PATH_AFM" ]; then 
 	    Note ""
+	    #
+	    # When ghostscript is built with COMPILE_INITS=1, the fonts are compiled in to the ghostscript executable.
+	    # The textfmt(1) program in HylaFAX uses fonts in afm font files.
+	    # The Fontmap.HylaFAX file is created from afm font files found in the paths listed in RUNTIME_PATH_AFM.
+	    #
+	    genFontmap $DIR_SPOOL/etc/Fontmap.HylaFAX $RUNTIME_PATH_AFM
 	    FONTPATHS=`echo $RUNTIME_PATH_AFM | sed 's/:/ /g'`
-	    $PATH_GSRIP -q -sDEVICE=tiffg3 -sFONTPATH="$FONTPATHS" $DIR_SPOOL/bin/genfontmap.ps > $DIR_SPOOL/etc/Fontmap.HylaFAX 2>/dev/null
-	    # Ghostscript 8.71 segfaults on that, but produces a valid Fontmap file, so we don't test exit code, but examine the product, instead.
 	    {
 		#
-		# genfontmap.ps really just gives us a copy of Fontmap.GS, and in later Ghostscript versions there
-		# are many Fontmap.GS references that are left undefined.  This may work for Ghostscript, but 
-		# it does not work for us.  So, we need to do what we can to define them.
-		#
 		fontmap=$DIR_SPOOL/etc/Fontmap.HylaFAX
 		newfontmap=$TMPDIR/Fontmap.HylaFAX.new.$$
 		tmpfile=$TMPDIR/fontmap-fixup.$$
 		$CP $fontmap $newfontmap
 		for fontname in `$CAT $fontmap | $GREP "	/" | $SED -e 's/^[^\/]*\///g' -e 's/ .*//g'`; do 
-		    if [ -z "`$GREP "^($fontname)" $fontmap`" ]; then
+		    if [ -z "`$GREP "^/$fontname" $fontmap`" ]; then
 			# There is a blind reference to this font.  Fix that.
-			for fontpath in `$PATH_GSRIP -h | $GREP -A 100 "Search path:" | $GREP " :" | $SED 's/://g'`; do 
-			    $GREP -l -d recurse -a "FontDirectory/$fontname known" $fontpath 2>/dev/null; 
+			for fontpath in $FONTPATHS; do
+			    $GREP -l -R -U "FontDirectory/$fontname known" $fontpath 2>/dev/null;
 			done | $SED q > $tmpfile
 			fontfile=`$CAT $tmpfile`
 			if [ -n "$fontfile" ]; then
-			    echo "($fontname)	($fontfile) ;" >> $newfontmap
-		        else
+			    $ECHO "/$fontname	($fontfile) ;" >> $newfontmap
+		        fi
+		        fontalias=`$ECHO $fontname | $SED -e 's/^\/*\///g'`
+		        if [ -z "`$GREP "^/$fontalias" $fontmap`" ]; then
 			    echo "Warning: No font file found for \"$fontname\" but the font map includes it."
 			fi
 		    fi
@@ -2425,12 +2458,7 @@ if onServer; then
 
     findproc()
     {
-	# NB: ps ax should give an error on System V, so we try it first!
-	pid="`ps ax 2>/dev/null | $AWK \"\
-		/[\/ (]$1[ )]/	{print \\$1;}
-		/[\/ ]$1\$/	{print \\$1;}\"`"
-	test "$pid" ||
-	    pid="`ps -e 2>/dev/null | $AWK \"/ $1[ ]*\$/ {print \\$1;}\"`"
+    	pid="`/usr/bin/pgrep $1`"
 	echo "$pid"
     }
 
@@ -2446,9 +2474,9 @@ if onServer; then
 	    echo
 	fi
 	if isOK "$x"; then
-	    if [ -x /bin/systemctl ]; then
-		echo "Executing '/bin/systemctl stop hylafax-hfaxd'..."
-		/bin/systemctl stop hylafax-hfaxd
+	    if [ -x /usr/sbin/rcctl ]; then
+		echo "Executing '/usr/sbin/rcctl stop hfaxd'..."
+		/usr/sbin/rcctl stop hfaxd
 	    elif kill $HFAXD; then
 		echo "Sent a SIGTERM to processes $HFAXD."
 	    else
@@ -2497,9 +2525,9 @@ EOF
 	    echo
 	fi
 	if isOK "$x"; then
-	    if [ -x /bin/systemctl ]; then
-		echo "Executing '/bin/systemctl stop hylafax-faxq'..."
-		/bin/systemctl stop hylafax-faxq
+	    if [ -x /usr/sbin/rcctl ]; then
+		echo "Executing '/usr/sbin/rcctl stop faxq'..."
+		/usr/sbin/rcctl stop faxq
 	    else
 		$DIR_SBIN/faxquit >/dev/null 2>&1
 	    fi
@@ -2589,18 +2617,18 @@ EOF
     fi
     if isOK "$x"; then
 	echo ""
-	if [ -x /bin/systemctl ]; then
-	    echo "Executing '/bin/systemctl start hylafax-faxq'..."
-	    /bin/systemctl start hylafax-faxq
-	    echo "Executing '/bin/systemctl start hylafax-hfaxd'..."
-	    /bin/systemctl start hylafax-hfaxd
+	if [ -x /usr/sbin/rcctl ]; then
+	    echo "Executing '/usr/sbin/rcctl start faxq'..."
+	    /usr/sbin/rcctl start faxq
+	    echo "Executing '/usr/sbin/rcctl start hfaxd'..."
+	    /usr/sbin/rcctl start hfaxd
 	elif [ -x ${DIR_SYSVINIT}/hylafax ]; then
 	    echo ${DIR_SYSVINIT}/hylafax start
 	    ${DIR_SYSVINIT}/hylafax start
 	else
 	    echo $DIR_SBIN/faxq; $DIR_SBIN/faxq
 	    hfaxdopts=
-	    if isOK "$HFAXD_SERVER"; then hfaxdopts="-i hylafax "; fi
+	    if isOK "$HFAXD_SERVER"; then hfaxdopts="-f all -l 0.0.0.0 -i hylafax -l ::0 -i hylafax "; fi
 	    if isOK "$HFAXD_SNPP_SERVER"; then hfaxdopts="$hfaxdopts\-s snpp"; fi
 	    echo "$DIR_SBIN/hfaxd $hfaxdopts"; eval "$DIR_SBIN/hfaxd $hfaxdopts"
 	fi
