tiny_man
Posts: 5
Joined: Sun Jan 12, 2014 5:42 pm

Run three commands at startup

Sat Jan 18, 2014 8:19 pm

Hi

I need to rune these commands at startup in following orders

Code: Select all

uv4l --driver raspicam --auto-video_nr --framerate 15

sudo chrt -a -r -p 99 `pgrep uv4l`   

cvlc v4l2:///dev/video0 --v4l2-width 1024 --v4l2-height 576-v4l2-chroma h264 --sout '#rtp{sdp=rtsp://:8554/}'
How do I do it?

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Run three commands at startup

Sat Jan 18, 2014 8:46 pm

Put the commands in /etc/rc.local they should run just before the login screen.

Richard S.

tiny_man
Posts: 5
Joined: Sun Jan 12, 2014 5:42 pm

Re: Run three commands at startup

Mon Jan 20, 2014 4:21 pm

I tried but it says it cant run vlc from sudo mode!

but the first line is OK.

more ideas?

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Run three commands at startup

Mon Jan 20, 2014 5:47 pm

A quick look at the VideoLAN forum would suggest that VLC doesn't like running under root - lol.
You could probably get around this by running it under the pi account i.e.
su pi -c "cvlc v4l2:///dev/video0 --v4l2-width 1024 --v4l2-height 576-v4l2-chroma h264 --sout '#rtp{sdp=rtsp://:8554/}' "

Richard S.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Run three commands at startup

Mon Jan 20, 2014 6:11 pm

Or you could do it the sensible way as I detail in posts in the many similar threads on this subject.

Search this forum for posts by me - you'll find it.

Note: The basic underlying take-home on this is that the /etc/init* and /etc/rc.local stuff was never intended for running "user" tasks - that is, things that users dream up and implement. It was designed for system configuration tasks.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

Return to “Beginners”