[13614] in Athena Bugs

home help back first fref pref prev next nref lref last post

sun4 [7.7R]: /etc/init.d/athena WRT /etc/nofoo and echo

daemon@ATHENA.MIT.EDU (jweiss@MIT.EDU)
Wed Jun 28 15:21:03 1995

From: jweiss@MIT.EDU
Date: Wed, 28 Jun 1995 15:20:52 -0400
To: bugs@MIT.EDU
Cc: jweiss@MIT.EDU


System name:		the-other-woman
Type and version:	SPARC/Classic 7.7R
Display type:		cgthree

What were you trying to do?
	figure out whether I'd left a message in /etc/noremote on my
	sun, so I cat'd the file.


What went wrong?
	47 blank lines were desplayed.


What should have happened?
	/etc/init.d/athena shouldn't insert a blank line into
	/etc/no{remote,create,attach} (It will if the file is supposed
	to exist)


Yo, got any documentation, or other info?
	It looks like the person who ported the script from older
platforms cpoied the relevant section and removed the '-n' because it
is well known that echo on the sun doesn't support the -n option.
However, this results in a blank line being added to these files every
time the machine boots.

Here's a patch that should solve the problem:

*** /etc/init.d/athena	Fri Jan  6 06:40:06 1995
--- /tmp/athena	Wed Jun 28 15:18:12 1995
***************
*** 266,284 ****
  
  echo  "Fixing noattach, nocreate, noremote, and nologin..."	>/dev/console
  if [ "${NOCREATE}" = "true" ]; then
! 	echo "" >> /etc/nocreate
  else
  	rm -f /etc/nocreate
  fi
  
  if [ "${NOATTACH}" = "true" ]; then
! 	echo  "" >> /etc/noattach
  else
  	rm -f /etc/noattach
  fi
  
  if [ "${NOREMOTE}" = "true" ]; then
!         echo  "" >> /etc/noremote
  else
          rm -f /etc/noremote
  fi
--- 266,284 ----
  
  echo  "Fixing noattach, nocreate, noremote, and nologin..."	>/dev/console
  if [ "${NOCREATE}" = "true" ]; then
! 	echo "\c" >> /etc/nocreate
  else
  	rm -f /etc/nocreate
  fi
  
  if [ "${NOATTACH}" = "true" ]; then
! 	echo "\c" >> /etc/noattach
  else
  	rm -f /etc/noattach
  fi
  
  if [ "${NOREMOTE}" = "true" ]; then
!         echo "\c" >> /etc/noremote
  else
          rm -f /etc/noremote
  fi
***************
*** 312,322 ****
  	echo "usage: /etc/rc2.d/S90athena {start|stop}"
  	;;
  esac
- 
- 
- 
- 
- 
- 
- 
- 
--- 312,314 ----

home help back first fref pref prev next nref lref last post