Closed chudsaviet closed 3 years ago
I assume you had to change from webcam
to root
for writing permissions?
Yup. There is no other way to make a directory in ‘run’ with ‘ExecPre’ statement. So I had to change user to ‘root’ and run ffmpeg using ‘sudo -u webcam’.
You might be able to do something like this:
User=webcam
Source I wrote with example:
https://github.com/guysoft/AlarmBot/blob/master/src/config/alarmbot.service#L11
Unfortunately not, because /run
is owned by root
and don't have write permissions to 'others'. ExecStartPre
is running under the user specified in User
statement.
I had to move the stream to
/run
because of next reasons:/tmp
in RaspberryPi OS is not mounted astmpfs
, but instead is kept on the SD card. So HLS stream causes excessive wear on the card./run
is 'Run-time variable data: Information about the running system since last boot, e.g., currently logged-in users and running daemons. Files under this directory must be either removed or truncated at the beginning of the boot process, but this is not necessary on systems that provide this directory as a temporary filesystem (tmpfs). '