문제

I wrote a startup script that starts at startup for ubuntu 9.10 server edition and does the rsync of my directories that is specified in my path, I did the startup in the old fashion way linking my script from init.d and placing it on run level, which is working and so i am able to start it on startup but after a while the service of my script is not running. It crashes on the middle after 5 minutes when the system is up and the code inside the script is just a line of rsync which i am sure is not the problem and so i have to invoke the script again to start it services? what is wrong with this? Can anyone help??

도움이 되었습니까?

해결책

Check your /var/log/ directory for log entries -- I don't know upstart nearly as well as I should, but I hope it would kill any /etc/init.d/rc* task that runs for five minutes. init scripts should use start-stop-daemon to start specific programs that run for a long time. (That way, those same programs can be gracefully shut down at reboot or shutdown time.) But the scripts themselves should run in under a second or so.

I'd suggest writing an actual upstart management script and placing it into /etc/init/ instead of fighting with an init script. I don't think upstart is going away :) so you might as well get used to it.

다른 팁

I don't have enough information to solve your problem, but I suggest you pipe rsync's stderr into a log file and try to figure out what went wrong. Try turning on '-v' for verbosity too. For example:

rsync ...blabla... -v 2>&1  | cat > /tmp/rsync.log

Or so.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top