Bug 14319

Summary: hostname(1) doesn't mention rc.conf
Product: Documentation Reporter: robert <robert>
Component: Books & ArticlesAssignee: freebsd-doc (Nobody) <doc>
Status: Closed FIXED    
Severity: Affects Only Me CC: robert+freebsd
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description robert 1999-10-14 06:40:01 UTC
Man page mentions rc.network, but doesn't mention that rc.conf and
variable hostname are the correct way to configure the system hostname.

Fix: 

Sorry, no patches, just a confused novice user on my hands who couldn't
figure out how to make the hostname change stick across boots.  :-)

There are probably other man pages that don't mention the preferred way
to configure cross-boot params (such as domainname(1), apmd(3), ...)
Ideally, these should probably all mention rc.conf, and possibly their
relevant parameters.
How-To-Repeat: 
man hostname | grep rc.conf
Comment 1 wdr 1999-12-21 00:37:51 UTC
Here's a patch:

*** hostname.1.old      Mon Dec 20 15:11:53 1999
--- hostname.1  Mon Dec 20 16:33:58 1999
***************
*** 50,55 ****
--- 50,59 ----
  .Pa /etc/rc.network ,
  normally run at boot
  time.
+ The preferred method of setting the hostname is by defining the variable
+ .Va hostname
+ in
+ .Pa /etc/rc.conf .
  .Pp
  Options:
  .Bl -tag -width flag
***************
*** 58,64 ****
  name.
  .El
  .Sh SEE ALSO
! .Xr gethostname 3
  .Sh HISTORY
  The
  .Nm
--- 62,69 ----
  name.
  .El
  .Sh SEE ALSO
! .Xr gethostname 3 , 
! .Xr rc.conf 5
  .Sh HISTORY
  The
  .Nm
Comment 2 John Baldwin freebsd_committer freebsd_triage 1999-12-21 01:47:14 UTC
On 21-Dec-99 William Richard wrote:
> The following reply was made to PR docs/14319; it has been noted by GNATS.
>
>  Here's a patch:
>  
>  *** hostname.1.old      Mon Dec 20 15:11:53 1999
>  --- hostname.1  Mon Dec 20 16:33:58 1999
>  ***************
>  *** 50,55 ****
>  --- 50,59 ----
>    .Pa /etc/rc.network ,
>    normally run at boot
>    time.
>  + The preferred method of setting the hostname is by defining the variable
>  + .Va hostname
>  + in
>  + .Pa /etc/rc.conf .

How about this wording:

The hostname should be set by defining the
.Va hostname
variable in
.Pa /etc/rc.conf .

- or -

The preferred method of setting the hostname is defining the variable
.Va hostname
in
.Pa /etc/cr.conf .

I don't think 'by defining...' is a valid direct object, it needs to be an
infinitive (IIRC), i.e. 'to define' or a gerund, i.e. 'defining'.  (I may have
the terms messed up, but I believe the examples are accurate).

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.cslab.vt.edu/~jobaldwi/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/
Comment 3 wdr 1999-12-21 01:52:23 UTC
Whoops!  This diff should point to src/bin/hostname/hostname.1.
Darn.
Comment 4 wdr 1999-12-21 02:52:54 UTC
How about this:

*** src/bin/hostname/hostname.1.old     Sun Aug 29 07:12:37 1999
--- src/bin/hostname/hostname.1 Mon Dec 20 18:46:18 1999
***************
*** 51,56 ****
--- 51,61 ----
  normally run at boot
  time.
  .Pp
+ The canonical way to define the hostname at boot time is with the
+ .Va hostname
+ variable in
+ .Pa /etc/rc.conf .
+ .Pp
  Options:
  .Bl -tag -width flag
  .It Fl s
***************
*** 58,64 ****
  name.
  .El
  .Sh SEE ALSO
! .Xr gethostname 3
  .Sh HISTORY
  The
  .Nm
--- 63,70 ----
  name.
  .El
  .Sh SEE ALSO
! .Xr gethostname 3 ,
! .Xr rc.conf 5
  .Sh HISTORY
  The
  .Nm
Comment 5 Robert Watson 1999-12-21 03:34:50 UTC
Wow, I'd forgotten about that PR. :-)  Is this solution committed?  If
not, I'll go ahead and do that.

On Mon, 20 Dec 1999, William Richard wrote:

> Here's a patch:
> 
> *** hostname.1.old      Mon Dec 20 15:11:53 1999
> --- hostname.1  Mon Dec 20 16:33:58 1999
> ***************
> *** 50,55 ****
> --- 50,59 ----
>   .Pa /etc/rc.network ,
>   normally run at boot
>   time.
> + The preferred method of setting the hostname is by defining the variable
> + .Va hostname
> + in
> + .Pa /etc/rc.conf .
>   .Pp
>   Options:
>   .Bl -tag -width flag
> ***************
> *** 58,64 ****
>   name.
>   .El
>   .Sh SEE ALSO
> ! .Xr gethostname 3
>   .Sh HISTORY
>   The
>   .Nm
> --- 62,69 ----
>   name.
>   .El
>   .Sh SEE ALSO
> ! .Xr gethostname 3 , 
> ! .Xr rc.conf 5
>   .Sh HISTORY
>   The
>   .Nm
> 


  Robert N M Watson 

robert@fledge.watson.org              http://www.watson.org/~robert/
PGP key fingerprint: AF B5 5F FF A6 4A 79 37  ED 5F 55 E9 58 04 6A B1
TIS Labs at Network Associates, Safeport Network Services
Comment 6 John Baldwin freebsd_committer freebsd_triage 1999-12-22 01:30:35 UTC
State Changed
From-To: open->closed

Fix was committed in rev 1.10.