LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices

Reply
 
Search this Thread
Old 01-06-2007, 05:24 PM   #1
noir911
Member
 
Registered: Apr 2004
Location: Baltimore, MD
Posts: 681

Rep: Reputation: Disabled
[OpenBSD] change myname w/o restarting box


I changed the host name in "/etc/myname" but the change would not take effect unless and until I restart the box as this file is read by netstart(1) during startup.

Is there any way to get the change take effect without rebooting the box?
 
Old 01-06-2007, 05:40 PM   #2
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: Ubuntu, FreeBSD, NetBSD
Posts: 1,449

Rep: Reputation: 47
As root:
Code:
hostname `cat /etc/myname`
You may need to log-out and back in, to see it in your prompt (if you have it set as part of your prompt)... but that command will change it. You don't "need" to log-out, I personally have it as part of my prompt and usually want that accurate so I will.

It's actually the command run by the netstart script to set it in the first place.

Last edited by frob23; 01-06-2007 at 05:41 PM.
 
Old 01-07-2007, 01:56 AM   #3
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 69
Hmm, it's possible that
Code:
# sh /etc/netstart if0
could work too. What frob23 posted works absolutely fine, but re-running netstart for your particular device helps out in other cases where you edit your /etc/hostname.if0 file and want to apply the changes without necessarily doing all the steps with ifconfig, etc.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RAM error restarting box kaplis Linux - Hardware 2 09-18-2006 02:38 AM
change from Clone to LeftOf mode without restarting X server malo_umoran Slackware 1 11-24-2005 06:34 PM
how do i install- [myname@localhost ~]$ i dont know what to enter here fabiocnr Linux - General 3 10-16-2005 11:01 AM
[OpenBSD 3.7] console change noir911 *BSD 2 08-03-2005 05:11 PM
Can't change the address of rl0 on OpenBSD 3.3 coldy *BSD 11 07-25-2004 10:06 PM


All times are GMT -5. The time now is 03:21 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration