flexiondotorg / oab-java6

Create a local 'apt' repository for Sun Java 6 and/or Oracle Java 7 packages.
Other
625 stars 171 forks source link

Package signing fails if the host doesn't have an entry in /etc/hosts #54

Closed skybert closed 11 years ago

skybert commented 12 years ago

But first of all, thanks for a great script!

Now back to the issue at hand: the package signing fails if the host doesn't have an entry in /etc/hosts. Or more specifically, oab-java.sh uses hostname --fqdn, but this doesn't return anything if the host's name (as set in /etc/hostname and returned by a simple hostname) isn't available.

 [x] Create GnuPG configuration hostname: Name or service not known                  
hostname: Name or service not known                          
success
 [x] Start generating entropy success
 [x] Creating signing key failed
 [i] Showing the last 5 lines from the logfile (/tmp/j/oab-java6/oab-java.sh.log)...
 [x] Creating signing key   gpg: keyring `/var/local/oab/gpg/secring.gpg' created
gpg: keyring `/var/local/oab/gpg/pubring.gpg' created
gpg: /var/local/oab/gpg-key.conf:5: missing argument
30511's retcode: 2
failed

I suggest enhancing the script to falling back to simple hostname output in case the hostname --fqdn fails.

Workaround for others that might experience this: simply do:

# echo 127.0.1.1 $HOSTNAME >> /etc/hosts

then remove the directory oab-java.sh created (/var/local/oab) and re-run the script.

Cheers,

-Torstein

jab416171 commented 12 years ago

That should be 127.0.0.1

skybert commented 12 years ago

Why is that important? 127.0.0.1 and 127.0.1.1 works equally well on everything I've thrown at it.

skull-squadron commented 11 years ago

Some operating systems implement a loopback host address only for 127.0.0.1 while others implement the entire 127./8 range, but in either case the range is reserved for that purpose. RFC 3330

Try this on a Mac: ping 127.255.255.254

Then, try it on Linux.