summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/hostid
Commit message (Collapse)AuthorAgeFilesLines
* Revert r282672.delphij2015-05-111-1/+1
| | | | | | | tr is in /usr and not available at the time hostid is run (must be run before FILESYSTEMS). Reported by: def
* Always convert uuid to lower case.delphij2015-05-081-1/+1
| | | | MFC after: 2 weeks
* Generate new UUID if system UUID is known bad or malformed and add a twodelphij2015-04-271-8/+56
| | | | | | | seconds sleep if we found the system UUID be invalid. Obtained from: FreeNAS MFC after: 2 weeks
* Replace ${SYSCTL_W} with ${SYSCTL} in rc.d scripts, as they are identical.emaste2011-03-301-2/+2
| | | | | | This is a further clean up after r202988. SYSCTL_W is still initialized in rc.subr as some ports may still use it.
* This change does the following for the scripts that run up throughdougb2010-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FILESYSTEMS (the default early_late_divider): 1. Move sysctl to run first 2. Move as many BEFOREs to REQUIREs as possible. 3. Minor effect, move hostid_save from right before mdconfig to right after. A lot of the early scripts make use of sysctl one way or another so running this first makes a lot of sense given that system-critical values are often placed in sysctl.conf. My original purpose for working on this was that while doing some debugging on other stuff I noticed that the order of execution was different in the first pass through the early scripts and the second. In practice that doesn't matter because the scripts are not executed the second time. However this _can_ result in problems if the difference in the rcorder moves a script from the late section to the early section in the second pass (which would mean the script would not get executed). So, I wanted to make the order of execution of the scripts in the early section more deterministic. In the course of debugging the ordering problems I noticed that moving the BEFOREs to REQUIREs prevented the changes in order from the first pass to the second pass without having to make any substantial changes. (Of course it's no secret that I think BEFORE should be avoided as much as possible, but this is a good example of why.) Reviewed by: silence on freebsd-rc@ MFC after: 8.1-RELEASE
* In regards to the "Starting foo:" type messages at boot time, create anddougb2009-10-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | employ a more generic solution, and use it in the individual rc.d scripts that also have an $rc_quiet test: 1. Add check_startmsgs() to rc.subr. 2. In the rc.d scripts that use rc_quiet (and rc.subr) substitute variations of [ -z "$rc_quiet" ] with check_startmsgs 3. In savecore add a trailing '.' to the end of the message to make it more consistent with other scripts. 4. In newsyslog remove a : before the terminal '.' since we do not expect there to be anything printed out in between to make it more consistent. 5. In the following scripts change "quotes" to 'quotes' where no variables exist in the message: savecore pf newsyslog 6. In the following scripts substitute if/then/fi for the simpler (and more consistent) check_startmsgs &&: faith stf 7. In the following scripts separate the "Starting foo:" from the terminal '.' to make them more consistent: moused hostname pf 8. In nfsclient move the message to its own line to avoid a style bug 9. In pf rc_quiet does not apply to the _stop method, so remove the test there. 10. In motd add 'quotes' around the terminal '.' for consistency
* Currently there is a problem with fscking UFS file systems created onpjd2009-07-291-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | top of ZVOLs. The problem is that rc.d/fsck runs before rc.d/zfs. The latter makes ZVOLs to appear in /dev/. In such case rc.d/fsck cannot find devfs entry and aborts. We cannot simply move rc.d/zfs before rc.d/fsck, because we first want kern.hostid to be configured (by rc.d/hostid). If we won't wait (hostid will be 0) we can reuse disks which are in use by different systems (eg. in SAN/NAS environment). We also cannot move rc.d/hostid before rc.d/fsck, because rc.d/hostid on first system start stores generated kern.hostuuid in /etc/hostid file, so it needs root file system to be mounted read-write. The fix is to split rc.d/hostid so that rc.d/hostid (which will now run before rc.d/fsck) only generates hostid and sets up sysctls, but doesn't touch root file system and rc.d/hostid_save (which is run after rc.d/root) and only creates /etc/hostid file. With that in place, we can move ZVOL initialization to dedicated rc.d/zvol script which runs before rc.d/fsck. PR: conf/120194 Reported by: James Snow <snow@teardrop.org> Reviewed by: brooks Approved by: re (kib) MFC after: 2 weeks
* As previously discussed, add the svn:executable property to all scriptsdougb2008-07-161-0/+0
|
* Move a lot of diagnostic output behind $rc_quiet in scripts thatmtm2008-06-231-2/+4
| | | | implement their own start command.
* Specify the full path to the md5(1) binary so the script willmtm2008-05-061-1/+1
| | | | | | | still work even if it's not in the shell's path. PR: conf/122215 MFC after: 1 week
* Shorter equivalent of the command.ru2008-01-241-1/+1
|
* backout filter of Nil UUID as the boot loader code already filters out Nil ↵rse2007-05-221-4/+0
| | | | UUIDs (see src/sys/boot/i386/libi386/smbios.c:smbios_setuuid for details)
* Remove the ugly csh(1) based UUID lower-case translation hack fromrse2007-05-221-1/+0
| | | | | | /etc/rc.d/hostid now that we switched the origin of the UUID (variable smbios.system.uuid as provided by the i386 BIOS code) to already provide a standard conforming lower-case UUID text representation.
* Cleanup style by consistently using braces around variable expansion andrse2007-05-211-1/+5
| | | | | apply an addition from Andrew Thompson <thompsa> for filtering out the special "Nil" UUID (all zeros) which would be a useless host UUID.
* Adjust UUID lower-case translation from straight-forward tr(1)rse2007-05-211-1/+2
| | | | | | | | | | usage to an equivalent csh(1) usage as tr(1) stays in /usr/bin and /etc/rc.d/hostid has just the root filesystem (and this way mainly the tools in /bin) available. I've chosen csh(1) here as the string manipulation tools available in /bin is extremely limited and the (only) alternative ed(1) usage would have been a lot more complicated or even might require a temporary file.
* The standardized textual representation of UUIDs according to RFC 4122rse2007-05-211-2/+2
| | | | | | | | and ISO/IEC-9834-8:2005 is with LOWER-CASE hexadecimal characters only, so translate the (usually upper-case and this way not conforming) representation of the BIOS UUID when reading it. Also be more strict about the valid characters in the textual representation by checking for just the hexadecimal characters.
* If available, take UUID from smbios.system.uuid, if not fall back topjd2007-04-111-1/+18
| | | | | | | | | software-generated UUID. Store the result in /etc/hostid and use it in the future. Perform simple UUID format check, as there is a lot of hardware with broken UUIDs. The check should be improved to also eliminate fake UUIDs like 00000000-0000-0000-0000-000000000000. Requested by: many
* Add rc.d/hostid script (turned on by default) which on first boot generatespjd2007-04-091-0/+80
UUID and stores it in /etc/hostid ($hostid_file) as well as sets kern.hostuuid and kern.hostid sysctls on every boot. Hostid can be reset using '/etc/rc.d/hostid reset' command. Hostid generation and setting can be turned off by setting variable hostid_enable to "NO" in /etc/rc.conf. Reviewed by: mlaier, rink, brooks, rwatson
OpenPOWER on IntegriCloud