Author Topic: Running on Linux  (Read 2341 times)

qubodup

  • Jr. Member
  • **
  • Posts: 5
    • qubodup.net
Running on Linux
« on: March 10, 2010, 04:39:04 PM »
Hello,

I managed to compile knights, after adding '-mt' to libboost_threads in the Makefile.
I have now knights and knights_server binaries in the root folder
Then I run ./start_knights_server.sh and get
Code: [Select]
nohup: appending output to `nohup.out'
nohup: failed to run command `knights_server': No such file or directory
If I try to run ./knights, then I get
Code: [Select]
error loading 'client_config.txt': could not open fileeven, if I first copy "knights_config.txt" to "client_config.txt".

Am I doing something wrong?

Thanks

duke

  • Jr. Member
  • **
  • Posts: 19
Re: Running on Linux
« Reply #1 on: March 11, 2010, 09:35:11 PM »
The start_knights_server.sh isn't ready. You have to edit the file by hand with a text editor like nano or vim. Change line 20 to your knights_server location and knights_config.txt location.

Try running as root. Maybe the game can't access the client_config.txt, because the file is not readable for the current user.


qubodup

  • Jr. Member
  • **
  • Posts: 5
    • qubodup.net
Re: Running on Linux
« Reply #2 on: March 12, 2010, 07:42:40 AM »
Allright, I realized that I don't need to run the server first and that all that was missing was the data path parameter.

Code: [Select]
$ ./knights -d ./knights_data/Works!

(I usually try avoid installing self-compiled software and always forget that they usually expect data in a /usr/shared... directory :) )

Stephen

  • Administrator
  • Hero Member
  • *****
  • Posts: 260
Re: Running on Linux
« Reply #3 on: March 12, 2010, 10:02:36 AM »
Sorry about the delay replying... have been a bit busy lately.

If you use 'make install' you don't need to supply the data path parameter. You can always install to somewhere in your home directory:
Code: [Select]
make PREFIX=$HOME/knights_test
make install PREFIX=$HOME/knights_test
Then run the game by running ~/knights_test/bin/knights and it should all work as intended. (You may want to add ~/knights_test/bin to your path in this case.) To uninstall just delete ~/knights_test.

The start_knights_server.sh is only really needed if you want to make sure the server is restarted after it crashes. (It's intended to be set up as a cron job, to be run every 5 minutes or so. It checks whether knights_server is running and if not, restarts it.) Otherwise, you can just run knights_server directly. You can edit the knights_config.txt to give the path to the knights_data folder if you need to.

Hope this helps.