--- remote-tty-4.0.orig/startsrv.sh
+++ remote-tty-4.0/startsrv.sh
@@ -19,7 +19,7 @@
 
 default_options='-b 9600 -w 8 -p none'
 default_sock_prot='ug=rw,o='
-default_sock_owner='root.wheel'
+default_sock_owner='rttymgr:dialout'
 default_log_prot='u=rw,g=r,o='
 
 for host
@@ -28,11 +28,12 @@
 	#
 	# kill any existing ttysrv on this port
 	#
-	if [ -f DESTPATH/pid/$host ]; then
-		pid=`cat DESTPATH/pid/$host`
-		while ps w$pid >/tmp/startsrv$$ 2>&1
+	if [ -f /var/run/remote-tty/pid/$host ]; then
+		pid=`cat /var/run/remote-tty/pid/$host`
+		tmpfile=`mktemp -t`
+		while ps w$pid >$tmpfile 2>&1
 		do
-			grep -q ttysrv /tmp/startsrv$$ && {
+			grep -q ttysrv $tmpfile && {
 				echo -n " $pid killed"
 				kill $pid
 				sleep 1
@@ -40,64 +41,64 @@
 				break
 			}
 		done
-		rm DESTPATH/pid/$host /tmp/startsrv$$
+		rm /var/run/remote-tty/pid/$host $tmpfile
 	fi
 	#
 	# start up a new one
 	#
-	if [ -s DESTPATH/opt/${host}.srv ]; then
-		options=`cat DESTPATH/opt/${host}.srv`
-	elif [ -s DESTPATH/opt/DEFAULT.srv ]; then
-		options=`cat DESTPATH/opt/DEFAULT.srv`
+	if [ -s /etc/remote-tty/opt/${host}.srv ]; then
+		options=`cat /etc/remote-tty/opt/${host}.srv`
+	elif [ -s /etc/remote-tty/opt/DEFAULT.srv ]; then
+		options=`cat /etc/remote-tty/opt/DEFAULT.srv`
 	else
 		options="$default_options"
 	fi
 
-	if [ -s DESTPATH/prot/${host}.sock ]; then
-		sock_prot=`cat DESTPATH/prot/${host}.sock`
-	elif [ -s DESTPATH/prot/DEFAULT.sock ]; then
-		sock_prot=`cat DESTPATH/prot/DEFAULT.sock`
+	if [ -s /etc/remote-tty/prot/${host}.sock ]; then
+		sock_prot=`cat /etc/remote-tty/prot/${host}.sock`
+	elif [ -s /etc/remote-tty/prot/DEFAULT.sock ]; then
+		sock_prot=`cat /etc/remote-tty/prot/DEFAULT.sock`
 	else
 		sock_prot="$default_sock_prot"
 	fi
 
-	if [ -s DESTPATH/owner/${host}.sock ]; then
-		sock_owner=`cat DESTPATH/owner/${host}.sock`
-	elif [ -s DESTPATH/owner/DEFAULT.sock ]; then
-		sock_owner=`cat DESTPATH/owner/DEFAULT.sock`
+	if [ -s /etc/remote-tty/owner/${host}.sock ]; then
+		sock_owner=`cat /etc/remote-tty/owner/${host}.sock`
+	elif [ -s /etc/remote-tty/owner/DEFAULT.sock ]; then
+		sock_owner=`cat /etc/remote-tty/owner/DEFAULT.sock`
 	else
 		sock_owner="$default_sock_owner"
 	fi
 
-	if [ -s DESTPATH/prot/${host}.log ]; then
-		log_prot=`cat DESTPATH/prot/${host}.log`
-	elif [ -s DESTPATH/prot/DEFAULT.log ]; then
-		log_prot=`cat DESTPATH/prot/DEFAULT.log`
+	if [ -s /etc/remote-tty/prot/${host}.log ]; then
+		log_prot=`cat /etc/remote-tty/prot/${host}.log`
+	elif [ -s /etc/remote-tty/prot/DEFAULT.log ]; then
+		log_prot=`cat /etc/remote-tty/prot/DEFAULT.log`
 	else
 		log_prot="$default_log_prot"
 	fi
 
-	rm -f DESTPATH/sock/$host DESTPATH/pid/$host
-	DESTPATH/bin/ttysrv $options \
-		-t DESTPATH/dev/$host \
-		-s DESTPATH/sock/$host \
-		-l DESTPATH/log/$host \
-		-i DESTPATH/pid/$host \
-		> DESTPATH/out/$host 2>&1 &
+	rm -f /var/run/remote-tty/sock/$host /var/run/remote-tty/pid/$host
+	/usr/sbin/ttysrv $options \
+		-t /etc/remote-tty/dev/$host \
+		-s /var/run/remote-tty/sock/$host \
+		-l /var/log/remote-tty/$host/$host \
+		-i /var/run/remote-tty/pid/$host \
+		> /var/log/remote-tty/out/$host 2>&1 &
 	echo -n " "
 	tries=5
-	while [ $tries -gt 0 -a ! -f DESTPATH/pid/$host ]; do
+	while [ $tries -gt 0 -a ! -f /var/run/remote-tty/pid/$host ]; do
 		echo -n "."
 		sleep 1
 		tries=`expr $tries - 1`
 	done
-	if [ ! -f DESTPATH/pid/$host ]; then
+	if [ ! -f /var/run/remote-tty/pid/$host ]; then
 		echo " [startup failed]"
 	else
-		newpid=`cat DESTPATH/pid/$host`
-		chmod $sock_prot DESTPATH/sock/$host
-		chown $sock_owner DESTPATH/sock/$host
-		chmod $log_prot DESTPATH/log/$host
+		newpid=`cat /var/run/remote-tty/pid/$host`
+		chmod $sock_prot /var/run/remote-tty/sock/$host
+		chown $sock_owner /var/run/remote-tty/sock/$host
+		chmod $log_prot /var/log/remote-tty/$host/$host
 		echo " $newpid started"
 	fi
 done
