pvpgn / pvpgn-server

Next generation of PvPGN server
https://pvpgn.pro
GNU General Public License v2.0
556 stars 157 forks source link

Correct useage of the /var directory #281

Open DragonZX opened 7 years ago

DragonZX commented 7 years ago

Directory /var/pvpgn is illegal for the most of Unix system /var/log/pvpgn /var/lib/pvpgn /var/games/pvpgn must be used

cen1 commented 7 years ago

/var/pvpgn is not used. How did you try to install it?

DragonZX commented 7 years ago

Ok, /usr/local/var/pvpgn . If someone need to disribute a binary package it's the most strange path for the package installation directory. As for sources installation - it won't be worse.

cen1 commented 7 years ago

You are correct, it is not by FHS. Can you write a full list of path changes that would have to be done?

DragonZX commented 7 years ago

As I noticed during package maintaining: /var/lib - for main /var /var/games - for gamesaves /var/log - for any logs /var/run - for pid files bin and sbin directory must be inside /usr

I don't know if I am completely correct, full list I'll try to provide ASAP

venmade commented 7 years ago

Shouldn't be hard for Ubuntu to specify the correct path (more precisely the ways which are already familiar) but, I see no reason to use a catalog of games.

DragonZX commented 7 years ago

As for /var/games it may not be used at all (it is only two/three temp files there, that can be modified in bnetd.conf and hasn't sources), but as we said about standarts, it must be. What does you mean 'for Ubuntu'. Ubuntu is not the only *nix OS

RElesgoe commented 7 years ago

@DragonZX Any progress on this?

DragonZX commented 7 years ago

Still research with other path issues. I've no time this weeks.

cen1 commented 7 years ago

How about we simply install to /opt/pvpgn or /var/lib/pvpgn? Postgresql installs to a single directory and has config, logs and data all in one place for example. The advantage of this approach is that you can simply copy the whole folder and move server somewhere else and it is also easier to navigate.

cen1 commented 7 years ago

@DragonZX does this seem reasonable?

Install the project... -- Install configuration: "" -- Installing: /usr/local/bin/bncdb -- Set runtime path of "/usr/local/bin/bncdb" to "" -- Installing: /usr/local/sbin/bntrackd -- Set runtime path of "/usr/local/sbin/bntrackd" to "" -- Installing: /usr/local/bin/bnchat -- Set runtime path of "/usr/local/bin/bnchat" to "" -- Installing: /usr/local/bin/bnftp -- Set runtime path of "/usr/local/bin/bnftp" to "" -- Installing: /usr/local/bin/bnbot -- Set runtime path of "/usr/local/bin/bnbot" to "" -- Installing: /usr/local/bin/bnstat -- Set runtime path of "/usr/local/bin/bnstat" to "" -- Installing: /usr/local/bin/bnilist -- Set runtime path of "/usr/local/bin/bnilist" to "" -- Installing: /usr/local/bin/bni2tga -- Set runtime path of "/usr/local/bin/bni2tga" to "" -- Installing: /usr/local/bin/bniextract -- Set runtime path of "/usr/local/bin/bniextract" to "" -- Installing: /usr/local/bin/bnibuild -- Set runtime path of "/usr/local/bin/bnibuild" to "" -- Installing: /usr/local/bin/tgainfo -- Set runtime path of "/usr/local/bin/tgainfo" to "" -- Installing: /usr/local/bin/bnpass -- Set runtime path of "/usr/local/bin/bnpass" to "" -- Installing: /usr/local/bin/sha1hash -- Set runtime path of "/usr/local/bin/sha1hash" to "" -- Installing: /usr/local/sbin/bnetd -- Set runtime path of "/usr/local/sbin/bnetd" to "" -- Installing: /var/log/pvpgn -- Installing: /usr/local/sbin/d2cs -- Set runtime path of "/usr/local/sbin/d2cs" to "" -- Installing: /usr/local/sbin/d2dbs -- Set runtime path of "/usr/local/sbin/d2dbs" to "" -- Installing: /usr/local/etc/pvpgn/bnetd_default_user.cdb -- Installing: /usr/local/etc/pvpgn/bnetd.conf -- Installing: /usr/local/etc/pvpgn/ad.json -- Installing: /usr/local/etc/pvpgn/anongame_infos.conf -- Installing: /usr/local/etc/pvpgn/address_translation.conf -- Installing: /usr/local/etc/pvpgn/autoupdate.conf -- Installing: /usr/local/etc/pvpgn/bnalias.conf -- Installing: /usr/local/etc/pvpgn/bnban.conf -- Installing: /usr/local/etc/pvpgn/bnetd_default_user.plain -- Installing: /usr/local/etc/pvpgn/bnissue.txt -- Installing: /usr/local/etc/pvpgn/bnmaps.conf -- Installing: /usr/local/etc/pvpgn/bnxpcalc.conf -- Installing: /usr/local/etc/pvpgn/bnxplevel.conf -- Installing: /usr/local/etc/pvpgn/channel.conf -- Installing: /usr/local/etc/pvpgn/command_groups.conf -- Installing: /usr/local/etc/pvpgn/realm.conf -- Installing: /usr/local/etc/pvpgn/sql_DB_layout.conf -- Installing: /usr/local/etc/pvpgn/supportfile.conf -- Installing: /usr/local/etc/pvpgn/topics.conf -- Installing: /usr/local/etc/pvpgn/tournament.conf -- Installing: /usr/local/etc/pvpgn/versioncheck.conf -- Installing: /usr/local/etc/pvpgn/icons.conf -- Installing: /usr/local/etc/pvpgn/d2cs.conf -- Up-to-date: /usr/local/etc/pvpgn/anongame_infos.conf -- Installing: /usr/local/etc/pvpgn/d2dbs.conf -- Installing: /usr/local/etc/pvpgn/i18n/bnhelp.conf -- Installing: /usr/local/etc/pvpgn/i18n/bnmotd.txt -- Installing: /usr/local/etc/pvpgn/i18n/chathelp-war3.txt -- Installing: /usr/local/etc/pvpgn/i18n/common.xml -- Installing: /usr/local/etc/pvpgn/i18n/newaccount.txt -- Installing: /usr/local/etc/pvpgn/i18n/news.txt -- Installing: /usr/local/etc/pvpgn/i18n/termsofservice.txt -- Installing: /usr/local/etc/pvpgn/i18n/w3motd.txt -- Installing: /usr/local/etc/pvpgn/i18n/bgBG -- Installing: /usr/local/etc/pvpgn/i18n/bgBG/bnmotd.txt -- Installing: /usr/local/etc/pvpgn/i18n/bgBG/common.xml -- Installing: /usr/local/etc/pvpgn/i18n/csCZ -- Installing: /usr/local/etc/pvpgn/i18n/csCZ/bnmotd.txt -- Installing: /usr/local/etc/pvpgn/i18n/csCZ/common.xml -- Installing: /usr/local/etc/pvpgn/i18n/deDE -- Installing: /usr/local/etc/pvpgn/i18n/deDE/bnhelp.conf -- Installing: /usr/local/etc/pvpgn/i18n/deDE/newaccount.txt -- Installing: /usr/local/etc/pvpgn/i18n/deDE/bnmotd.txt -- Installing: /usr/local/etc/pvpgn/i18n/deDE/termsofservice.txt -- Installing: /usr/local/etc/pvpgn/i18n/deDE/chathelp-war3.txt -- Installing: /usr/local/etc/pvpgn/i18n/deDE/common.xml -- Installing: /usr/local/etc/pvpgn/i18n/deDE/w3motd.txt -- Installing: /usr/local/etc/pvpgn/i18n/esES -- Installing: /usr/local/etc/pvpgn/i18n/esES/bnhelp.conf -- Installing: /usr/local/etc/pvpgn/i18n/esES/newaccount.txt -- Installing: /usr/local/etc/pvpgn/i18n/esES/bnmotd.txt -- Installing: /usr/local/etc/pvpgn/i18n/esES/termsofservice.txt -- Installing: /usr/local/etc/pvpgn/i18n/esES/chathelp-war3.txt -- Installing: /usr/local/etc/pvpgn/i18n/esES/common.xml -- Installing: /usr/local/etc/pvpgn/i18n/esES/w3motd.txt -- Installing: /usr/local/etc/pvpgn/i18n/frFR -- Installing: /usr/local/etc/pvpgn/i18n/frFR/bnmotd.txt -- Installing: /usr/local/etc/pvpgn/i18n/frFR/chathelp-war3.txt -- Installing: /usr/local/etc/pvpgn/i18n/frFR/common.xml -- Installing: /usr/local/etc/pvpgn/i18n/itIT -- Installing: /usr/local/etc/pvpgn/i18n/itIT/bnmotd.txt -- Installing: /usr/local/etc/pvpgn/i18n/itIT/common.xml -- Installing: /usr/local/etc/pvpgn/i18n/jpJA -- Installing: /usr/local/etc/pvpgn/i18n/jpJA/bnmotd.txt -- Installing: /usr/local/etc/pvpgn/i18n/jpJA/common.xml -- Installing: /usr/local/etc/pvpgn/i18n/koKR -- Installing: /usr/local/etc/pvpgn/i18n/koKR/bnmotd.txt -- Installing: /usr/local/etc/pvpgn/i18n/koKR/termsofservice.txt -- Installing: /usr/local/etc/pvpgn/i18n/koKR/common.xml -- Installing: /usr/local/etc/pvpgn/i18n/nlNL -- Installing: /usr/local/etc/pvpgn/i18n/nlNL/bnmotd.txt -- Installing: /usr/local/etc/pvpgn/i18n/nlNL/common.xml -- Installing: /usr/local/etc/pvpgn/i18n/plPL -- Installing: /usr/local/etc/pvpgn/i18n/plPL/bnmotd.txt -- Installing: /usr/local/etc/pvpgn/i18n/plPL/common.xml -- Installing: /usr/local/etc/pvpgn/i18n/ptBR -- Installing: /usr/local/etc/pvpgn/i18n/ptBR/bnmotd.txt -- Installing: /usr/local/etc/pvpgn/i18n/ptBR/common.xml -- Installing: /usr/local/etc/pvpgn/i18n/ruRU -- Installing: /usr/local/etc/pvpgn/i18n/ruRU/bnmotd.txt -- Installing: /usr/local/etc/pvpgn/i18n/ruRU/chathelp-war3.txt -- Installing: /usr/local/etc/pvpgn/i18n/ruRU/common.xml -- Installing: /usr/local/etc/pvpgn/i18n/svSE -- Installing: /usr/local/etc/pvpgn/i18n/svSE/bnmotd.txt -- Installing: /usr/local/etc/pvpgn/i18n/svSE/common.xml -- Installing: /usr/local/etc/pvpgn/i18n/zhCN -- Installing: /usr/local/etc/pvpgn/i18n/zhCN/bnmotd.txt -- Installing: /usr/local/etc/pvpgn/i18n/zhCN/chathelp-war3.txt -- Installing: /usr/local/etc/pvpgn/i18n/zhCN/common.xml -- Installing: /usr/local/etc/pvpgn/i18n/zhTW -- Installing: /usr/local/etc/pvpgn/i18n/zhTW/bnmotd.txt -- Installing: /usr/local/etc/pvpgn/i18n/zhTW/common.xml -- Installing: /usr/local/share/man/man1/bnbot.1 -- Installing: /usr/local/share/man/man1/bnchat.1 -- Installing: /usr/local/share/man/man1/bnetd.1 -- Installing: /usr/local/share/man/man1/bnetd.conf.5 -- Installing: /usr/local/share/man/man1/bnftp.1 -- Installing: /usr/local/share/man/man1/bni2tga.1 -- Installing: /usr/local/share/man/man1/bnibuild.1 -- Installing: /usr/local/share/man/man1/bniextract.1 -- Installing: /usr/local/share/man/man1/bnilist.1 -- Installing: /usr/local/share/man/man1/bnpass.1 -- Installing: /usr/local/share/man/man1/bnpcap.1 -- Installing: /usr/local/share/man/man1/bnproxy.1 -- Installing: /usr/local/share/man/man1/bnstat.1 -- Installing: /usr/local/share/man/man1/bntext.5 -- Installing: /usr/local/share/man/man1/bntrackd.1 -- Installing: /usr/local/share/man/man1/tgainfo.1 -- Installing: /var/lib/pvpgn -- Installing: /var/lib/pvpgn/bnmail -- Installing: /var/lib/pvpgn/status -- Installing: /var/lib/pvpgn/reports -- Installing: /var/lib/pvpgn/userlogs -- Installing: /var/lib/pvpgn/users -- Installing: /var/lib/pvpgn/charinfo -- Installing: /var/lib/pvpgn/teams -- Installing: /var/lib/pvpgn/userscdb -- Installing: /var/lib/pvpgn/chanlogs -- Installing: /var/lib/pvpgn/bak -- Installing: /var/lib/pvpgn/bak/charinfo -- Installing: /var/lib/pvpgn/bak/charsave -- Installing: /var/lib/pvpgn/ladders -- Installing: /var/lib/pvpgn/charsave -- Installing: /var/lib/pvpgn/clans -- Installing: /var/lib/pvpgn/files/ad000001.png -- Installing: /var/lib/pvpgn/files/ad000001.smk -- Installing: /var/lib/pvpgn/files/ad000002.mng -- Installing: /var/lib/pvpgn/files/newbie.save -- Installing: /var/lib/pvpgn/files/bnserver.ini -- Installing: /var/lib/pvpgn/files/bnserver-D2DV.ini -- Installing: /var/lib/pvpgn/files/bnserver-D2XP.ini -- Installing: /var/lib/pvpgn/files/bnserver-WAR3.ini -- Installing: /var/lib/pvpgn/files/ver-IX86-1.mpq -- Installing: /var/lib/pvpgn/files/IX86ver1.mpq -- Installing: /var/lib/pvpgn/files/PMACver1.mpq -- Installing: /var/lib/pvpgn/files/XMACver1.mpq -- Installing: /var/lib/pvpgn/files/IX86ExtraWork.mpq -- Installing: /var/lib/pvpgn/files/icons.bni -- Installing: /var/lib/pvpgn/files/icons-WAR3.bni -- Installing: /var/lib/pvpgn/files/icons_STAR.bni

DragonZX commented 7 years ago

@cen1 In my opinion, it may be compiled to the opt directory anyway. All logs MUST be in the /var/log directory, due to logrotate functions. Also as pid must be in /var/run to use it with daemons

cen1 commented 7 years ago

I decided to use /usr/local since it is the correct path for local software installations. I'll add /var/run and then prepare a pull request to test it.

cen1 commented 7 years ago

I had to add additional cmake flag for custom paths because /var/log and /var/run are static and can't be prefixed with EXEC_INSTALL_PREFIX. For custom paths, all files preside under that custom root.

cmake -G "Unix Makefiles" -H./ -B./build -DCMAKE_INSTALL_PREFIX=/home/cen/pvpgni -DCUSTOM_INSTALL_PATH=true

Without changing it, default is /usr/local I need a review before merge request: https://github.com/cen1/pvpgn-server/tree/installpath

DragonZX commented 7 years ago

I'll check ASAP, maybe during this weekend

onlyjob commented 3 years ago

FHS non-compliance is a serious issue. Everything is installed to wrong place and this is an obstacle to updating the official Debian package. CMAKE makes customisation of installation directories relatively easy:

but pvpgn hard-codes locations in cmake/Modules/DefineInstallationPaths.cmake which makes them needlessly difficult to override. I've used the following patch:

Description: install "/etc" and "/var" where they belong.

--- a/cmake/Modules/DefineInstallationPaths.cmake
+++ b/cmake/Modules/DefineInstallationPaths.cmake
@@ -36,9 +36,9 @@
     FORCE
   )
 else()
   SET(LOCALSTATE_INSTALL_DIR
-    "${EXEC_INSTALL_PREFIX}/var/${APPLICATION_NAME}"
+    "${CMAKE_INSTALL_LOCALSTATEDIR}/lib/${APPLICATION_NAME}"
     CACHE PATH "The ${APPLICATION_NAME} local state install dir (default prefix/var)"
     FORCE
   )
 endif()
@@ -70,9 +70,9 @@
     FORCE
   )
 else()
   SET(SYSCONF_INSTALL_DIR
-    "${EXEC_INSTALL_PREFIX}/etc/${APPLICATION_NAME}"
+    "${CMAKE_INSTALL_SYSCONFDIR}/${APPLICATION_NAME}"
     CACHE PATH "The ${APPLICATION_NAME} sysconfig install dir (default prefix/etc)"
     FORCE
   )
 endif()
\ No newline at end of file

Another problem is that i18n files are installed to /etc/pvpgn which is wrong. i18n should be installed to /usr/share/pvpgn but I'm not sure what is the best way to modify conf/i18n/CMakeLists.txt to accomplish that...

RElesgoe commented 3 years ago

Everything is installed to wrong place and this is an obstacle to updating the official Debian package.

Be aware that this repository is PvPGN PRO, a fork of the official PvPGN.

Related: #425

onlyjob commented 3 years ago

Be aware that this repository is PvPGN PRO, a fork of the official PvPGN.

Looks like a continuation to me. Original project is dormant with no activity in SourceForge project for about a decade. The original PvPGN web site on berlios.de refers to PvPGN PRO (which points to this very project). As far as I can say, no development of this software is done elsewhere...

DragonZX commented 3 years ago

As this project has had no new commits for a long time, I'll try to review it again. 4 years ago it's finished by placing all the files to the /opt directory and reconfiguring logrotate for it. I think it's no need to provide compatibility with the old package, however, we need to beautify its structure.