Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: TerryJC on December 22, 2010, 08:53:07 AM
-
Hi,
I want to run a script that sets the hostname of a running TC instance after boot up. However, to avoid conflicts on the network, I would like to do this before networking is started. I am remastering TC to give me a custom Live Disc, so I can change things in the image if need be. Can anyone tell me:
- When TC boots, networking is enabled. How do I get TC to boot with networking ready, but not running?
- If I cannot start without networking, how can I stop it? I've tried all the commands that work on other systems (eg, 'service network stop', '/etc/init.d/networking stop') and they don't seem to work.
- Having stopped it; how can I start it again?
- Is there a better way to do what I want?
Apart from that, I couldn't find a way to start and stop httpd. Can this be done?
-
something like...
killall udhcpc && ifconfig <if> downifconfig <if> up && udhcpc -i <if>
assuming you want to use dhcpc
Have you had a look at all boot codes?
If so, what would be the reason of using a script to set host?
Questions regarding "httpd" would better fit in a TCE subforum, while specifiying extension in question ;)
-
Hmmm. I thought I'd responded to this. Must have forgotten to hit 'Post' ::)
something like...
killall udhcpc && ifconfig <if> downifconfig <if> up && udhcpc -i <if>
assuming you want to use dhcpc
Since posting, I I had come to the conclusion that I would have to kill something and take the IF down. I'd rather not do that if possible.
Have you had a look at all boot codes?
Yes. I don't think there is one for networking, other than nodhcp.
If so, what would be the reason of using a script to set host?
I want to have multiple boxes booting simultaneously from several TC Live discs. If they all have the same hostname, it could be very confusing.
On the other hand, if they have unique hostnames, I should be able to surf to a webserver running on each one by typing http://<hostname> into any browser on the same subnet.
I'm now wondering if it would work if I booted the live disc with nodhcp set, assigned the hostname and then brought up DHCP. Any thoughts anyone?
Questions regarding "httpd" would better fit in a TCE subforum, while specifiying extension in question ;)
Yes I know. I was trying to kill two birds with one stone...
I used kill in the end.
-
There's a bootcode to set the hostname.
-
There's a bootcode to set the hostname.
But then I would need an individual disc for each computer or have the boot ups attended by the user. If this all works, we may be booting hundreds of boxes, maybe from a netboot. I need these boots to be largely unattended, so I can access the data for each box from a remote machine.
-
Files of interest:
- running hostname
- /etc/hostname
- sethostname (tc-functions)
-
PXE netboot can have seperate config files per machine.
-
PXE netboot can have seperate config files per machine.
Thanks. That's useful to know.
-
I want to have multiple boxes booting simultaneously from several TC Live discs. If they all have the same hostname, it could be very confusing.
On the other hand, if they have unique hostnames, I should be able to surf to a webserver running on each one by typing http://<hostname> into any browser on the same subnet.
Why use hostnames?
I never had the slightest issue of boxes on same subnet having same hostname communicating with each other, based on IP.
(u)dhcp(c/d) takes care of unique IPs.
-
Why use hostnames?
I never had the slightest issue of boxes on same subnet having same hostname communicating with each other, based on IP.
(u)dhcp(c/d) takes care of unique IPs.
Because most DHCP servers will record the hostname of each device together with the allocated IP address. This means that I can browse to an automatically generated web page simply by typing 'http://<hostname>' instead of 'http://<IP Address>'. Since I will have control of the hostnames through my scripts, (but little control of the IP addresses allocated), I will know which physical machine's page I am viewing.