[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#567240: script fails without configuration file

Tags: patch

Attached is a patch for the halevt initscript which checks for the
config file to exist before starting halevt. It only checks for the
default location where the Debian package installs the config file
(/etc/halevt/halevt.xml) but not the other places halevt allows to store
the config file ($HOME/.halevt and /usr/share/halevt) which I guess is

One note though: I was not able to reproduce the bug here with a fresh
install of halevt 0.1.5-3 on sid:

  tklauser@krypton:~ % sudo apt-get install halevt
  Reading package lists... Done
  Building dependency tree
  Reading state information... Done
  The following NEW packages will be installed
  0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
  Need to get 0B/59.8kB of archives.
  After this operation, 307kB of additional disk space will be used.
  Selecting previously deselected package halevt.
  (Reading database ... 109185 files and directories currently installed.)
  Unpacking halevt (from .../halevt_0.1.5-3_i386.deb) ...
  Processing triggers for readahead-fedora ...
  Processing triggers for man-db ...
  Processing triggers for install-info ...
  Setting up halevt (0.1.5-3) ...
  Creating a user 'halevt'...
  adduser: Warning: The home directory `/var/lib/halevt' does not belong to the user you are currently creating.
  Starting halevt daemon: OK.
  sudo apt-get install halevt  4.39s user 1.10s system 77% cpu 7.087 total
  tklauser@krypton:~ %

Cheers, Tobias

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-rc5-tk.krypton (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages halevt depends on:
ii  adduser                  3.112           add and remove users and groups
ii  dpkg                   Debian package management system
ii  hal                      0.5.14-2        Hardware Abstraction Layer
ii  install-info             4.13a.dfsg.1-5  Manage installed documentation in 
ii  libboolstuff-0.1-0       0.1.12-3        library for operating on boolean e
ii  libc6                    2.10.2-5        Embedded GNU C Library: Shared lib
ii  libdbus-1-3              1.2.16-2        simple interprocess messaging syst
ii  libdbus-glib-1-2         0.82-2          simple interprocess messaging syst
ii  libglib2.0-0             2.22.4-1        The GLib library of C routines
ii  libhal1                  0.5.14-2        Hardware Abstraction Layer - share
ii  libxml2                  2.7.6.dfsg-2+b1 GNOME XML library

halevt recommends no packages.

halevt suggests no packages.

-- no debconf information
Index: halevt-0.1.5/halevt-initscript
--- halevt-0.1.5.orig/halevt-initscript	2010-01-31 20:02:38.000000000 +0100
+++ halevt-0.1.5/halevt-initscript	2010-01-31 22:55:33.000000000 +0100
@@ -34,7 +34,9 @@
 [ -e /etc/default/halevt ] && . /etc/default/halevt
 halevt_start() {
-    if [ "$START_DAEMON" = "yes" ]; then
+    if [ ! -e /etc/halevt/halevt.xml ]; then
+        log_warning_msg "Not starting halevt daemon; configuration file missing"
+    elif [ "$START_DAEMON" = "yes" ]; then
 	echo -n "Starting halevt daemon: "
 	start-stop-daemon --start --oknodo --pidfile $PIDFILE \

Reply to: