PDA

View Full Version : SUGGESTION: Specify hostname cheatcode



cascadefx
05-09-2003, 03:47 PM
I think that it would be great to be able to specificy the hostname that will be reqistered with the DHCP server (and, by extension) Dynamic DNS (if it is configured). Right now, the hostname is knoppix. The way our dynamic DNS is set up, conflicts between hosts with the same name result in the second one being incremented with a -<number>.

So the first one to boot is knoppix.dhcp.example.com. The second conflicts so it is incremented as knoppix-1.dhcp.example.com and so on down the line.

I have handed out so many knoppix discs and our DHCP leases are so long on campus that this is beginning to become a problem.

If I just had the ability to pass the name that I would like to be registered during a bootup cheatcode, I could differentiate my system (so that I can find it when it is in server mode) more easily.

So, Klaus (and everyone else) what do you think?

thanks.

A. Jorge Garcia
05-09-2003, 08:29 PM
I second the motion! I too would find this very useful. How about a cheat to specify a dummy IP address too? Could these setting then be saved with floppyconfig or persistant home?

Regards,

Fabianx
05-11-2003, 03:58 PM
I second the motion! I too would find this very useful. How about a cheat to specify a dummy IP address too? Could these setting then be saved with floppyconfig or persistant home?

Regards,

That is already possible. If zou sue persistent home/config zou an do this.

cu

Fabian

Fabianx
05-11-2003, 04:01 PM
I think that it would be great to be able to specificy the hostname that will be reqistered with the DHCP server (and, by extension) Dynamic DNS (if it is configured). Right now, the hostname is knoppix. The way our dynamic DNS is set up, conflicts between hosts with the same name result in the second one being incremented with a -<number>.

So the first one to boot is knoppix.dhcp.example.com. The second conflicts so it is incremented as knoppix-1.dhcp.example.com and so on down the line.

I have handed out so many knoppix discs and our DHCP leases are so long on campus that this is beginning to become a problem.

If I just had the ability to pass the name that I would like to be registered during a bootup cheatcode, I could differentiate my system (so that I can find it when it is in server mode) more easily.

So, Klaus (and everyone else) what do you think?

thanks.

Thats a great idea:

And its easy to do, in knoppix-autoconfig:

-hostname Knoppix
+HOSTNAME=getbootparam hostname
+if [ -n "$HOSTNAME" ]
+then
+ echo "$HOSTNAME" > /etc/hostname
+ hostname $HOSTNAME
+else
+ hostname Knoppix
+fi

In Pseudo-Diff-Format...

cu

Fabian

cascadefx
05-12-2003, 11:03 PM
Thats a great idea:

And its easy to do, in knoppix-autoconfig:

-hostname Knoppix
+HOSTNAME=getbootparam hostname
+if [ -n "$HOSTNAME" ]
+then
+ echo "$HOSTNAME" > /etc/hostname
+ hostname $HOSTNAME
+else
+ hostname Knoppix
+fi

In Pseudo-Diff-Format...

cu

Fabian

Thanks Fabian.

I will try this out, but a cheatcode would be so much better. It makes the straight CD MUCH more flexible.

testor9
08-16-2003, 09:09 PM
hi, i can change the hostname after booting by 'hostname whatever' as root, but it is not saved in my persistent home dir on /hda1.

i also changed hostname in /etc/init.d/knoppix-autoconfig. that is saved after a reboot, but hostname always stays Knoppix?

i also edited /etc/hostname which is retained through a reboot, but hostname is always Knoppix?

arkaine23
08-20-2003, 02:04 AM
I treid that but it wound up having no hostanme at all, guess the code needs something about checking whether a hostname cheatcode has been entered??

jmcglash
08-21-2003, 06:03 AM
Here is a version that takes advantage of the existing functions in /etc/init.d/knoppix-autoconfig to do the work and will function as a cheatcode.

IN

/etc/init.d/knoppix-autoconfig

CHANGE

# Set hostname
hostname Knoppix

TO

### hostname
# Allow hostname specification via commandline. The default hostname
# will be overridden via "hostname=Knoppix" boot commandline
HOSTNAME="$(getbootparam hostanme 2>/dev/null)"
[ -n "$HOSTNAME" ] || HOSTNAME="Knoppix"

Who feels like testing a remaster?

Fabianx
08-21-2003, 08:02 PM
Here is a version that takes advantage of the existing functions in /etc/init.d/knoppix-autoconfig to do the work and will function as a cheatcode.

IN

/etc/init.d/knoppix-autoconfig

CHANGE

# Set hostname
hostname Knoppix

TO

### hostname
# Allow hostname specification via commandline. The default hostname
# will be overridden via "hostname=Knoppix" boot commandline
HOSTNAME="$(getbootparam hostanme 2>/dev/null)"
[ -n "$HOSTNAME" ] || HOSTNAME="Knoppix"

Who feels like testing a remaster?

Its not necessary to remaster. It should be enough to put this code+some additions into a knoppix.sh, as its sourced by knoppix-autoconfig so functions like getbootparam are available ...

cu

Fabian

A. Jorge Garcia
08-22-2003, 03:26 PM
Just how does this code read "getbootparam"? If I put this in knoppix.sh, will I get a prompt to enter the hostname or do I use some sort of cheatcode at bootup?

BTW, what if I want to set the hostname permanently, can I just specify hostname="alphaCentauri"?

TIA,

arkaine23
08-24-2003, 07:25 AM
I messed around with knoppix auto-config a little. Anytime I remaster with a hostanme other than knoppix, I get Pam errors whenever I su between knoppix and root- saying "unable to get hostname via gethostname"...