Ns Files Messed Up

SVisionsSVisions Join Date: 2003-08-10 Member: 19375Members
edited August 2003 in Linux Server Support
I unzipped all of the NS server files, but at the end of every line there is a "^M".

How can I fix this, did I just get a bad copy?

Doing unzip -a would remove the ^M's but understandably it says not to do that in the install instructions because it probably misinterprets and does it on some of the binaries as well.

<b>Turns out the ^M's weren't the problem, read the rest of the thread, or near the end.</b>

Comments

  • VadakillVadakill The Almighty BSO Join Date: 2002-04-02 Member: 373Members, NS1 Playtester
    Do a:

    <!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
    cat server.cfg | sed 's/^M//g' > server.cfg.new
    <!--c2--></td></tr></table><span class='postcolor'><!--ec2-->

    That will remove all of the "^M" characters from the server.cfg file and output the results to server.cfg.new. From there you can just:

    <!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
    mv server.cfg.new server.cfg
    <!--c2--></td></tr></table><span class='postcolor'><!--ec2-->
  • SVisionsSVisions Join Date: 2003-08-10 Member: 19375Members
    I tried that, and I tried:

    <!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->grep -v ^M server.cfg > server.cfg.new<!--c2--></td></tr></table><span class='postcolor'><!--ec2-->

    As well, neither did it.

    I'm in the middle of downloading the NS server files from another site, I think I must have got a bad zip. Too bad the download is frozen and I'm gonna have to start over <!--emo&:(--><img src='http://www.unknownworlds.com/forums/html/emoticons/sad.gif' border='0' style='vertical-align:middle' alt='sad.gif'><!--endemo-->
  • SVisionsSVisions Join Date: 2003-08-10 Member: 19375Members
    edited August 2003
    Nope, downloading another didn't help.

    This isn't happening to anyone else?

    I'm using OpenBSD and latest unzip from ports.
  • SVisionsSVisions Join Date: 2003-08-10 Member: 19375Members
    edited August 2003
    Ok, I'm really confused now.

    I moved the zip over to one of my linux boxes and unzipped it there, files looked fine so I moved the dir into a public webdir and did a recursive wget from the openbsd box and pulled the whole folder. The ^M's are still there.

    So is it wget or vi?

    edit: Opened it up in nano and the ^M's were removed and it said:

    [ Read 57 lines (Converted from DOS format) ]

    But the ^M's are still there even after I save it, and look at it in vi.

    And of course it's in more than just the server.cfg - so I can't just go through and remove the ^M's in these files one by one.
  • verboseverbose Join Date: 2002-11-25 Member: 9968Members, Constellation
    It's not corrupt. They're "dos" format text files "carriage return + line feed". You can either convert the end-of-line characters using a text editor that understands both dos & unix EOL characters, use a program like "dos2unix", or just ignore those ^M characters (they're the carriage return).
  • SVisionsSVisions Join Date: 2003-08-10 Member: 19375Members
    edited August 2003
    Yeah I could just ignore them except I get this error when I try and load the ns server:

    <!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->Memory fault (core dumped)<!--c2--></td></tr></table><span class='postcolor'><!--ec2-->

    So I was thinking it had something to do with the ^M's because the server loads fine as a TFC server for example.

    And I can't use something like DOS2UNIX otherwise I would just do unzip -a when extracting NS.
  • verboseverbose Join Date: 2002-11-25 Member: 9968Members, Constellation
    unzip -a doesn't work because it converts some binary files it shouldn't. You can dos2unix the config files safely.

    Probably not the source of your problem though. I run unconverted config files.

    Any other messages around the crash? what does running gdb on your core file yield?
  • SVisionsSVisions Join Date: 2003-08-10 Member: 19375Members
    edited August 2003
    You're right, it wasn't the problem. I unzipped it elsewhere and uploaded them piece by piece ASCII and BINARY manually, same error.

    Also, I'm not sure what you mean by running gdb on my core file.

    And it strikes me as odd that the TFC server runs fine but the NS server doesn't.

    HLDS version is 1110.

    Here's what happens before:

    <!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->PackFile: /home/sean/hlds_l/valve/pak0.pak : models/hgibs.mdl
    PackFile: /home/sean/hlds_l/valve/pak0.pak : models/agibs.mdl
    Memory fault (core dumped)<!--c2--></td></tr></table><span class='postcolor'><!--ec2-->

    So it happens when it loads the map.
  • verboseverbose Join Date: 2002-11-25 Member: 9968Members, Constellation
    If your environment is configured to create a core file when programs crash, you should have either hlds.core, hlds_amd.core, or hlds_i686.core. run <b>gdb -q hlds hlds.core</b> (adjust filename appropriately). The output should give a hint to why it crashed.
  • SVisionsSVisions Join Date: 2003-08-10 Member: 19375Members
    <!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->-bash-2.05b$ gdb -q hlds hlds.core
    Core was generated by `hlds'.
    Program terminated with signal 11, Segmentation fault.
    #0  0x480b815d in ?? ()<!--c2--></td></tr></table><span class='postcolor'><!--ec2-->
  • verboseverbose Join Date: 2002-11-25 Member: 9968Members, Constellation
    eah, so that's no help. Distro?
  • SVisionsSVisions Join Date: 2003-08-10 Member: 19375Members
  • verboseverbose Join Date: 2002-11-25 Member: 9968Members, Constellation
    <!--QuoteBegin--SVisions+Aug 10 2003, 09:25 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (SVisions @ Aug 10 2003, 09:25 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> OpenBSD 3.3 <!--QuoteEnd--> </td></tr></table><span class='postcolor'> <!--QuoteEEnd-->
    ahh. Does OpenBSD have a linux-compatibility setup like FreeBSD's? If so, does it have a compatible /proc filesystem you can mount? Perhaps the information in the stickied FreeBSD thread helps?
  • SVisionsSVisions Join Date: 2003-08-10 Member: 19375Members
    edited August 2003
    <!--QuoteBegin--verbose+Aug 10 2003, 08:40 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (verbose @ Aug 10 2003, 08:40 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> <!--QuoteBegin--SVisions+Aug 10 2003, 09:25 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (SVisions @ Aug 10 2003, 09:25 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> OpenBSD 3.3 <!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    ahh. Does OpenBSD have a linux-compatibility setup like FreeBSD's? If so, does it have a compatible /proc filesystem you can mount? Perhaps the information in the stickied FreeBSD thread helps? <!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    Only thing I really found was /usr/ports/emulation/redhat - which I installed.

    I haven't found anything else really.

    Anyone else running a NS server on OpenBSD?
  • SVisionsSVisions Join Date: 2003-08-10 Member: 19375Members
    edited August 2003
    <!--QuoteBegin--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->compat_linux(8)         OpenBSD System Manager's Manual        compat_linux(8)

    NAME
         compat_linux - setup for running Linux binaries under emulation

    DESCRIPTION
         OpenBSD supports running Linux binaries.  This only applies to i386 sys-
         tems for now.  Both the a.out and ELF binary formats are supported.  Most
         programs should work, including the ones that use the Linux SVGAlib.  Ad-
         ditionally, OSS audio is emulated, so Linux binaries can access the na-
         tive audio transparently.  <b>Programs that will not work include those that
         use the Linux /proc filesystem (which is different from the optional
         OpenBSD /proc filesystem)</b>, and i386-specific calls, such as enabling vir-
         tual 8086 mode.

         The Linux compatibility feature is active for kernels compiled with the
         COMPAT_LINUX option enabled.

         A lot of programs are dynamically linked.  This means that the Linux
         shared libraries that the programs depend on and the runtime linker are
         also needed.  Additionally, a "shadow root" directory for Linux binaries
         on the OpenBSD system will have to be created.  This directory is named
         /emul/linux. Any file operations done by Linux programs run under OpenBSD
         will look in this directory first.  So, if a Linux program opens, for ex-
         ample, /etc/passwd, OpenBSD will first try to open
         /emul/linux/etc/passwd, and if that does not exist open the `real'
         /etc/passwd file.  It is recommended that Linux packages that include
         configuration files, etc., be installed under /emul/linux, to avoid nam-
         ing conflicts with possible OpenBSD counterparts.  Shared libraries
         should also be installed in the shadow tree.

         Generally, it will only be necessary to look for the shared libraries
         that Linux binaries depend on the first few times that Linux programs are
         installed on the OpenBSD system.  After a while, there will be a suffi-
         cient set of Linux shared libraries on the system to be able to run newly
         imported Linux binaries without any extra work.

    Setting up shared libraries
         How to get to know which shared libraries Linux binaries need, and where
         to get them?  Basically, there are 3 possibilities.  (When following
         these instructions, root privileges are required on the OpenBSD system to
         perform the necessary installation steps).

         1.   Access to the OpenBSD ports(7) system: Install the port named
              redhat/base in the emulators category.  The redhat/base port con-
              tains the shared libraries, binaries, and other related files neces-
              sary to run Linux applications.  Access to a Linux system is not
              needed.<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->

    So I guess this means I'm screwed?

    I've already done what it said on the man page.
  • verboseverbose Join Date: 2002-11-25 Member: 9968Members, Constellation
    <!--QuoteBegin--SVisions+Aug 10 2003, 09:56 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (SVisions @ Aug 10 2003, 09:56 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> So I guess this means I'm screwed?

    I've already done what it said on the man page. <!--QuoteEnd--> </td></tr></table><span class='postcolor'> <!--QuoteEEnd-->
    Sounds very similar to FreeBSD's rig; you should be fine. However, under freebsd, you need to mount a linux-compatible proc filesystem. Do you have a mount type of linprocfs or something similar? See the "Freebsd and ns I got it working" thread.
  • SVisionsSVisions Join Date: 2003-08-10 Member: 19375Members
    <!--QuoteBegin--verbose+Aug 10 2003, 09:11 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (verbose @ Aug 10 2003, 09:11 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> <!--QuoteBegin--SVisions+Aug 10 2003, 09:56 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (SVisions @ Aug 10 2003, 09:56 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> So I guess this means I'm screwed?

    I've already done what it said on the man page. <!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    Sounds very similar to FreeBSD's rig; you should be fine. However, under freebsd, you need to mount a linux-compatible proc filesystem. Do you have a mount type of linprocfs or something similar? See the "Freebsd and ns I got it working" thread. <!--QuoteEnd--> </td></tr></table><span class='postcolor'> <!--QuoteEEnd-->
    Read the part I set in bold of the man page quote.
  • verboseverbose Join Date: 2002-11-25 Member: 9968Members, Constellation
    <!--QuoteBegin--SVisions+Aug 10 2003, 10:13 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (SVisions @ Aug 10 2003, 10:13 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> <!--QuoteBegin--verbose+Aug 10 2003, 09:11 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (verbose @ Aug 10 2003, 09:11 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> <!--QuoteBegin--SVisions+Aug 10 2003, 09:56 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (SVisions @ Aug 10 2003, 09:56 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> So I guess this means I'm screwed?

    I've already done what it said on the man page. <!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    Sounds very similar to FreeBSD's rig; you should be fine. However, under freebsd, you need to mount a linux-compatible proc filesystem. Do you have a mount type of linprocfs or something similar? See the "Freebsd and ns I got it working" thread. <!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    Read the part I set in bold of the man page quote. <!--QuoteEnd--> </td></tr></table><span class='postcolor'> <!--QuoteEEnd-->
    Yeah, I saw that. However, one could read that as "compat_linux does not include a /proc filesystem; get one elsewhere." The only reason I suggest that is because the two are somewhat separate in FreeBSD as well.
  • SVisionsSVisions Join Date: 2003-08-10 Member: 19375Members
    So what are my options - I REALLY don't want to have to drop all the work I've done and switch over to FreeBSD/linux. Is there a way I could compile it myself for OpenBSD, or what? I just want to know if there is any alternative to just plain dropping OpenBSD.
  • verboseverbose Join Date: 2002-11-25 Member: 9968Members, Constellation
    I searched some mailing list archives, and did not find anything to suggest that OpenBSD has a linux-compatible proc filesystem you can mount. It's not clear that NS2.0 requires /proc, but mounting one enables us FreeBSD types to run NS2.0, and it's the only workaround/fix that I'm aware of.

    You could...install VMware on OpenBSD, run a FreeBSD virtual machine, and run the linux-compat stuff on top of that <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif'><!--endemo-->
  • SVisionsSVisions Join Date: 2003-08-10 Member: 19375Members
  • SVisionsSVisions Join Date: 2003-08-10 Member: 19375Members
    Just switched over to Linux, so I'm done with this, but let this be a warning to anyone who wants to run their server on OpenBSD <!--emo&:angry:--><img src='http://www.unknownworlds.com/forums/html/emoticons/mad.gif' border='0' style='vertical-align:middle' alt='mad.gif'><!--endemo-->
Sign In or Register to comment.