Skip to content
Snippets Groups Projects
Commit e5ff055a authored by bta's avatar bta
Browse files

Fix the screendump service.

Going back to the configuration of my first tests.

I suppose the sdump user must be below 1000, so that systemd will not
launch a full user session for us (with pulse & friends).

As I'm hiding the PIDs, I don't need to run the ffmpeg process with
a different name. I'm not sure if pkill was able to find the process
with the changed name, so we go back to a simpler script.

And it works!
parent 6618154f
No related branches found
No related tags found
No related merge requests found
......@@ -30,21 +30,26 @@ start() {
chown -h sdump:sdump ~sdump/.Xauthority
# Fake it 'till you make it
ln -s /usr/bin/ffmpeg ~sdump/[sysdump]
#if [ ! -e "~sdump/[sysdump]" ]; then
# ln -s /usr/bin/ffmpeg ~sdump/[sysdump]
#fi
# Hide processes
mount /proc/ -o remount,hidepid=2
# Start the screen dump
#CMD="ffmpeg -framerate 1 -f x11grab -i :0.0 -vcodec libx265 -crf 28 \"${BASEDIR}/${DATE}.mkv\""
#CMD="ffmpeg -framerate 1 -f x11grab -i :0.0 -vcodec libx265 -crf 28 -vf \"drawtext='text=%{localtime\:%X}:fontsize=32:fontcolor=red'\" \"${BASEDIR}/${DATE}.mkv\""
CMD="PATH=\"$PATH:.\" [sysdump] -framerate 1 -f x11grab -i :0.0 -vcodec libx265 -crf 28 -vf \"drawtext='text=%{localtime\:%X}:fontsize=32:fontcolor=red'\" \"${BASEDIR}/${DATE}.mkv\""
CMD="ffmpeg -framerate 1 -f x11grab -i :0.0 -vcodec libx265 -crf 28 -vf \"drawtext='text=%{localtime\:%X}:fontsize=32:fontcolor=red'\" \"${BASEDIR}/${DATE}.mkv\""
#CMD="PATH=\"$PATH:.\" [sysdump] -framerate 1 -f x11grab -i :0.0 -vcodec libx265 -crf 28 -vf \"drawtext='text=%{localtime\:%X}:fontsize=32:fontcolor=red'\" \"${BASEDIR}/${DATE}.mkv\""
su - sdump -c "${CMD}"
}
stop() {
# Send a SIGTERM to ffmpeg (running as "[sysdump]") to stop the screen dump
pkill -u sdump "[sysdump]"
#pkill -u sdump "[sysdump]"
FFPID=`pgrep -u sdump ffmpeg`
echo "Found sdump process with PID: ${FFPID}"
pkill -u sdump ffmpeg
# Give ffmpeg time to finalize the file
sleep 10
}
......
......@@ -152,7 +152,7 @@ myuseradd esamesync 451 451
myuseradd esame
myuseradd moodle
myuseradd rdesktop
myuseradd sdump
myuseradd sdump 945 945
chown esamesync:esamesync ${ESAME_DIR}
mkdir -p /usr/libexec/labmanager
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment