[FFmpeg-user] hls playlist got wiped out when ffmpeg runs as systemd child process

Dennis Mungai dmngaie at gmail.com
Sun Jul 10 20:58:34 EEST 2022


On Sun, 10 Jul 2022, 20:25 Jonathan Baecker, <jonbae77 at gmail.com> wrote:

> Am 10.07.22 um 19:12 schrieb Jonathan Baecker:
> > Am 08.07.22 um 22:30 schrieb Reindl Harald:
> >>
> >>
> >> Am 08.07.22 um 18:16 schrieb Greg Oliver:
> >>> On Fri, Jul 8, 2022 at 5:25 AM jb <jonbae77 at gmail.com> wrote:
> >>>
> >>>> Hello everybody,
> >>>>
> >>>> I have a control program which running as a systemd service. This
> >>>> program spawns ffmpeg and that is writing to a HLS playlist. I use
> >>>> this
> >>>> flags:
> >>>>
> >>>>      -hls_flags
> >>>> append_list+delete_segments+omit_endlist+program_date_time
> >>>>
> >>>> The interesting thing is, when I stop the systemd process my HLS
> >>>> playlist got wiped out and when I start the service again ffmpeg will
> >>>> not continue the playlist, instead it writes a new one.
> >>>>
> >>>> When I run my control program directly from shell, I don't have this
> >>>> behavior. I can stop the program and start it again and the HLS
> >>>> playlist
> >>>> will continue.
> >>>>
> >>>> Does anybody notice this different behaviors? And has an idea why this
> >>>> is happen and what I can do here?
> >>>>
> >>>
> >>> systemd is not stateful - unless you create stateful files with your
> >>> exec{pre,post,start} stanzas, it will get overwritten every time
> >>
> >> "systemd is not stateful" means nothing on it's own
> >> stateful *for what*
> >>
> >> even "PrivateTmp" is *not* default enabled, but when you enable it
> >> and your application trie sto re-use files in /tmp they are gone
> >
> > Thank you for your suggestions! PrivateTmp=no was not working, but I
> > did some more tests and figure out: the problem is related to the way
> > systemd stops child processes. When I run ffmpeg directly with systemd
> > the content from the m3u8 playlist survive, but when I start ffmpeg
> > from a bash script, or my control program, the content got deleted.
>
> Sorry that I reply to my self, but I have it now. KillMode=mixed did the
> trick.
>


Fascinating find, I'm glad it worked out

>


More information about the ffmpeg-user mailing list