Hello, i wonder if it is possible to setup something on raspberry, so that the puredata-watchdog will restart pd-0.48.0 automatically? where could i look up the mechanics of this, unfortunatly i am not a unix crack…
cheers! michael
On Thu, 2018-05-03 at 06:29 +0200, michael strohmann wrote:
Hello, i wonder if it is possible to setup something on raspberry, so that the puredata-watchdog will restart pd-0.48.0 automatically? where could i look up the mechanics of this, unfortunatly i am not a unix crack…
Are you referring to the pd-watchdog binary, that comes with puredata- core? Is your Raspberry Pi running Raspbian?
From what I understand, the purpose of the pd-watchdog is to pause Pd in regular intervals when running in real-time mode. I think this is measure to prevent Pd from locking up the system. Assume you accidentally trigger an [until] without a stopping mechanism, thanks to pd-watchdog you're still able to move the mouse and quit Pd.
Is your goal to make sure that Pd is running at any time, so that it is started again as soon as it stops? Maybe you can achieve something like this wit a shell script. I haven't tested this, but it might give you an idea how to make it work:
#!/bin/sh
while true do # We start pd and send detach it from the terminal ('&') /usr/bin/pd -open yourpatch &
# we catch pd's process id pdpid=$!
# now let's wait for the process to terminate wait $pdpid
# once pd terminates, we start another iteration # of our while-loop done
Roman
On Thu, 2018-05-03 at 06:29 +0200, michael strohmann wrote:
Hello, i wonder if it is possible to setup something on raspberry, so that the puredata-watchdog will restart pd-0.48.0 automatically? where could i look up the mechanics of this, unfortunatly i am not a unix crack…
Are you referring to the pd-watchdog binary, that comes with puredata- core? Is your Raspberry Pi running Raspbian?
From what I understand, the purpose of the pd-watchdog is to pause Pd in regular intervals when running in real-time mode. I think this is measure to prevent Pd from locking up the system. Assume you accidentally trigger an [until] without a stopping mechanism, thanks to pd-watchdog you're still able to move the mouse and quit Pd.
Is your goal to make sure that Pd is running at any time, so that it is started again as soon as it stops? Maybe you can achieve something like this wit a shell script. I haven't tested this, but it might give you an idea how to make it work:
#!/bin/sh
while true do # We start pd and send detach it from the terminal ('&') /usr/bin/pd -open yourpatch &
# we catch pd's process id pdpid=$!
# now let's wait for the process to terminate wait $pdpid
# once pd terminates, we start another iteration # of our while-loop done
I like until !!; do :; done which restarts the last command from bash_history in case it exits without a clean 0 exit status. Useful for all sorts of things. I guess it can also be written as until pd myCrashingPatch.pd; do; :; done
Hey list !
Le 03/05/2018 à 09:42, Roman Haefeli a écrit :
On Thu, 2018-05-03 at 06:29 +0200, michael strohmann wrote:
Hello, i wonder if it is possible to setup something on raspberry, so that the puredata-watchdog will restart pd-0.48.0 automatically? where could i look up the mechanics of this, unfortunatly i am not a unix crack…
Are you referring to the pd-watchdog binary, that comes with puredata- core? Is your Raspberry Pi running Raspbian?
From what I understand, the purpose of the pd-watchdog is to pause Pd in regular intervals when running in real-time mode. I think this is measure to prevent Pd from locking up the system. Assume you accidentally trigger an [until] without a stopping mechanism, thanks to pd-watchdog you're still able to move the mouse and quit Pd.
Is your goal to make sure that Pd is running at any time, so that it is started again as soon as it stops? Maybe you can achieve something like this wit a shell script. I haven't tested this, but it might give you an idea how to make it work:
#!/bin/sh
while true do # We start pd and send detach it from the terminal ('&') /usr/bin/pd -open yourpatch &
# we catch pd's process id pdpid=$!
# now let's wait for the process to terminate wait $pdpid
# once pd terminates, we start another iteration # of our while-loop done
I will do something like :
while true do pd -open yourpatch # if pd crash the script continue to "sleep 1" and a new loop start sleep 1 done
++
Jack
Roman
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
If you have several instances of Pd, it is also doable to do something like :
pd -open yourpatch1.pd & PID1=$! pd -open yourpatch2.pd & PID2=$!
while true do if [ ! -d /proc/$PID1 ] then pd -open yourpatch1.pd & PID1=$! fi if [ ! -d /proc/$PID2 ] then pd -open yourpatch2.pd & PID2=$! fi done
++
Jack
Le 03/05/2018 à 11:46, Jack a écrit :
Hey list !
Le 03/05/2018 à 09:42, Roman Haefeli a écrit :
On Thu, 2018-05-03 at 06:29 +0200, michael strohmann wrote:
Hello, i wonder if it is possible to setup something on raspberry, so that the puredata-watchdog will restart pd-0.48.0 automatically? where could i look up the mechanics of this, unfortunatly i am not a unix crack…
Are you referring to the pd-watchdog binary, that comes with puredata- core? Is your Raspberry Pi running Raspbian?
From what I understand, the purpose of the pd-watchdog is to pause Pd in regular intervals when running in real-time mode. I think this is measure to prevent Pd from locking up the system. Assume you accidentally trigger an [until] without a stopping mechanism, thanks to pd-watchdog you're still able to move the mouse and quit Pd.
Is your goal to make sure that Pd is running at any time, so that it is started again as soon as it stops? Maybe you can achieve something like this wit a shell script. I haven't tested this, but it might give you an idea how to make it work:
#!/bin/sh
while true do # We start pd and send detach it from the terminal ('&') /usr/bin/pd -open yourpatch &
# we catch pd's process id pdpid=$!
# now let's wait for the process to terminate wait $pdpid
# once pd terminates, we start another iteration # of our while-loop done
I will do something like :
while true do pd -open yourpatch # if pd crash the script continue to "sleep 1" and a new loop start sleep 1 done
++
Jack
Roman
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Hello,
Maybe not as technical as your solution, but on a Windows machine for an art installation, i did a quick "watchdog" that checked a "stillalive" file, that was regularly modified by the pd patch. So when/if pd crashed, the file wasn't updated anymore and the script would restart it. I think it was done in python...
cheers
2018-05-03 11:56 GMT+02:00 Jack jack@rybn.org:
If you have several instances of Pd, it is also doable to do something like :
pd -open yourpatch1.pd & PID1=$! pd -open yourpatch2.pd & PID2=$!
while true do if [ ! -d /proc/$PID1 ] then pd -open yourpatch1.pd & PID1=$! fi if [ ! -d /proc/$PID2 ] then pd -open yourpatch2.pd & PID2=$! fi done
++
Jack
Le 03/05/2018 à 11:46, Jack a écrit :
Hey list !
Le 03/05/2018 à 09:42, Roman Haefeli a écrit :
On Thu, 2018-05-03 at 06:29 +0200, michael strohmann wrote:
Hello, i wonder if it is possible to setup something on raspberry, so that the puredata-watchdog will restart pd-0.48.0 automatically? where could i look up the mechanics of this, unfortunatly i am not a unix crack…
Are you referring to the pd-watchdog binary, that comes with puredata- core? Is your Raspberry Pi running Raspbian?
From what I understand, the purpose of the pd-watchdog is to pause Pd in regular intervals when running in real-time mode. I think this is measure to prevent Pd from locking up the system. Assume you accidentally trigger an [until] without a stopping mechanism, thanks to pd-watchdog you're still able to move the mouse and quit Pd.
Is your goal to make sure that Pd is running at any time, so that it is started again as soon as it stops? Maybe you can achieve something like this wit a shell script. I haven't tested this, but it might give you an idea how to make it work:
#!/bin/sh
while true do # We start pd and send detach it from the terminal ('&') /usr/bin/pd -open yourpatch &
# we catch pd's process id pdpid=$!
# now let's wait for the process to terminate wait $pdpid
# once pd terminates, we start another iteration # of our while-loop done
I will do something like :
while true do pd -open yourpatch # if pd crash the script continue to "sleep 1" and a new loop start sleep 1 done
++
Jack
Roman
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/
listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/
listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/ listinfo/pd-list
On Thu, 2018-05-03 at 11:56 +0200, Jack wrote:
If you have several instances of Pd, it is also doable to do something like :
pd -open yourpatch1.pd & PID1=$! pd -open yourpatch2.pd & PID2=$!
while true do if [ ! -d /proc/$PID1 ] then pd -open yourpatch1.pd & PID1=$! fi if [ ! -d /proc/$PID2 ] then pd -open yourpatch2.pd & PID2=$! fi done
If I'm not mistaken, this hogs the CPU as it will run as many iterations per second as possible. I think a 'sleep 1' would already help.
Roman
Yes, it is good to add a "sleep 1" at the end of the while loop. ++
Jack
Le 03/05/2018 à 12:59, Roman Haefeli a écrit :
On Thu, 2018-05-03 at 11:56 +0200, Jack wrote:
If you have several instances of Pd, it is also doable to do something like :
pd -open yourpatch1.pd & PID1=$! pd -open yourpatch2.pd & PID2=$!
while true do if [ ! -d /proc/$PID1 ] then pd -open yourpatch1.pd & PID1=$! fi if [ ! -d /proc/$PID2 ] then pd -open yourpatch2.pd & PID2=$! fi done
If I'm not mistaken, this hogs the CPU as it will run as many iterations per second as possible. I think a 'sleep 1' would already help.
Roman
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
On Thu, 2018-05-03 at 09:42 +0200, Roman Haefeli wrote:
On Thu, 2018-05-03 at 06:29 +0200, michael strohmann wrote:
Hello, i wonder if it is possible to setup something on raspberry, so that the puredata-watchdog will restart pd-0.48.0 automatically? where could i look up the mechanics of this, unfortunatly i am not a unix crack…
Are you referring to the pd-watchdog binary, that comes with puredata- core? Is your Raspberry Pi running Raspbian?
From what I understand, the purpose of the pd-watchdog is to pause Pd in regular intervals when running in real-time mode. I think this is measure to prevent Pd from locking up the system. Assume you accidentally trigger an [until] without a stopping mechanism, thanks to pd-watchdog you're still able to move the mouse and quit Pd.
Is your goal to make sure that Pd is running at any time, so that it is started again as soon as it stops? Maybe you can achieve something like this wit a shell script. I haven't tested this, but it might give you an idea how to make it work:
#!/bin/sh
while true do # We start pd and send detach it from the terminal ('&') /usr/bin/pd -open yourpatch &
# we catch pd's process id pdpid=$!
# now let's wait for the process to terminate wait $pdpid
# once pd terminates, we start another iteration # of our while-loop done
Actually, this is overkill. Since there is only one job to wait for, the whole wait stuff is not necessary, as the examples from other list members clearly show.
Peter's or Jack's examples are better.
Roman