good morning,
is it possible to automatically restart pd (or the computer) whenever i get watchdog: signaling pd ?
in other words: what would be the proper way to monitor a linux system and act upon e.g. CPU usage greater than xy% ? does anyone have experience with ps-watcher? http://ps-watcher.sourceforge.net http://ps-watcher.sourceforge.net/
i need help understanding this description of the pd-watchdog
s_watchdog.c is the source of pd-watchdog, which was spawned in sys_startgui(). pd-watchdog monitors its stdin for any input, timing out after 5 seconds if nothing was received. In this case it kills pd with a SIGHUP, but normally it will continue looping as long as characters are received from pd' at a rate of at least one every 5 seconds. So if pdtk_watchdog calls pd every 2 seconds and glob_watchdog() sends a CR each time through the pipe, everything runs smoothly.
"pd-watchdog monitors its stdin for any input” does this also work if i start pd with -stderr >2/dev/null ? is the fact that i run pd as superuser responsible for pd NOT beeing killed by SIGHUP ?
good morning,
Guten Morgen!
I know you didn't want this answer, but, is there a chance you can figure out why you are getting the watchdog message in Pd in the first hand place?
Did you already check the results of aptitude search watchdog
is it possible to automatically restart pd (or the computer) whenever i get watchdog: signaling pd ?
in other words: what would be the proper way to monitor a linux system and act upon e.g. CPU usage greater than xy% ? does anyone have experience with ps-watcher? http://ps-watcher.sourceforge.net http://ps-watcher.sourceforge.net/
I just found these: https://rt.wiki.kernel.org/index.php/RT_Watchdog
i need help understanding this description of the pd-watchdog
s_watchdog.c is the source of pd-watchdog, which was spawned in sys_startgui(). pd-watchdog monitors its stdin for any input, timing out after 5 seconds if nothing was received. In this case it kills pd with a SIGHUP, but normally it will continue looping as long as characters are received from pd' at a rate of at least one every 5 seconds. So if pdtk_watchdog calls pd every 2 seconds and glob_watchdog() sends a CR each time through the pipe, everything runs smoothly.
"pd-watchdog monitors its stdin for any input” does this also work if i start pd with -stderr >2/dev/null ? is the fact that i run pd as superuser responsible for pd NOT beeing killed by SIGHUP ?
Please forgive me, but why do you run Pd as root? Do you really need to do so?
On 18 Feb 2019, at 10:36, Peter P. peterparker@fastmail.com wrote:
- michael strohmann itsnotfair9@gmail.com [2019-02-18 10:22]:
good morning,
Guten Morgen!
I know you didn't want this answer, but, is there a chance you can figure out why you are getting the watchdog message in Pd in the first hand place?
yes, i think/hope i found the reason (network related) but still would be happy to have a safetynet. can only access wiringPI_gpio in sudo mode (raspberry…) is it that bad to run pd as superuser?
Did you already check the results of aptitude search watchdog
is it possible to automatically restart pd (or the computer) whenever i get watchdog: signaling pd ?
in other words: what would be the proper way to monitor a linux system and act upon e.g. CPU usage greater than xy% ? does anyone have experience with ps-watcher? http://ps-watcher.sourceforge.net http://ps-watcher.sourceforge.net/
I just found these: https://rt.wiki.kernel.org/index.php/RT_Watchdog
i need help understanding this description of the pd-watchdog
s_watchdog.c is the source of pd-watchdog, which was spawned in sys_startgui(). pd-watchdog monitors its stdin for any input, timing out after 5 seconds if nothing was received. In this case it kills pd with a SIGHUP, but normally it will continue looping as long as characters are received from pd' at a rate of at least one every 5 seconds. So if pdtk_watchdog calls pd every 2 seconds and glob_watchdog() sends a CR each time through the pipe, everything runs smoothly.
"pd-watchdog monitors its stdin for any input” does this also work if i start pd with -stderr >2/dev/null ? is the fact that i run pd as superuser responsible for pd NOT beeing killed by SIGHUP ?
Please forgive me, but why do you run Pd as root? Do you really need to do so?
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
On 18 Feb 2019, at 10:36, Peter P. peterparker@fastmail.com wrote:
- michael strohmann itsnotfair9@gmail.com [2019-02-18 10:22]:
good morning,
Guten Morgen!
I know you didn't want this answer, but, is there a chance you can figure out why you are getting the watchdog message in Pd in the first hand place?
yes, i think/hope i found the reason (network related) but still would be happy to have a safetynet. can only access wiringPI_gpio in sudo mode (raspberry…)
On an RPi 1 I managed to read the gpio pins as normal user by executing the following script, which starts pd at the end.
#!/bin/bash
# set the TX RX pins to become inputs as well
gpio -g mode 14 in
gpio -g mode 15 in
# set the following pins to low by default
gpio -g mode 4 down
gpio -g mode 5 down
gpio -g mode 0 down
gpio -g mode 6 down
gpio -g mode 15 down
gpio -g mode 8 down
gpio -g mode 7 down
gpio -g mode 1 down
# export the pins to be read by a normal user
# This numbering is already by BCM_GPIO number
gpio export 2 in
gpio export 3 in
gpio export 4 in
gpio export 17 in
gpio export 27 in
gpio export 22 in
gpio export 10 in
gpio export 9 in
gpio export 11 in
gpio export 0 in
gpio export 5 in
gpio export 6 in
gpio export 13 in
gpio export 19 in
gpio export 26 in
gpio export 14 in
gpio export 15 in
gpio export 18 in
gpio export 23 in
gpio export 24 in
gpio export 25 in
gpio export 8 in
gpio export 7 in
gpio export 1 in
gpio export 12 in
gpio export 16 in
gpio export 20 in
gpio export 21 in
pd -rt gpioReading-demo.pd
wow, that looks interesting! so which object do you use to read out the gpio? would you be so kind as to share your gpioReading-demo.pd ? thanks!
On 18 Feb 2019, at 10:54, Peter P. peterparker@fastmail.com wrote:
- michael strohmann itsnotfair9@gmail.com [2019-02-18 10:47]:
On 18 Feb 2019, at 10:36, Peter P. peterparker@fastmail.com wrote:
- michael strohmann itsnotfair9@gmail.com [2019-02-18 10:22]:
good morning,
Guten Morgen!
I know you didn't want this answer, but, is there a chance you can figure out why you are getting the watchdog message in Pd in the first hand place?
yes, i think/hope i found the reason (network related) but still would be happy to have a safetynet. can only access wiringPI_gpio in sudo mode (raspberry…)
On an RPi 1 I managed to read the gpio pins as normal user by executing the following script, which starts pd at the end.
#!/bin/bash
# set the TX RX pins to become inputs as well gpio -g mode 14 in gpio -g mode 15 in
# set the following pins to low by default gpio -g mode 4 down gpio -g mode 5 down gpio -g mode 0 down gpio -g mode 6 down
gpio -g mode 15 down gpio -g mode 8 down gpio -g mode 7 down gpio -g mode 1 down
# export the pins to be read by a normal user # This numbering is already by BCM_GPIO number gpio export 2 in gpio export 3 in gpio export 4 in gpio export 17 in gpio export 27 in gpio export 22 in gpio export 10 in gpio export 9 in gpio export 11 in gpio export 0 in gpio export 5 in gpio export 6 in gpio export 13 in gpio export 19 in gpio export 26 in
gpio export 14 in gpio export 15 in gpio export 18 in gpio export 23 in gpio export 24 in gpio export 25 in gpio export 8 in gpio export 7 in gpio export 1 in gpio export 12 in gpio export 16 in gpio export 20 in gpio export 21 in
pd -rt gpioReading-demo.pd
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Not sure if this is what you are looking for, but I use a python script to run 2 pd instances connected via netsend. The main patch sends a ing every second to the other patch, if the ping is stopped, the second kills the main pd. What the script recognizes and restarts both pd patches. Best, Popesz On Mon, 18 Feb 2019 at 10:50, michael strohmann itsnotfair9@gmail.com wrote:
wow, that looks interesting! so which object do you use to read out the gpio? would you be so kind as to share your gpioReading-demo.pd ? thanks!
On 18 Feb 2019, at 10:54, Peter P. peterparker@fastmail.com wrote:
- michael strohmann itsnotfair9@gmail.com [2019-02-18 10:47]:
On 18 Feb 2019, at 10:36, Peter P. peterparker@fastmail.com wrote:
- michael strohmann itsnotfair9@gmail.com [2019-02-18 10:22]:
good morning,
Guten Morgen!
I know you didn't want this answer, but, is there a chance you can figure out why you are getting the watchdog message in Pd in the first hand place?
yes, i think/hope i found the reason (network related) but still would
be happy to have a safetynet.
can only access wiringPI_gpio in sudo mode (raspberry…)
On an RPi 1 I managed to read the gpio pins as normal user by executing the following script, which starts pd at the end.
#!/bin/bash # set the TX RX pins to become inputs as well gpio -g mode 14 in gpio -g mode 15 in # set the following pins to low by default gpio -g mode 4 down gpio -g mode 5 down gpio -g mode 0 down gpio -g mode 6 down gpio -g mode 15 down gpio -g mode 8 down gpio -g mode 7 down gpio -g mode 1 down # export the pins to be read by a normal user # This numbering is already by BCM_GPIO number gpio export 2 in gpio export 3 in gpio export 4 in gpio export 17 in gpio export 27 in gpio export 22 in gpio export 10 in gpio export 9 in gpio export 11 in gpio export 0 in gpio export 5 in gpio export 6 in gpio export 13 in gpio export 19 in gpio export 26 in gpio export 14 in gpio export 15 in gpio export 18 in gpio export 23 in gpio export 24 in gpio export 25 in gpio export 8 in gpio export 7 in gpio export 1 in gpio export 12 in gpio export 16 in gpio export 20 in gpio export 21 in pd -rt gpioReading-demo.pd
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
wow, that looks interesting! so which object do you use to read out the gpio?
I use Miller's gpio object.
would you be so kind as to share your gpioReading-demo.pd ?
Attached.
On 18.02.19 10:21, michael strohmann wrote:
i need help understanding this description of the pd-watchdog
s_watchdog.c is the source of pd-watchdog, which was spawned in sys_startgui(). pd-watchdog monitors its stdin for any input, timing out after 5 seconds if nothing was received. In this case it kills pd with a SIGHUP, but normally it will continue looping as long as characters are received from pd' at a rate of at least one every 5 seconds. So if pdtk_watchdog calls pd every 2 seconds and glob_watchdog() sends a CR each time through the pipe, everything runs smoothly.
which part of ths description gives you trouble to understand (yes, the description is pretty tech; but i don't know your personal background so it'hs hard to give an proper answer to *your* problem).
"pd-watchdog monitors its stdin for any input” does this also work if i start pd with -stderr >2/dev/null ?
'stdout' and 'stderr' are unrelated (well, they are related; but whatever you do with stderr does not have an effect on stdout). but anyhow: yes, this also works if you redirect your stderr.
is the fact that i run pd as superuser responsible for pd NOT beeing killed by SIGHUP ?
ah well, Pd is not being "killed" by SIGHUP (btw, where did you get this from?). the watchdog sends a SIGHUP signal to Pd, and Pd *gracefully handles* this signal (by releasing the CPU; the idea of pd-watchdog is really to prevent a frozen *system*, in case a Pd with realtime-priorities goes havoc; the SIGHUP signal will give the *system* a chance to do their thing, whatever that is)
gfasdr IOhannes
thanks for the clarification! i must have imagined that sigup kills pd…indeed the rest of the system does not freeze.
i am still looking for a way automatically restart pd or the computer if pd freezes…
On 18 Feb 2019, at 10:54, IOhannes m zmoelnig zmoelnig@iem.at wrote:
On 18.02.19 10:21, michael strohmann wrote:
i need help understanding this description of the pd-watchdog
s_watchdog.c is the source of pd-watchdog, which was spawned in sys_startgui(). pd-watchdog monitors its stdin for any input, timing out after 5 seconds if nothing was received. In this case it kills pd with a SIGHUP, but normally it will continue looping as long as characters are received from pd' at a rate of at least one every 5 seconds. So if pdtk_watchdog calls pd every 2 seconds and glob_watchdog() sends a CR each time through the pipe, everything runs smoothly.
which part of ths description gives you trouble to understand (yes, the description is pretty tech; but i don't know your personal background so it'hs hard to give an proper answer to *your* problem).
"pd-watchdog monitors its stdin for any input” does this also work if i start pd with -stderr >2/dev/null ?
'stdout' and 'stderr' are unrelated (well, they are related; but whatever you do with stderr does not have an effect on stdout). but anyhow: yes, this also works if you redirect your stderr.
is the fact that i run pd as superuser responsible for pd NOT beeing killed by SIGHUP ?
ah well, Pd is not being "killed" by SIGHUP (btw, where did you get this from?). the watchdog sends a SIGHUP signal to Pd, and Pd *gracefully handles* this signal (by releasing the CPU; the idea of pd-watchdog is really to prevent a frozen *system*, in case a Pd with realtime-priorities goes havoc; the SIGHUP signal will give the *system* a chance to do their thing, whatever that is)
gfasdr IOhannes
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list