pvpgn-server icon indicating copy to clipboard operation
pvpgn-server copied to clipboard

Correct useage of the /var directory

Open DragonZX opened this issue 9 years ago • 18 comments

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

DragonZX avatar Jan 03 '17 15:01 DragonZX

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

cen1 avatar Jan 03 '17 16:01 cen1

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.

DragonZX avatar Jan 03 '17 16:01 DragonZX

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

cen1 avatar Jan 03 '17 17:01 cen1

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

DragonZX avatar Jan 03 '17 17:01 DragonZX

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.

venmade avatar Jan 04 '17 12:01 venmade

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

DragonZX avatar Jan 04 '17 13:01 DragonZX

@DragonZX Any progress on this?

RElesgoe avatar Jan 17 '17 16:01 RElesgoe

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

DragonZX avatar Jan 17 '17 16:01 DragonZX

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 avatar Feb 24 '17 11:02 cen1

@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

cen1 avatar Mar 23 '17 23:03 cen1

@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

DragonZX avatar Mar 24 '17 07:03 DragonZX

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 avatar Mar 24 '17 08:03 cen1

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

cen1 avatar Mar 29 '17 21:03 cen1

I'll check ASAP, maybe during this weekend

DragonZX avatar Mar 30 '17 08:03 DragonZX

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:

  • https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html
  • https://cmake.org/cmake/help/latest/command/install.html

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...

onlyjob avatar Sep 14 '21 04:09 onlyjob

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

RElesgoe avatar Sep 14 '21 06:09 RElesgoe

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...

onlyjob avatar Sep 14 '21 08:09 onlyjob

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.

DragonZX avatar Sep 14 '21 08:09 DragonZX