i have a simple script that starts quassel-core in a screen session as different user! The script is:
#!/bin/sh su ircc -c 'screen -dmS quassel /home/ircc/quassel/quassel-core'
I want to start and stop this in an debian init.d script using start-stop-daemon What is the best way to get the PID of quassel-core (or of the screen, that should work too) and store it in a file? At the moment i use:
pidof quassel-core > /var/run/quasselcore.pid
but that will fail if some other user starts quassel-core.