An endless loop in FreeBSD
I have a script that segfaults constantly - a problem I can't solve as a segfault in python libxml bindings - didn't write them. So, on Linux I used to run inf.loop so that when the script dies, it restarts, for example:
#!/bin/bash
while [ 1 ]
do
nice -n 19 python server.py
sleep 1
done
Well, I can't find / bin / bash in FreeBSD, so it won't work.
Any ideas? Note that cron is not an option - downtime is a few seconds.
source to share
There will be some kind of shell program on the system and that script looks like it would run in almost any shell.
Enter type bash
to see where bash is. If not, try sh. It should be there and it should work. Take the result type bash
or type sh
and use / bin / bash instead. Alternatively take a look at / etc / passwd, find your account and notice the shell. I believe this is the last field and it will say something like / bin / sh or / usr / bin / bash or whatever. Use this instead of / bin / bash.
source to share