[Bug 221951] hostname does not update /etc/rc.conf with new hostname

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 221951] hostname does not update /etc/rc.conf with new hostname

bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221951

            Bug ID: 221951
           Summary: hostname does not update /etc/rc.conf with new
                    hostname
           Product: Base System
           Version: 11.1-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: arm
          Assignee: [hidden email]
          Reporter: [hidden email]

When I change the hostname of a server using "hostname NewHostName", the
hostname entry in /etc/rc.conf is not updated to reflect the new name.

This is likely to be highly confusing to both newbies and users with no
previous experience with this behaviour.

The script fragment below will do the job. And it might be executed from the
hostname program, but it might not be paranoid enough since it contains no
error detection.

nl=$'\n'
rcCont=`grep -v "^hostname=" /etc/rc.conf`
rcCont="${rcCont}${nl}hostname=\"NewHostName\"${nl}"
echo "${rcCont}" > /etc/rc.conf

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 221951] hostname does not update /etc/rc.conf with new hostname

bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221951

Emmanuel Vadot <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|New                         |Closed
                 CC|                            |[hidden email]
         Resolution|---                         |Not A Bug

--- Comment #1 from Emmanuel Vadot <[hidden email]> ---
This is intended.
Please see sysrc(8) to configure hostname or other rc.conf variable.

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[hidden email]"