Name: op !!mYMwp093EuI2DM5 2012-12-23 14:59
Hiya /prog/. I hate to tarnish the board with this seemingly plebeian question, but I've been trying to solve this problem for days.
I wrote a script to do automated backups of a tekkit server I'm running on my home server. The script uses rcon to do a 5 minute countdown to warn players to get off, saves the map, shuts tekkit down, backs up meaningful data off site and is supposed to start tekkit again.
The only part that doesn't work is starting tekkit again. At least, it works if I launch the script manually, but not when launched as a cronjob.
Observe the failing portion:
It is run as root but the script re-launches it under a limited user account. Again, works if I run the script manually but the cronjob works only up until this point and logs no errors.
The launch.sh script looks like this...
Any ideas? I've run out.
I wrote a script to do automated backups of a tekkit server I'm running on my home server. The script uses rcon to do a 5 minute countdown to warn players to get off, saves the map, shuts tekkit down, backs up meaningful data off site and is supposed to start tekkit again.
The only part that doesn't work is starting tekkit again. At least, it works if I launch the script manually, but not when launched as a cronjob.
Observe the failing portion:
update_timestamp
echo "$LOG_TIMESTAMP Attempting to re-launch server as user $SERVER_ACCT_USER."
cd $SERVER_ROOT
sudo -u $SERVER_ACCT_USER ./launch.sh
cd ~
update_timestamp
echo "$LOG_TIMESTAMP Routine done."It is run as root but the script re-launches it under a limited user account. Again, works if I run the script manually but the cronjob works only up until this point and logs no errors.
The launch.sh script looks like this...
#!/bin/sh
# Launch tekkit. No hangup on server user disconnect.
# Detach from STDIN/STDIO or it will hang up the script.
nohup java -Xmx3G -Xms2G -jar Tekkit.jar nogui &> /dev/null < /dev/null &Any ideas? I've run out.