Package: lastfmsubmitd
Version: 0.35-3
Severity: normal
Tags: upstream patch

Hello.

The lastfmsubmitd daemon does not close its file descriptors after
forking, thus when run from cron (eg. @reboot), it makes the cron
process that invokes it unable to finish. A patch to fix this is
attached.

Cheers,

-- 
Adeodato Simó                                     dato at net.com.org.es
Debian Developer                                  adeodato at debian.org
 
Judge a man by his questions rather than by his answers.
                -- Voltaire
--- /usr/bin/lastfmsubmitd	2007-05-21 20:46:46.000000000 +0200
+++ bin/lastfmsubmitd	2007-08-23 12:36:37.000000000 +0200
@@ -363,11 +363,17 @@
                 sys.exit(0)
             else:
                 conf.write_pidfile()
+                devnull = os.open('/dev/null', os.O_RDONLY)
+                os.dup2(devnull, sys.stdin.fileno())
+                os.close(sys.stdout.fileno())
+                os.close(sys.stderr.fileno())
+                os.close(devnull)
         except OSError, e:
             print >>sys.stderr, "lastfmsubmitd: can't fork: %s" % e
             sys.exit(1)
 
     log = lastfm.logger('lastfmsubmitd', conf.log_path, debug, stderr)
+    os.dup2(1, 2)
 
     try:
         log.info('Starting')

Reply via email to