Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to start some software (VLC) when my Debian server boots up. I did try several ways I found in different sources (changing /etc/rc.local, creating a script in /etc/init.d/ and adding it with update-rc.d or rcconf) but in the end after a reboot, I never see the VLC process running.

So my question is :

  • did I do anything wrong in the startup script (shown below)? rcconf displays a star in front of the file name so I assume the script has been linked to the correct runlevels ?
  • is there any way to see if an error occured while the system tried to start VLC? I looked into different /var/log/ files without any luck...

The startup script :

#! /bin/sh

case "$1" in
    start)
        su - shtong -c "vlc -I http --http-album-art --http-host=0.0.0.0:8000 --no-playlist-autostart --configlcrc ~/default.xspf"
        exit 0;
        ;;
    restart|reload|force-reload)
        echo "Error: argument '$1' not supported" >&2
        exit 3
        ;;
    stop)
        ;;
    *)
        echo "Usage: $0 start|stop" >&2
        exit 3
        ;;
esac
share|improve this question

migrated from serverfault.com Aug 8 '11 at 20:31

This question came from our site for professional system and network administrators.

1  
Does it work if you run it by hand? If so, then to enable boot message logging, you need to edit /etc/default/bootlogd and set BOOTLOGD_ENABLE=Yes then after rebooting, most of the startup messages will be in /var/log/boot. –  DerfK Aug 8 '11 at 20:13
add comment

2 Answers

I would like this to be a comment and not an answer, but I don't have enough level to do that.

I was having the same problem when defining actions to do with crontab. Long story short, it executes in a different environment (for security reasons I think), I would suggest to use absolute paths for commands like "vlc", and pretty much every command.

You can find the paths with

which command

Besides. I wouldn't do that su thing with vlc. The startup script is probably going to be run by the superuser anyway, shouldn't it? That shouldn't cause trouble, the superuser can sudo to the infinite (theoretically) but it isn't nice.

Hope this helps at least as inspiration. Also, post the errors when you have them, errors are always very helpful for the diagnosis.

share|improve this answer
    
I had no error message - my question was precisely how to get error messages. Also I had to su the command because VLC refuses to run when launched with root privileges. –  Shtong Aug 9 '11 at 10:46
add comment
up vote 0 down vote accepted

Thanks to DerfK, I was able to turn on boot logging and see that my command was showing some error messages when launched by the system (it worked fine when launched manually).

To sum up, i modified the /etc/default/bootlogd file to put this line :

BOOTLOGD_ENABLE=Yes

After that the errors were visible in /var/log/boot.

(also, for completeness's sake, the problem was that the --configlcrc argument was invalid, and for some reason VLC didn't complain when I tested the command directly in my command line, but does when executed at boot time..)

share|improve this answer
    
Maybe specify which are the errors as well, and accept your own answer. –  Gabriele Cirulli Aug 8 '11 at 20:55
    
I'll accept my answer - as soon as I can ;) –  Shtong Aug 9 '11 at 10:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.