Hello have tried to get the minidlna.init.d.script to work on my ubuntu 8.10 desktop pc, whitout any sucsess...
I hope somebody here could help me out..
This i wat i ave done:
1. placed minidlna binary in /usr/sbin/ and minidlna.conf in /etc/
2. copy the minidlna.init.d.script to /etc/init.d and renamed it minidlna.
3. sudo chmod 755 /etc/init.d/minidlna
4. sudo update-rc.d minidlna defaults
5. tested the script with: "/etc/init.d/minidlna start" This brings minidlna up as a running process.
I then restarted my computer and hoped that the system would bring minidlna up during boot time.. but this does not happend.. cant find anything in my syslog monitor abut minidlna...
Is there anything I do wrong?
I also tried to put in the following text at top init.d script..
### BEGIN INIT INFO
# Provides: minidlna
# Required-Start: $network
# Required-Stop:
# Default-Start: 3 5
# Default-Stop: 0 1 2 4 6
# Should-Start: minidlna
# Should-Stop:
# Short-Description: start minidlna daemons
### END INIT INFO
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What was the output you got when running the update-rc.d script? Anyway, you should be able to do it manually also.
With your system fully booted, type:
# runlevel
to figure out what runlevel you're usually operating in. If it's 5, then look in /etc/rc5.d/ for anything with a name ending with minidlna. If it's not there, you should just be able to do:
# ln -s /etc/init.d/minidlna /etc/rc5.d/S90minidlna
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have also manual added
# ln -s /etc/init.d/minidlna /etc/rc2.d/S90minidlna whit no sucess..
but i have notice that when i run minidlna manualy i get a error:
./minidlna -f minidlna.conf -d
[2009/03/12 20:35:51] daemonize.c:76: error: Unable to open pidfile for writing /var/run/minidlna.pid: Permission denied
and when then end the program using CTRL-C:
minidlna.c:109: warn: received signal 2, good-bye
[2009/03/12 20:37:45] minidlna.c:884: error: Failed to remove pidfile /var/run/minidlna.pid: No such file or directory
I dont run as root so it make some sense.
But could this be the problem for the init.d case as well?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The only thing I can think of would be if minidlna is trying to start before the network interface is up. Are you using NetworkManager or ifplugd? If so, you would have to start it from the scripts for those programs.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am experiencing the same behaviour on Debian Lenny on my NSLU2: Starting the demon manually works fine, but starting it automatically while booting doesn't work...
My runlevel output is N 2.
I tried several methods (as described above):
update-rc.d minidlna defaults
ln -s /etc/init.d/minidlna /etc/rc2.d/S99minidlna
and also "/etc/init.d/minidlna start" in /etc/rc.local
none of them worked...
Regards,
Martin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Your system needs to have an IP address when minidlna starts, so perhaps that's the problem? Are you using NetworkManager to handle the network interfaces? You could add a line like "/usr/sbin/minidlna &> /tmp/minidlna.log" to /etc/rc.local, and see what the error message is.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I do not use NetworkManager (as far as I know...)
Adding "/usr/sbin/minidlna &> /tmp/minidlna.log" to /etc/rc.local produces a logfile of zero bytes length and minidlna is not running after boot.
I also tried "/usr/sbin/minidlna -f /etc/minidlna.conf &> /tmp/minidlna.log" in /etc/rc.local, same result.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm running into a similar issue. minidlna starts just fine when invoked manually post-boot, but doesn't work when invoked from an init.d script.
Taking a cue from Justin's statement about needing a valid IP, I decided to try inserting a pause in the init.d script to give the network time to allocate the IP:
# Pause for IP
sleep 5
# Start minidlna
/sbin/startproc /usr/sbin/minidlna
I was surprised to find that this actually causes a Segmentation fault to show up.
Out of curiosity, I also added the pause AFTER the start of minidlna like this:
# Start minidlna and pause for a bit
/sbin/startproc -t 5 /usr/sbin/minidlna
The result? Segmentation fault.
The problem is I can't tell you where. I tried starting minidlna with the -d flag, but I'm not sure where the output went to (it didn't show up on stdout...).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried the init.d on a ubuntu server whit Webmin, past the code directly into webmin's Edit Action in the Bootup and Shutdown configuration, for a custom made "bootup and shutdown action". it actual works....
I found the script where placed in rc2.d , rc3.d and rc5.d named 99minidlna by Webmin.
I guess there Is something whit user privileges thats cause the script to fail on ubuntu systems. Webmin runs every proses as root.
I have never reported this as a bug, but I have noticed for many(all??) cvs version of minidlna I have tested that when I start it as a regular user then i cause one error:
nn@desktop:~/workspace/minidlna$ ./minidlna -f minidlna.conf -d
[2009/08/29 00:19:22] daemonize.c:76: error: Unable to open pidfile for writing /var/run
So if ubuntu dont run inti.d scripts as root then the init.d script cant manage to create the pidfile??
The pidfile isn't required to start. You can also specify the pidfile location to another path with the -P option to make sure. For example:
# minidlna -P /tmp/minidlna.pid
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've created a full (But not quite yet) initialization script for Ubuntu. I think Ubuntu version isnt a problem, and only thing i think i need to do is a way to log it.
Here is a diff (Can be applied with sudo patch -p0 < filename.patch) .
Hello have tried to get the minidlna.init.d.script to work on my ubuntu 8.10 desktop pc, whitout any sucsess...
I hope somebody here could help me out..
This i wat i ave done:
1. placed minidlna binary in /usr/sbin/ and minidlna.conf in /etc/
2. copy the minidlna.init.d.script to /etc/init.d and renamed it minidlna.
3. sudo chmod 755 /etc/init.d/minidlna
4. sudo update-rc.d minidlna defaults
5. tested the script with: "/etc/init.d/minidlna start" This brings minidlna up as a running process.
I then restarted my computer and hoped that the system would bring minidlna up during boot time.. but this does not happend.. cant find anything in my syslog monitor abut minidlna...
Is there anything I do wrong?
I also tried to put in the following text at top init.d script..
### BEGIN INIT INFO
# Provides: minidlna
# Required-Start: $network
# Required-Stop:
# Default-Start: 3 5
# Default-Stop: 0 1 2 4 6
# Should-Start: minidlna
# Should-Stop:
# Short-Description: start minidlna daemons
### END INIT INFO
Try this:
# update-rc.d minidlna defaults
yes, i have tried that as in step 4.. and after I edited the script.
What was the output you got when running the update-rc.d script? Anyway, you should be able to do it manually also.
With your system fully booted, type:
# runlevel
to figure out what runlevel you're usually operating in. If it's 5, then look in /etc/rc5.d/ for anything with a name ending with minidlna. If it's not there, you should just be able to do:
# ln -s /etc/init.d/minidlna /etc/rc5.d/S90minidlna
runleve output gave N 2.
the output whit your script is:
update-rc.d: warning: /etc/init.d/minidlna missing LSB style header
Adding system startup for /etc/init.d/minidlna ...
/etc/rc0.d/K20minidlna -> ../init.d/minidlna
/etc/rc1.d/K20minidlna -> ../init.d/minidlna
/etc/rc6.d/K20minidlna -> ../init.d/minidlna
/etc/rc2.d/S20minidlna -> ../init.d/minidlna
/etc/rc3.d/S20minidlna -> ../init.d/minidlna
/etc/rc4.d/S20minidlna -> ../init.d/minidlna
/etc/rc5.d/S20minidlna -> ../init.d/minidlna
and after I added LSB header:
### BEGIN INIT INFO
# Provides: minidlna
# Required-Start: $network $syslog
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts minidlna daemon.
# Description: MiniDlna is used to serve mp3 and pictures to Bravia 46W4500
### END INIT INFO
The output is:
/etc/rc0.d/K20minidlna -> ../init.d/minidlna
/etc/rc1.d/K20minidlna -> ../init.d/minidlna
/etc/rc6.d/K20minidlna -> ../init.d/minidlna
/etc/rc2.d/S20minidlna -> ../init.d/minidlna
/etc/rc3.d/S20minidlna -> ../init.d/minidlna
/etc/rc4.d/S20minidlna -> ../init.d/minidlna
/etc/rc5.d/S20minidlna -> ../init.d/minidlna
I have also manual added
# ln -s /etc/init.d/minidlna /etc/rc2.d/S90minidlna whit no sucess..
but i have notice that when i run minidlna manualy i get a error:
./minidlna -f minidlna.conf -d
[2009/03/12 20:35:51] daemonize.c:76: error: Unable to open pidfile for writing /var/run/minidlna.pid: Permission denied
and when then end the program using CTRL-C:
minidlna.c:109: warn: received signal 2, good-bye
[2009/03/12 20:37:45] minidlna.c:884: error: Failed to remove pidfile /var/run/minidlna.pid: No such file or directory
I dont run as root so it make some sense.
But could this be the problem for the init.d case as well?
The only thing I can think of would be if minidlna is trying to start before the network interface is up. Are you using NetworkManager or ifplugd? If so, you would have to start it from the scripts for those programs.
Did you solve the problem already?
I am experiencing the same behaviour on Debian Lenny on my NSLU2: Starting the demon manually works fine, but starting it automatically while booting doesn't work...
My runlevel output is N 2.
I tried several methods (as described above):
update-rc.d minidlna defaults
ln -s /etc/init.d/minidlna /etc/rc2.d/S99minidlna
and also "/etc/init.d/minidlna start" in /etc/rc.local
none of them worked...
Regards,
Martin
Your system needs to have an IP address when minidlna starts, so perhaps that's the problem? Are you using NetworkManager to handle the network interfaces? You could add a line like "/usr/sbin/minidlna &> /tmp/minidlna.log" to /etc/rc.local, and see what the error message is.
I do not use NetworkManager (as far as I know...)
Adding "/usr/sbin/minidlna &> /tmp/minidlna.log" to /etc/rc.local produces a logfile of zero bytes length and minidlna is not running after boot.
I also tried "/usr/sbin/minidlna -f /etc/minidlna.conf &> /tmp/minidlna.log" in /etc/rc.local, same result.
I'm running into a similar issue. minidlna starts just fine when invoked manually post-boot, but doesn't work when invoked from an init.d script.
Taking a cue from Justin's statement about needing a valid IP, I decided to try inserting a pause in the init.d script to give the network time to allocate the IP:
# Pause for IP
sleep 5
# Start minidlna
/sbin/startproc /usr/sbin/minidlna
I was surprised to find that this actually causes a Segmentation fault to show up.
Out of curiosity, I also added the pause AFTER the start of minidlna like this:
# Start minidlna and pause for a bit
/sbin/startproc -t 5 /usr/sbin/minidlna
The result? Segmentation fault.
The problem is I can't tell you where. I tried starting minidlna with the -d flag, but I'm not sure where the output went to (it didn't show up on stdout...).
I tried the init.d on a ubuntu server whit Webmin, past the code directly into webmin's Edit Action in the Bootup and Shutdown configuration, for a custom made "bootup and shutdown action". it actual works....
I found the script where placed in rc2.d , rc3.d and rc5.d named 99minidlna by Webmin.
I guess there Is something whit user privileges thats cause the script to fail on ubuntu systems. Webmin runs every proses as root.
I have never reported this as a bug, but I have noticed for many(all??) cvs version of minidlna I have tested that when I start it as a regular user then i cause one error:
nn@desktop:~/workspace/minidlna$ ./minidlna -f minidlna.conf -d
[2009/08/29 00:19:22] daemonize.c:76: error: Unable to open pidfile for writing /var/run
So if ubuntu dont run inti.d scripts as root then the init.d script cant manage to create the pidfile??
start) log_daemon_msg "Starting minidlna" "minidlna"
start-stop-daemon --start --quiet --pidfile /var/run/minidlna.pid --startas $MINIDLNA -- $ARGS $LSBNAMES
log_end_msg $?
;;
The pidfile isn't required to start. You can also specify the pidfile location to another path with the -P option to make sure. For example:
# minidlna -P /tmp/minidlna.pid
I've created a full (But not quite yet) initialization script for Ubuntu. I think Ubuntu version isnt a problem, and only thing i think i need to do is a way to log it.
Here is a diff (Can be applied with sudo patch -p0 < filename.patch) .
: http://pastebin.ca/1572522
This issue seams like it is solved now, -i run Ubuntu 8.10
sudo cp minidlna.init.d.script /etc/init.d/minidlna
sudo chmod +x /etc/init.d/minidlna
sudo update-rc.d minidlna defaults
to remove the startup schript then :
sudo update-rc.d -f minidlna remove