Hi, i have archlinux on a raspberry pi here. Mainly used for a small game server. I have a user added to run the server, and placed the following in in crontab.
Code:
* * * * * /home/redeclipse/start_server.sh
AFAIK this should execute the script every minute.
The script in question is (which is executable):
Code:
#!/bin/sh
/usr/bin/pgrep redeclipse > /dev/null
if [ $? -ne 0 ]
then
cd $HOME/redeclipse/bin/arm
REDECLIPSE_PATH=$HOME/redeclipse/
REDECLIPSE_HOME=$HOME/.redeclipse/
#REDECLIPSE_OPTIONS="-g/home/redeclipse/redeclipse.log"
./redeclipse_server_linux > $HOME/redeclipse/redeclipse.log &
fi
This works when i "su - redeclipse" and run the script manually, starting the server.
Basically it checks if the program is already running (sometimes the server can crash) in the hope to keep it online, however, when the server does crash, it is never restarted.
Can anyone point out what is wrong?
I have been told that crontab should run even when the user is logged out. I have the user "redeclipse" as a system account within group nobody.
Ie; /etc/passwd entry
Code:
redeclipse:x:220:99::/home/redeclipse:/bin/bash