0

For example make vlc start and play a video full screen on boot. After working this out here it is:

Hayden Thring
  • 147
  • 16

1 Answers1

0

You first need the following 2 packages if not already:

apt-get install daemontools daemontools-run

This will install and get running the needed "monitors", Then you need to create the "shortcut" to your program to start/restart automatically:

mkdir /home/user/vlc-daemon /home/user/vlc-daemon/log /home/user/vlc-daemon/log/main

gedit /home/user/vlc-daemon/run

put in this file and save it:

#!/bin/sh
echo starting vlc-d
export DISPLAY=:0 #needed for X program
exec setuidgid user /usr/bin/vlc -f /home/user/Downloads/myvideo.avi

This starts vlc program in fullscreen playing myvideo.avi as user "user" , adapt as needed.

Then, for logging: (add and save)

gedit /home/user/vlc-daemon/log/run

#!/bin/sh
exec setuidgid user multilog t ./main

Make them executable:

chmod 755 /home/user/vlc-daemon/run /home/user vlc-daemon/log/run

Now to install & activate service:

update-service --add /home/user/vlc-daemon

Now your program should be running, and start/restart automatically. for more documentation see: http://cr.yp.to/daemontools.html

If not check log/main folder, and that you can also run /home/user/vlc-daemon/run manually from cli , also the following command can show some errors:

ps -aux | grep readproctitle

Hayden Thring
  • 147
  • 16