installing POL in linux

Sometimes you need to share your knowledge. This is where you can do it. A place for POL and Script guides.
Post Reply
black_s
New User
Posts: 8
Joined: Sun Oct 06, 2013 7:10 am

installing POL in linux

Post by black_s » Sun Oct 06, 2013 7:50 am

Hi there,
here i have some trouble installing POL in my ubuntu. I'm not an advanced user of LINUX so my question is there is not a complete guide that can help me, with the exact series of command i need to do for start the server?

i read this guide, but it's not complete for have the server start, for new people like me :d

can someone help? thank you for your support, and sorry for my english!

greetings from Italy

black_s
New User
Posts: 8
Joined: Sun Oct 06, 2013 7:10 am

Re: installing POL in linux

Post by black_s » Sun Oct 06, 2013 10:59 am

more details. This is exactly the things that i do:

download linux version
open it on a folder
follow the step at http://forums.polserver.com/viewtopic.php?f=20&t=4943
copy a ultima installation from my win 7 pc to my ubuntu server, and link at for the uoconvert
nothing more :\ now i miss the cmds.cfg file

OWHorus
Master Poster
Posts: 96
Joined: Sat Feb 04, 2006 1:24 pm
Location: Vienna, Austria

Re: installing POL in linux

Post by OWHorus » Sun Oct 06, 2013 11:51 am

Hello,

I installed our system (POL 0.99) on Debian Linux, so this should be very similar in Ubuntu.

You should _not_ use root to run POL. Here is a step by step instruction, modify if needed:

1 Create user and group for POL server. It should be a new user and a new group. To administrate POL you could log in as this user, or log in as root and su to this user. I set it up so that one cannot login to the POL user account.

2 Create the POL directory tree in the new accounts home directory. Do not forget to set up the file permissions, since POL will run as your new user. All directories in the new POL tree should belong to user/group POL user and should be set 0750 (rxwr-x---). You could also set the group id bit so that all files copied into this tree automatically belong to the new POL group. You could set up the directory permissions as 0755 (rwxr-x-r-x), which will make all directories world readable, but this is not necessary.

3 Copy all your files (*.src, *.inc, *.em, *.cfg, ...) into this tree where they belong, set owner and group to POL user, and give permissions for owner and group to read. POL will normally only write the save files and the log files, default is ./data (or ./log for the system logs) in the POL tree root directory. So the directory data should allow POL to write - but if you use the values from point 2 this should be okay.

4 Set up configuration (see POL docu) and do not forget to set up ecompile.cfg. Next use the instructions to generate your realm data. If you intend to run more than one POL server at the same time, you should use the realm data for both, if possible, else you only need the files readable in a configurable directory, default is ./realm in the POL root folder.

5 Your tree should look like this:
~/pol/config
~/pol/data
~/pol/pkg
~/pol/realm
...
Here ~ stands for the home directory (/home/poluser for example) of the new POL user, ~/pol is the root folder for you POL installation.

6 Now you are ready to ecompile all your scripts. I use a small batch for this, but the command 'ecompile -u -r scripts -r pkg' should do. (I do not use the POL distro, so modify this command as needed. Start the ecompile process as the POL user, not as root or any other user, or the compiled scripts will not belong to POL user!)

7 Now copy an empty worldfile or some worldfile you possess into the data directory. (Do not forget to set file ownership and permissions, or POL will be unable to read it!)

8 As the POL user cd to POL root (~/pol) and type pol into the shell: POL should now start up. This is not the ideal way to start it, but you will see if it runs, you will see error messages, and you can log in with a client. (Remember to do this as the POL user, not as root, or all your saves will be root owned!)

9 If this works, you can set up your shard (or copy data from your existing shard) and test it all.

10 As the last step you probably will need to start POL when the system starts. For this you need a startup script. The script goes to /etc/init.d and it needs to be registered with the systems startup mechanism - use your systems docu for this. If you rather wish to start POL manually, you still need the script, but you will start the script by typing its name. The script should be run as the root user, not as the POL user or it will fail. It sets up the POL server and starts it under the POL user.

Here is my script as an example:
(I use the system command 'start-stop-daemon', pleas look it up in the man pages, it should be here or you can install it.)

Start POL manually, name the script 'polstart' for example, and start it as the root user:
The POL user you created is in this examples poluser/polgroup, change this if you used different user- and group-names.

Code: Select all

#!/bin/bash
/sbin/start-stop-daemon --start --verbose --user poluser --name pol --pidfile /var/run/pol.pid --group polgroup /
--startas /home/poluser/pol/pol --chuid poluser --chdir /home/poluser/pol --background --make-pidfile
You can leave out the option --verbose later.
Stop POL manually, the POL server will stop gracefully, and will save the world state. You can modify this so the POL server shuts down gracefully, when your system goes down.

Code: Select all

#!/bin/bash
/sbin/start-stop-daemon --stop --user poluser --name pol --pidfile /var/run/pol.pid --group polgroup --chuid poluser /
--chdir /home/poluser/pol --retry 60
rm /var/run/pol.pid
If you want to know if POL server is running, check the pid file (/var/run/pol.pd). This is its purpose. But the pid file will not be removed, if POL crashes, so you need to read it, it contains the process id of your POL server. Check if the process runs.

To start the POL server at system start, you will use the same two commands like above, but you need to integrate them into a script which the systems init-mechanism can use - look into Ubuntus docu.

The advantage of this method: If POL is unsafe (has an exploitable bug), then a hacker cannot break into your system, since the pol process runs with user rights. Never start a process as root, if not absolutely necessary! Also the rights on the directories could be set even more restrictive. And you should isolate the POL user from the rest of the system (i.e. never use the POL users group for other users). This will make the POL user 'world' or 'other' to all other things on your system.
If you are even more paranoid you could also chroot the POL server to its home directory, but this is too complicated to explain here and not needed most of the time...

Hope this helps

OWHorus

black_s
New User
Posts: 8
Joined: Sun Oct 06, 2013 7:10 am

Re: installing POL in linux

Post by black_s » Sun Oct 06, 2013 12:19 pm

Hi friends,
thank you for your time!

The problem is: i stopped ad point 3, because i don't have file to copy...the only things i have it's the package i downloaded, and inside i can find exactly this file:
boats.cfg
core-changes.txt
extobj.cfg
orphans.txt
packethooks.txt
packets.zip
pol
pol.pid
uoconvert
uoconfert.cfg
uoconvert.txt
uotool

and the folder "script"

Nothign more :| also in point 4 you talk about a DOC for setup...what doc are you talking about? because i think i miss it...can you link please?

Thank you again for your time, slowly i figure out how to do this

black_s
New User
Posts: 8
Joined: Sun Oct 06, 2013 7:10 am

Re: installing POL in linux

Post by black_s » Sun Oct 06, 2013 11:20 pm

update, day 2: i try to install the windows versione of POL on my win7 machine...results? After many hours can't run it :| i try 098 and 099 but he can't find the skill .ecl file (and say that all of that don't exist!)

still trying :|


ETID: 10:49, local time
i have downloaded something like 20 zipped file (complete pol,pol core, script,worlds, utility, thinks that i don't know what they are, and other stuff) and i mixed up a folder with a 099 version that can work on my win 7 pc...ALL other version (097, 098) can't work because of error during the compile.

the target now is to have a clean server on win 7, with my favourite map, that can stay up without errors. After, i will return to the original goal to set it up in linux!

EDIT: 07/10/13, 22.14 local time
things are going better...i think. Server up in win7, and client connected...now i try to set up a little corner of world. Linux time incoming :bacondance:

Harley
Forum Regular
Posts: 353
Joined: Sat Mar 18, 2006 1:41 am
Location: Germany

Re: installing POL in linux

Post by Harley » Fri Jul 26, 2019 12:32 pm

Interesting things...
Not all of my scripts were compiled.
At my Windows VPN all scripts were compiled successfully, but at Ubuntu 18.04 - there is a mystery!
Compiling: /home/xxx/123/pkg/skills/standard/Spiritspeak/sSpeak.src
Unable to read include file '/home/xxx/123/pkg/player/community/guildstone/inc_public/guildStone_require.inc'
Compilation failed.
For this include I have that way in separate include:
include ":guildstone:inc_public/guildStone_require";
Which included at sSpeak.src:
// General requires
include ":Lib:inc_public/Lib_require";
And that script isn't one! There are many scripts, which "Unable to read" some include.

So, can someone help me with my sad experience of transfering POL to linux os? :D :deadhorse:

RusseL
Forum Regular
Posts: 371
Joined: Fri Feb 20, 2009 8:30 pm

Re: installing POL in linux

Post by RusseL » Sat Jul 27, 2019 2:19 am

Harley wrote:
Fri Jul 26, 2019 12:32 pm
Interesting things...
Not all of my scripts were compiled.
At my Windows VPN all scripts were compiled successfully, but at Ubuntu 18.04 - there is a mystery!
Compiling: /home/xxx/123/pkg/skills/standard/Spiritspeak/sSpeak.src
Unable to read include file '/home/xxx/123/pkg/player/community/guildstone/inc_public/guildStone_require.inc'
Compilation failed.
For this include I have that way in separate include:
include ":guildstone:inc_public/guildStone_require";
Which included at sSpeak.src:
// General requires
include ":Lib:inc_public/Lib_require";
And that script isn't one! There are many scripts, which "Unable to read" some include.

So, can someone help me with my sad experience of transfering POL to linux os? :D :deadhorse:
Linux is case sensitive. Upper and lowercase matter.
for example Lib_require and lib_require are different files.

Post Reply