etckeeper fails on commit, if "hostname -f" returns error ("hostname: Unknown host")

Bug #377265 reported by Daniel Hahler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
etckeeper (Debian)
Fix Released
Unknown
etckeeper (Ubuntu)
Fix Released
Low
Thierry Carrez

Bug Description

Binary package hint: etckeeper

When using a hostname, which is not valid(?) for "hostname -f", e.g. "localhost.localdomain", etckeeper's commit hook fails.

I think it should fallback to using only "hostname" then.

This happens for me, when I mount my root filesystem from a Live CD (Ubuntu Hardy) and then trigger etckeeper to commit something to /etc.

TESTCASE:
# hostname foobarbaz
# etckeeper commit
ignored 79 file(s).
If you wish to add some of these files, please add them by name.
hostname: Unknown host
# echo $?
1

Daniel Hahler (blueyed)
description: updated
Revision history for this message
Thierry Carrez (ttx) wrote :

commit.d/50vcs-commit should indeed fallback to using hostname if hostname -f fails.

Changed in etckeeper (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Thierry Carrez (ttx) wrote :

Something like

- hostname=`hostname -f`
+ hostname=`hostname -f 2>/dev/null || hostname`

should do it.

Changed in etckeeper (Ubuntu):
status: Confirmed → Triaged
Thierry Carrez (ttx)
Changed in etckeeper (Ubuntu):
assignee: nobody → Thierry Carrez (ttx)
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package etckeeper - 0.37ubuntu1

---------------
etckeeper (0.37ubuntu1) karmic; urgency=low

  * Merge from debian unstable, remaining changes:
    - etckeeper.conf, debian/control: default to bzr
  * debian/postinst: Do the initial commit at installation time (LP: #297920)
  * commit.d/50vcs-commit: Avoid etckeeper commit failure if 'hostname -f'
    fails (LP: #377265)
  * debian/cron.daily: Avoid cron emails with daily autocommits if VCS=hg
    (LP: #364344)

etckeeper (0.37) unstable; urgency=low

  * Make postinst check for the configured VCS before trying to run
    etckeeper init. Closes: #530497
  * Update French debconf translation. Closes: #530795
  * Fix typo in cruft file. Closes: #530819
  * Update Portuguese debconf translation. Closes: #528109
  * Update German debconf translation. Closes: #532346

etckeeper (0.36) unstable; urgency=low

  * Add cruft ignore file. Closes: #522513
  * Update Japanese debconf translation. Closes: #527921
  * Update Swedish debconf translation. Closes: #528575
  * Update Russian debconf translation. Closes: #528798

etckeeper (0.35) unstable; urgency=low

  * Make etckeeper uninit -f disable the prompt.
  * Uninit on purge, guarded by a debconf prompt. Closes: #527218

 -- Thierry Carrez <email address hidden> Tue, 16 Jun 2009 11:02:03 +0200

Changed in etckeeper (Ubuntu):
status: In Progress → Fix Released
Changed in etckeeper (Debian):
status: Unknown → New
Changed in etckeeper (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.