Darkice Starting automatically on boot

Darkice Starting automatically on boot

Recently I had to install darkice on Ubuntu 12.04 (and 13.10) and faced a problem many other users has: Darkice won't start on boot, Darkice won't start using "service darkice start/stop" method.

There was a few suggestions using cron and custom scripts.

I figured out how to do it natively, in Ubuntu-way and want to share my experience with community.

-------------------------------

So. There are few problems with Darkice startup script (/init.d/darkice) provided by package system.

1) It does not create Darkice PID-file on start.
2) It Does not delete Darkice PID-file on stop.
3) It fail to check whether process is running or not.
4) Darkice can not start on boot properly (even if startup script was properly modified).

-------------------------------

Simple To-Do list:

(changed files published at the end of this post)


1.)

sudo nano /etc/init.d/darkice





In /etc/init.d/darkice find:

Code:
start-stop-daemon --start --quiet --pidfile $PIDFILE \
and replace it with:
Code:
start-stop-daemon --start --quiet -m --pidfile $PIDFILE \
2

In /etc/init.d/darkice find:
Code:
stop_server() {
# Stop the process using the wrapper
        start-stop-daemon --stop --quiet --pidfile $PIDFILE \
            --exec $DAEMON
        errcode=$?
add after (with the new line):
Code:
    rm $PIDFILE
3

In /etc/init.d/darkice find:
Code:
running() {
# Check if the process is running looking at /proc
# (works for all users)
add after (with the new line):
Code:
    sleep 1
4

In /etc/default/darkice check that you have
Code:
RUN=yes
5

Add default user nobody to the audio group (in my case, to work with ALSA):
Code:
adduser nobody audio
or change user to whoever you need in /etc/default/darkice.

6

Fix upstart problem (it seems Darkice is trying to start on boot too early):
Code:
update-rc.d -f darkice remove
update-rc.d darkice defaults 99
That's it! I have Darkice, controlled by upstart scripts (service darkice start/stop) running on boot.


 thanks for the help.
https://ubuntuforums.org/showthread.php?t=2183222

Darkice is most recently located at http://code.google.com/p/darkice/


No comments:

Post a Comment

Note: only a member of this blog may post a comment.