On Tue, Aug 24, 2010 at 12:44:21AM +0200, Petter Reinholdtsen wrote:
> Package: nbd-server
> Version: 1:2.9.11-3
> Tags: patch
> User: [email protected]
> UserTags: debian-edu
>
> When booting a machine with the nbd-server package installed, like the
> Debian Edu thin-client-server, the boot see these messages:
>
> tjener:~# /etc/init.d/nbd-server start
>
> ** (process:25232): WARNING **: Could not parse config file: Could not open
> config file.
> ** Message: Nothing to do! Bye!
> nbd-server.
> tjener:~#
You're not the first one to note that, and the message has been changed
in the past to look slightly less scary. Apparently not enough, though.
> --- /etc/init.d/nbd-server 2009-01-31 04:10:15.000000000 +0100
> +++ /tmp/nbd-server 2010-08-24 00:40:03.592753608 +0200
> @@ -32,8 +32,10 @@
>
> case "$1" in
> start)
> - start-stop-daemon --start --quiet --exec /bin/nbd-server --oknodo
> --pidfile /var/run/nbd-server.pid
> - echo " $NAME."
> + if [ -r /etc/nbd-server/config ] ; then
> + start-stop-daemon --start --quiet --exec /bin/nbd-server
> --oknodo --pidfile /var/run/nbd-server.pid
> + echo " $NAME."
> + fi
> ;;
> stop)
> echo -n "Stopping $DESC:"
That sounds like the wrong approach. Instead, I'm applying this patch:
diff --git a/nbd-server.c b/nbd-server.c
index 2d73079..2e3a673 100644
--- a/nbd-server.c
+++ b/nbd-server.c
@@ -2097,8 +2097,11 @@ int main(int argc, char *argv[]) {
}
if(!servers || !servers->len) {
- g_warning("Could not parse config file: %s",
- err ? err->message : "Unknown error");
+ if(err && !(err->domain == g_quark_from_string("parse_cfile")
+ && err->code == CFILE_NOTFOUND)) {
+ g_warning("Could not parse config file: %s",
+ err ? err->message : "Unknown error");
+ }
}
if(serve) {
g_warning("Specifying an export on the command line is
deprecated.");
@@ -2106,7 +2109,7 @@ int main(int argc, char *argv[]) {
}
if((!serve) && (!servers||!servers->len)) {
- g_message("Nothing to do! Bye!");
+ g_message("No configured exports; quitting.");
exit(EXIT_FAILURE);
}
daemonize(serve);
i.e., don't show the 'Could not open config file' message, and make the
other message slightly less... strange.
--
The biometric identification system at the gates of the CIA headquarters
works because there's a guard with a large gun making sure no one is
trying to fool the system.
http://www.schneier.com/blog/archives/2009/01/biometrics.html
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]