[darkice] Re: Start on boot

  • From: Niels Dettenbach <nd@xxxxxxxxxxxx>
  • To: darkice@xxxxxxxxxxxxx, "Rafael Diniz" <rafael@xxxxxxxxxx>
  • Date: Tue, 21 Dec 2010 12:10:08 +0100

Am Dienstag 21 Dezember 2010, 11:43:25 schrieb Roland Whitehead: 
> Your init.d script is very similar to my own but I've adopted yours now as 
standard. The only mod I've made is to add "-f" on the rm $pidfile lines 
because it was asking for confirmation before deleting. I also added "($PID)" 
at the end of the warning about the dead PID because I find that useful in 
debugging what is happening.

Yes, this makes full sense - thank you Roland.

@Rafael: Can you upstream the patch (or should / can i do it byself)?

- full new script could found at:
http://syndicat.com/pub/darkice/rc.darkice

- the patch could be found at:
http://syndicat.com/pub/darkice/rc.darkice-patch1-0.6-0.7.txt


--- rc.darkice  2010-12-21 11:48:03.000000000 +0100
+++ rc.darkice.new      2010-12-21 11:57:01.000000000 +0100
@@ -2,8 +2,12 @@
 # generic init file for darkice
 #
 # Niels Dettenbach - nd@xxxxxxxxxxxx - 2009-11-05
+# Last Change: 2010-12-21
+#
+# thanks to:
+#   - Roland Whitehead
 # GPL (2009)
-# 0.6
+# 0.7
 
 ## settings ##
 # check your paths!
@@ -39,9 +43,9 @@
                 if ( [ "$progname" == "$running" ] ); then
                        echo "$progname is still running"
                else
-                       echo "$progname seems crashed - PID does not match the 
deamon"
+                       echo "$progname seems crashed - PID ($PID) does not 
match the deamon"
                        echo "removing stale PID File $pidfile"
-                       rm $pidfile
+                       rm -f $pidfile
                        $0 start
                        exit $?
                fi
@@ -70,7 +74,7 @@
                kill -s TERM $PID 2> /dev/null
                echo
                sleep $restart_delay
-               rm $pidfile
+               rm -f $pidfile
                echo " stopped"
        else
                echo "$progname not running"


---


cheers and nice days,


Niels.
-- 

---

  Niels Dettenbach
  ---
  Syndicat IT&Internet
  http://www.syndicat.com
  T.-Muentzer.-Str. 2, 37308 Heilbad Heiligenstadt - DE
  ---
  Kryptoinfo: 
  PGP public key ID 651CA20D
  Fingerprint: 55E0 4DCD B04C 4A49 1586  88AE 54DC 4465 651C A20D
  https://syndicat.com/pub_key.asc
  ---

Other related posts: