Jump to content

DMP Linux Server Tools


dsonbill

Recommended Posts

Current Status: WORKING

(Debian/Ubuntu & RHEL/CentOS)

*PLEASE READ UPDATE INSTRUCTIONS BELOW!

THIS HAS CHANGE QUITE A BIT!!!!!! YOU HAVE BEEN WARNED!

Update 01/06/15

The pbinstall script now has an update option (for updating what's already in pbinstall) and a no-disclaim option (for unattended installs)!

To update your pbinstall file (if you already downloaded it), just run:

cd ~/dmpinstaller && curl http://pastebin.com/raw.php?i=42ypMCgb | tr -d '\r' > ./pbinstall

If this is the first time you are running pbinstall/installing DMP with these tools, you can ignore this update and proceed to the install instructions at the bottom of this post.

What is this?

A set of linux-native tools for administering and installing a DarkMultiPlayer server on GNU/Linux. This is primarily aimed at remote linux servers, which typically have no GUI.

What does it include?

dmpserver - For controlling the state of the servers USAGE: 'sudo dmpserver start' OR 'sudo dmpserver servername start'

dmpcmd - For sending commands to DMPServers USAGE: 'sudo dmpcmd servername "admin add dsonbill"'

dmpbashupdater - For updating the base executables and updating environment symlinks USAGE: 'sudo dmpbashup' OR 'sudo dmpserver update'

dmpenv - For installing and updating DMPServer environments USAGE: 'sudo dmpenv install servername' OR 'sudo dmpenv update servername' (Latter should not be necessary! It is handled by dmpbashupdater)

What will this NOT do for me?

Open ports, install mono, configure your server; you will still need to do this. You can configure the default server by modifying the files in /srv/dmpserver/default.

Current Directory Structure for DMPServer:

  • DMPServer installed in /usr/share/dmpserver
  • DMPServer environments are in /srv/dmpserver. Each folder here is an individual DMPServer instance.
  • dmpserver.cfg in /etc/dmpserver
  • server config files are NO LONGER in /etc/dmpserver/config
  • dmpserver command- just run 'sudo dmpserver start' to start it (run 'sudo dmpserver' for other usage)

Pastebin Bootstrap Script

CHANGELOG

12/27/14

  • Merged pbpkg and pastebin bootstrap; renamed; added chmod to directory and file creation, so post install script is much cleaner.

9/15/14

  • Made addSysUserList more distro-agnostic. I tested and succeeded with a Debian install today, so we're getting close to finalizing the bare tools.

9/10/14

  • Merged post-install script into pbpkg.

DMPLinTools

Pastebin Bootstrap: http://pastebin.com/42ypMCgb

CHANGELOG

12/27/14

  • Merged pastebin bootstrap; fixed 0.90 and future repo change support(environment needs some work so symlinks will update when server software is updated); removed foobar and added a common lib.

9/15/14

  • Fixed the post-install script. The script is confirmed to work on CentOS 6.5 and Debian jessie (will almost certainly work fine on ubuntu).

9/14/14

  • Fixed up the dmpcmd script. It works a bit more intuitively now.
  • Moved the shutdown wait and message into dmpcmd; the wait time and message can be edited in '/etc/dmpserver/dmpserver.cfg'
  • You can now do stop-fast and restart-fast to skip the shutdown_count with the daemon.

9/11/14

  • Combined tools! Now we're starting to scratch that surface....

**** Update Instructions ****

IF YOU USED AN OLDER VERSION, please follow the below steps to clean out your server:

STOP DMPSERVER! Very important!

Delete '/usr/share/dmpserver'

BACK UP your settings files from'/etc/dmpserver/config'! These will be placed into '/srv/dmpserer/default' if you wish to keep your settings!

Delete '/etc/dmpserver' - Please note that for the moment, your server config files will NOT be showing up here! I will work on this very soon.

BACK UP '/srv/dmpserver/bin/Universe' and your DMPServerSettings.txt file from '/srv/dmpserver/bin'! This is VERY IMPORTANT! VERY, VERY IMPORTANT! These will be placed into '/srv/dmpserver/default' if you wish to keep your progress!

Delete '/srv/dmpserver'

Delete '/tmp/dmplog' - Logs will no longer go in here, as log rotation has been implemented. I may eventually move the logs again to the relevant location, though.

Now, follow the installation instructions below (MAKE SURE you re-download the pbinstall script - just delete ~/dmpinstaller and run the big line I've provided below.)

After the installation has completed, run 'sudo dmpserver start' and then 'sudo dmpserver stop-fast'. Now you can re-add your Universe and config files to '/srv/dmpserver/default', and continue from where you left off!

Installation Instructions

  • Install mono, screen and curl ('apt-get install mono-complete screen curl' on debian/ubuntu)
  • Download pbinstall and run (copy the lines below into the terminal one by one, exactly as they are. Then read the disclaimer and press y or n). pbinstall will install DMPServer, the dmpserver daemon, dmpbashup, dmpenv, dmpcmd, and dmpbashlib


cd ~ && mkdir dmpinstaller && cd dmpinstaller && curl http://pastebin.com/raw.php?i=42ypMCgb | tr -d '\r' > ./pbinstall && chmod +x ./pbinstall # This will download and save the DMPServer bootstrap script to a file named 'pbinstall' in ~/dmpinstaller.

su # Enter your root password

./pbinstall

  • Open any ports necessary.
  • Head over to /srv/dmpserver/default and modify the configuration files.
  • When you're done with the configuration, run 'sudo dmpserver restart' to restart the server and apply your new settings.
  • You can run 'sudo dmpserver update' or 'dmpbashup' to update the server. These commands can be run from anywhere.
  • Additionally, you can now install multiple servers using 'dmpenv install newservername'. This will install a new server environment in /srv/dmpserver with the specified name.
  • You can control the additional servers by doing 'dmpserver newservername {start|stop|etc}'.
  • Outdated links should get taken care of automagically by dmpbashup

88x31.png

To the extent possible under law, William Donaldson has waived all copyright and related or neighboring rights to this work. This work is published from: United States.

Edited by dsonbill
Cleaned up the thread a bit, new info on structure, etc.
Link to comment
Share on other sites

As I pointed out before, so long as you keep 'rm -rf DMPServer' in that update script, you're running the risk of completely wiping out someones server.

Easy fix: Extract DMPServer into /tmp/DMPServer-randomnumbers and rsync from that, or extract the zip directly over the server folder.

Harder but cleaner fix: Compare the server folder against DMPUpdater's server index file and replace the files as needed. The hashes are sha256sum's, and the individual files are saved with their hashsum in the objects folder.

If you like, I'll write a portable version of DMPUpdater in bash.

EDIT: Forgot to mention, if you want to actually package DMPServer (as in I'll run a script that fires on a release build) I can host it on my build server, but I'll need help with the file structure for centos, I exclusively run debian/unstable.

If you'd like to host your own repo intsead, I can provide a http-hook to let you know when a new release build is available.

Edited by godarklight
Link to comment
Share on other sites

I've taken the second easy suggestion for now(there's not even a reason to remove the .zip, lol. That's what happens when you write too fast >.>), but 'unzip -joq' is still dangerous in my opinion.

The best option is obviously to use the update mech you've made. While I'd love for an official portable bash version, I think your time is better spent on DMP itself :) This updater, as it stands, will be an early daemon command.

The real beauty in your repo is that there is pretty much no reason to package it outright, imo. An install script can just mkdir a dmp/dmpserver folder in /usr/local/bin and dl from your repo directly; people seem to be migrating to this method of installation on servers anyway.

The only problem I can foresee in this is mono. I assume most of the people who run a server just do 'mono ./DMPServer.exe', but I have no such luxury on CentOS. I was actually going to compile it so I COULD use it like that, but compiling more than one thing to be able to compile mono was another unappealing road... So, I have mono installed in opt. Yes, it's in opt. IDK why people insist on using /opt on full installations of linux, but they #^%@*&$#^% do.

Maybe I should just make a symlink to /usr/bin and expect anyone using CentOS to do the same? I have no idea what to do in this situation, or what I should expect from people, lol. But, I'm going to go ahead and assume 90% of them are running Debian-based systems, so I guess I can just make a little note for people running CentOS/non-standard mono installs. I guess my next step will be to install a debian server and test out the daemon. I wish I could dl directly to an esxi server without feeling dirty! >.>

Also, I don't know why CentOS has the lockfile in the daemon skeleton, but it's unnecessary. I'm going to remove that bit and put the pid in it's proper place.

After looking at this script here, it looks like the daemon should work on Debian-based systems as well (other than mono being in opt, of course).

EDIT: Lookit me, I quit being "lazy" and added that symlink :P

UPDATE 9/3/14: Just a little update, I'm getting ready to install Debian on my server. It's strange; I never thought I'd be intimidated about returning to Debian. Then again, I never thought I'd get used to CentOS >.>

UPDATE 9/3/14-B: Dear me, I have Debian again... Looks like my server is finally getting some use!

UPDATE Later that night: You Debian people... so spoiled; there's an official package for everything! :) Mono is installed, no python 3 yet, but I'll get to that soon enough. Thinking of stopping for the night...

2 minutes later: Damn is it nice to just install python 3 from a package... Compiling it is my worst enemy.

Edited by dsonbill
Link to comment
Share on other sites

I guess we are a little spoiled when it comes to packages.

Writing a bash script for updating DMPServer wouldn't be a complete waste of time for me (Although from your edit you sound like you've already done this). I never bothered writing a bash script for updating before because if you're intending to host a DMP server, you have mono installed, and if mono is installed, DMPUpdater will work :)

The only reason K/DMPUpdater exists is because I needed a simple version of rsync for windows, and the only reason why it has a http backend is because I had an existing apache server install and I try to maximise lazyness :).

Link to comment
Share on other sites

Writing a bash script for updating DMPServer wouldn't be a complete waste of time for me (Although from your edit you sound like you've already done this). I never bothered writing a bash script for updating before because if you're intending to host a DMP server, you have mono installed, and if mono is installed, DMPUpdater will work :)

Those are both pretty much the reasons I had in mind as well, lol!

I've done a decent portion of it. All that's left is to test and download the files, which will take another 15 minutes to write properly. I may have time to do it later tonight; for now, here is the first portion of it : Removed old link. See OP for release.

Notice: Directory structure subject to change (very soon).

Edited by dsonbill
Link to comment
Share on other sites

  • 1 month later...

Hey, I installed DMP Server on my Ubuntu Machine by following the instructions here. I was able to connect then when I turned the machine off for the night an then back on in the morning I was unable to connect, i have checked everything I can and can't find the issue.

How do I uninstall the DMP server so I can reinstall it fresh?

Link to comment
Share on other sites

Hey, I installed DMP Server on my Ubuntu Machine by following the instructions here. I was able to connect then when I turned the machine off for the night an then back on in the morning I was unable to connect, i have checked everything I can and can't find the issue.

How do I uninstall the DMP server so I can reinstall it fresh?

The server won't start up automatically. To start it, you must do 'dmpserver start' from the terminal. Although I'll only use my server with this system, it's not really ready for use by everyday people.

If you would like to remove it, just delete the following folders:

/usr/share/dmpserver

/etc/dmpserver

/srv/dmpserver

There are a few more but they are inconsequential and will be deleted eventually by the OS.

Link to comment
Share on other sites

The server won't start up automatically. To start it, you must do 'dmpserver start' from the terminal. Although I'll only use my server with this system, it's not really ready for use by everyday people.

If you would like to remove it, just delete the following folders:

/usr/share/dmpserver

/etc/dmpserver

/srv/dmpserver

There are a few more but they are inconsequential and will be deleted eventually by the OS.

Thanks for the help, I understood how to start/stop/restart the server etc. it was just that It was refusing any connection when the server was running. All is fine now thanks :D

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
  • 2 weeks later...

Bleh, this thing is a little broken. It needs some serious work. It's also not really going to work for the new version, due to me hardcoding some stuff that shouldn't be hardcoded. I'm currently updating this to work with the new version of DMP, as well as to allow you to install multiple DMP servers. PLEASE do not attempt to use this at this time, as it's borked. If you installed it already, you can just dl DMPServer and stuff it in screen manually for now until I update it.

It is being worked on RIGHT NOW! :)

Link to comment
Share on other sites

  • 2 weeks later...

Thank you very much for the bug report! I left out a necessary set of quotes :P

(Also fixed the embarrassing lack of using the lib file >.<)

You can run the following command to update dmpcmd. In the future, I will make a command for the pbinstall script to update things.

sudo sh -c 'curl http://pastebin.com/raw.php?i=ZTTUF4dH | tr -d "\r" > /usr/bin/dmpcmd'

To use it with multi-part commands, just put quotes around the entry, i.e. 'sudo dmpcmd default "admin add username"' .

Edited by dsonbill
Link to comment
Share on other sites

  • 1 month later...

I everybody, i post this message because i need you, so, i've installed all on my Ubuntu server and first, the DMPServerSettings isn't generated, and when i want to go on my server , i got this error :

No connection could be made because the target machine actively refused.

Thank you for your help.

Link to comment
Share on other sites

  • 8 months later...
  • 3 months later...

pastebin have changed the way things work.

The command should be

cd ~/dmpinstaller && curl http://pastebin.com/raw/42ypMCgb | tr -d '\r' > ./pbinstall

or (for fist timers)

cd ~ && mkdir dmpinstaller && cd dmpinstaller && curl http://pastebin.com/raw/42ypMCgb | tr -d '\r' > ./pbinstall && chmod +x ./pbinstall

once you have done that you need to open 'pbinstall' in your favourite editor. and change this line from:

PASTEBIN_API="http://pastebin.com/raw.php?i="

to:

PASTEBIN_API="http://pastebin.com/raw/"

Then continue on with the instructions (run pbinstall)

Link to comment
Share on other sites

  • 2 months later...
  • 4 months later...

Hi there,

Great work I here I hope but I haven't got it working yet. The reason I haven't got it working is because the urls that curl is trying to hit have moved and curl won't follow the relocation.

I've modified my local pbinstall to include the -L flag for curl but I thought it might also be useful to change the install instructions from

cd ~/dmpinstaller && curl http://pastebin.com/raw.php?i=42ypMCgb | tr -d '\r' > ./pbinstall

to

cd ~/dmpinstaller && curl -L http://pastebin.com/raw.php?i=42ypMCgb | tr -d '\r' > ./pbinstall

 

Thanks for putting this together, I look forward to playing with it.

ML

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...