I have put the following code in my .profile
ps cax | grep jackd > /dev/null
if [ $? -eq 0 ]; then
echo "Jack is aready running."
fi
if [ "$SESSION_TYPE" != "remote/ssh" ] && [ "$DISPLAY" ]; then
ps cax | grep jackd > /dev/null
if [ $? -eq 0 ]; then
echo "Jack is aready running."
else
jackd --sync -P80 -p128 -dalsa -dhw:UA25 -r48000 -p64 -n3 -Xraw &
jack_wait -w
alsaj &
~/deployed/syzmo/x86_64-GNU%2fLinux/syzmo_client_studio &
fi
fi
When I logout from KDE and log in on tty1, I see the message "Jack is already running". When listing processes, I see that I have started it, so I conclude that jack never stopped. How could that be?
Here is what I see from ps -u when logging in from tty1:
PID TTY TIME CMD
2053 ? 00:32:39 jackd
2079 ? 00:00:00 alsaj
2082 ? 00:11:00 alsa_in
10265 tty1 00:00:00 bash
10295 tty1 00:00:00 ps
Why do I still see jackd
and alsa_in
among running processes?
Follow-up:
Since the processes does not die when logging out, there has to be a corresponding log-out script that does not run as root. Is there a way of cleaning up any side-effects caused by .profile
?
It is still running because you didn't stop it. You shouldn't be starting daemons like this in your .profile. A normally installed jackd package will set itself up to be automatically started and stopped at the appropriate times via upstart.