Ns Files Messed Up

SVisionsSVisions Join Date: 2003-08-10 Member: 19375Members Posts: 58
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.

Turns out the ^M's weren't the problem, read the rest of the thread, or near the end.
Post edited by Unknown User on

Comments

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

    CODE

    cat server.cfg | sed 's/^M//g' > server.cfg.new


    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:

    CODE

    mv server.cfg.new server.cfg
    [NAPT]Vadakill

    NS Win32/Linux Server setup guides:
    http://www.vadakill.com/nsguides
  • SVisionsSVisions Join Date: 2003-08-10 Member: 19375Members Posts: 58
    I tried that, and I tried:

    CODE
    grep -v ^M server.cfg > server.cfg.new


    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 sad.gif
  • SVisionsSVisions Join Date: 2003-08-10 Member: 19375Members Posts: 58
    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 Posts: 58
    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 Posts: 681
    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).
    Pigeons. Pigeons...are good too. Sometimes, they come with notes attached. It's like a fortune cookie with wings. Squirrels!
  • SVisionsSVisions Join Date: 2003-08-10 Member: 19375Members Posts: 58
    edited August 2003
    Yeah I could just ignore them except I get this error when I try and load the ns server:

    CODE
    Memory fault (core dumped)


    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 Posts: 681
    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?
    Pigeons. Pigeons...are good too. Sometimes, they come with notes attached. It's like a fortune cookie with wings. Squirrels!
  • SVisionsSVisions Join Date: 2003-08-10 Member: 19375Members Posts: 58
    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:

    CODE
    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)


    So it happens when it loads the map.
  • verboseverbose Join Date: 2002-11-25 Member: 9968Members, Constellation Posts: 681
    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 gdb -q hlds hlds.core (adjust filename appropriately). The output should give a hint to why it crashed.
    Pigeons. Pigeons...are good too. Sometimes, they come with notes attached. It's like a fortune cookie with wings. Squirrels!
  • SVisionsSVisions Join Date: 2003-08-10 Member: 19375Members Posts: 58
    CODE
    -bash-2.05b$ gdb -q hlds hlds.core
    Core was generated by `hlds'.
    Program terminated with signal 11, Segmentation fault.
    #0  0x480b815d in ?? ()
  • verboseverbose Join Date: 2002-11-25 Member: 9968Members, Constellation Posts: 681
    eah, so that's no help. Distro?
    Pigeons. Pigeons...are good too. Sometimes, they come with notes attached. It's like a fortune cookie with wings. Squirrels!
  • SVisionsSVisions Join Date: 2003-08-10 Member: 19375Members Posts: 58
  • verboseverbose Join Date: 2002-11-25 Member: 9968Members, Constellation Posts: 681
    QUOTE (SVisions @ Aug 10 2003, 09:25 PM)
    OpenBSD 3.3

    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?
    Pigeons. Pigeons...are good too. Sometimes, they come with notes attached. It's like a fortune cookie with wings. Squirrels!
  • SVisionsSVisions Join Date: 2003-08-10 Member: 19375Members Posts: 58
    edited August 2003
    QUOTE (verbose @ Aug 10 2003, 08:40 PM)
    QUOTE (SVisions @ Aug 10 2003, 09:25 PM)
    OpenBSD 3.3

    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?

    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 Posts: 58
    edited August 2003
    QUOTE
    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.  Programs that will not work include those that
         use the Linux /proc filesystem (which is different from the optional
         OpenBSD /proc filesystem)
    , 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.


    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 Posts: 681
    QUOTE (SVisions @ Aug 10 2003, 09:56 PM)
    So I guess this means I'm screwed?

    I've already done what it said on the man page.

    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.
    Pigeons. Pigeons...are good too. Sometimes, they come with notes attached. It's like a fortune cookie with wings. Squirrels!
  • SVisionsSVisions Join Date: 2003-08-10 Member: 19375Members Posts: 58
    QUOTE (verbose @ Aug 10 2003, 09:11 PM)
    QUOTE (SVisions @ Aug 10 2003, 09:56 PM)
    So I guess this means I'm screwed?

    I've already done what it said on the man page.

    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.

    Read the part I set in bold of the man page quote.
  • verboseverbose Join Date: 2002-11-25 Member: 9968Members, Constellation Posts: 681
    QUOTE (SVisions @ Aug 10 2003, 10:13 PM)
    QUOTE (verbose @ Aug 10 2003, 09:11 PM)
    QUOTE (SVisions @ Aug 10 2003, 09:56 PM)
    So I guess this means I'm screwed?

    I've already done what it said on the man page.

    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.

    Read the part I set in bold of the man page quote.

    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.
    Pigeons. Pigeons...are good too. Sometimes, they come with notes attached. It's like a fortune cookie with wings. Squirrels!
  • SVisionsSVisions Join Date: 2003-08-10 Member: 19375Members Posts: 58
    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 Posts: 681
    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 tounge.gif
    Pigeons. Pigeons...are good too. Sometimes, they come with notes attached. It's like a fortune cookie with wings. Squirrels!
  • SVisionsSVisions Join Date: 2003-08-10 Member: 19375Members Posts: 58
  • SVisionsSVisions Join Date: 2003-08-10 Member: 19375Members Posts: 58
    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 mad.gif
Sign In or Register to comment.