cdevd
June 19, 2021, 2:41pm
1
Hello,
I would like to automatically stop and restart deepstream at midnight everyday
I assume cron would be good for this?
I wanted to make a restart-DSapp.sh script and get cron to run it at midnight
I found the below on a linux website - I’ve edited it to work for me
#!/bin/sh
# Kill app
sudo pkill DSapp
# Change directory
cd /home/myapp/
# Restart DS
sudo ./start-DSapp.sh
I can run this from terminal and it will kill and restart my deepstream app
using crontab it will stop deepstream but won’t start it again
How do I make it start?
Is there a better way to do this?
thanks
snarky
June 20, 2021, 12:44am
2
You probably need to export the DISPLAY variable in the script before you start the app, because the default cron environment is not windowed.
Also: Cron typically runs on UCT time, not your local time, so if you mean “middle of the night, my time,” then you’ll want to calculate what that means in UCT and configure the crontab time to be that corresponding time.
cdevd
June 21, 2021, 9:11am
3
Thanks ,
I’ve now tried adding export DISPLAY=:0 and 0.0 into both my cron and my .sh but no luck
any pointers?
thanks
Hi,
Maybe you can set up two crontab. One is to start he application and the other is to stop it. One is at 11:55 and the other is at 12:00
cdevd
June 30, 2021, 1:44pm
6
thanks DaneLLL
Yes I have separated into 2 jobs, and. can make it stop however I cannot get deepstream to launch as cron won’t open a window
I tried exporting the display but that didn’t work
The app wants to launch from terminal but I cannot make this work from cron
if you can help me it would be very much appreciated
thanks
Hi,
There are several types in Sink Group . Please try type=1 and type=5 . To check if the issue is specific to nveglglessink .
cdevd
July 13, 2021, 10:25am
9
Hi,
If I use sink=1 or 5 the process does start however no window opens
How do I start it and have a window open as well?
thanks
Hi,
Looks like nveglglesink does not work in the case. Could you try to run the command with DISPLAY=:0(or 1) ? Like:
$ DISPLAY=:0 gst-launch-1.0 videotestsrc ! nvvidconv ! nvegltransform ! nveglglessink
system
Closed
September 12, 2021, 1:41am
11
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.