Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jdavidb (1361)

  (email not shown publicly)

J. David Blackstone has a Bachelor of Science in Computer Science and Engineering and nine years of experience at a wireless telecommunications company, where he learned Perl and never looked back. J. David has an advantage in that he works really hard, he has a passion for writing good software, and he knows many of the world's best Perl programmers.

Journal of jdavidb (1361)

Wednesday August 28, 2002
10:56 AM

Violating the hacker ethic

[ #7368 ]

Solaris's files in /etc/init.d are not lazy. They should be. They should not do things more than once.

There should be one file in init.d, run early, to perform the task of determining and setting the system's hostname. Any other startup script that wants to know they hostname should then run the hostname command to get it.

There are multiple scripts in init.d that all duplicate some variant of complicated logic saying, "If I started up with DHCP, then ask DHCP what my hostname is, or if I started up with BOOTP, then ask something else what my hostname is, or ....., or else just set it to 'unknown.'" Everything I'm reading has you modifying several of these scripts (don't they get replaced on upgrades?!?!?!) rather than just setting things in one configuration file.

The annoying thing is that complicated logic winds up asking DHCP what the DHCP server supplied for my hostname. That's a legacy assumption: DHCP is not providing my hostname; instead I'm telling DHCP what I'd like my hostname to be. (This is a relatively new innovation for Solaris and apparently not everyone with commit access to /etc/init.d within Sun has been told.) The dhcpinfo command reports that I have no hostname, even though it would make a lot more sense for it to report the hostname I gave to DHCP. (The logic should be "report the hostname DHCP thinks I have" rather than "report the hostname DHCP gave me if it gave one.") Of course, even better is for all these scripts to just call the hostname command. If hostname has to be determined from dhcpinfo, let it be done one time early on and then set from it.

Solaris culture shock today. :)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • This is System V. Also, you might find [] helpful as, if you are rebooting for dhcp you are doing it wrong.

    • My point is that the scripts in Solaris's /etc/init.d are not well organized compared to Red Hat, Debian, LFS, etc., particularly in the matter of setting the hostname. It would help if some of the people who wrote those scripts knew you could use DHCP to request a hostname.

      if you are rebooting for dhcp you are doing it wrong.

      Yeah, I know. :) Someone ought to tell the guy from Sun who wrote that manpage.

      J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
      • Well, linux isn't System V [ it's -ish but, at least the last time I deigned to soil myself by touching Linux, it's a mismash of variants ] and once you get used to the way Solaris does things, it will make some sort of sense. RH and friends seem disorganised to me :)

        and manpages? Why, when I was young, we didn't have manpages! We had to go into the basement of the computing center to find the troll-like guy who would speak only in binary ;)