Hey!
I have a hard time setting up a tmux session started with systemd on
raspbian (patchbox OS, realtime kernel) to behaves like as if I started
my script manually.
This is my Jack Capture service:
[Unit]
Description=Jack Capture autostart daemon
Wants=jack.service
After=multi-user.target
[Service]
Type=forking
EnvironmentFile=/etc/environment
User=patch
Group=realtime
ExecStart=/home/patch/jack-capture-tmux.sh
[Install]
WantedBy=jack.service
and this my script to start tmux with jack capture:
#!/bin/bash
. /etc/environment
/usr/bin/jack_wait -w
tmux new-session -d -s jackd
tmux new-window -t jackd -n Jack Capture -d
sleep 1
tmux send-keys -t jackd:0 'cd ~/' C-m
tmux send-keys -t jackd:0 'clear' C-m
tmux send-keys -t jackd:0 'jack_capture -c 2 -mb -tm -f wav
--filename-prefix ABC-TEST- --hook-close ./hookstop.sh --hook-timing
./hookstart.sh' C-m
everything a bloated from all my tries to make this work...
Now it starts properly but if I look into that tmux session I get
warnings/errors:
jack_capture -c 2 -mb -tm -f wav --filename-prefix ABC-TEST-
--hook-close ./hookstop.sh --hook-timing ./hookstart.sh
Cannot lock down 82287136 byte memory area (Cannot allocate memory)
>> Warning. Could not set higher priority for a
SCHED_OTHER process
>> using setpriority().
Cannot use real-time scheduling (RR/70)(1: Operation
not permitted)
JackClient::AcquireSelfRealTime error
>> Waiting to start recording of
"ABC-TEST-10.wav"
>> Press <Ctrl-C> to stop recording and quit.
I had this solved when starting the script manually by adding * - nice
-20 into /etc/security/limits.conf - but this obviously is not working
when starting the script within systemd (although same user).
Any ideas?
Cheers
Jan