[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  Running the server
. . -> [Subject]  Running smaug using a different port

Running smaug using a different port

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Pages: 1 2  

Posted by Sejshark   (4 posts)  [Biography] bio
Date Fri 17 Jan 2003 02:39 PM (UTC)
Message
I am trying to run the server on another port, per the documentation I have found on this site, (ie. smaug.exe 6000), but I only get the following help message and the server does not come up. What is the problem? Any help is appreciated!

SMAUG 1.4a
Usage is :-
SMAUG - runs as a service, or stand-alone
SMAUG /run - runs stand-alone
SMAUG /start - starts this service
SMAUG /stop - stops this service
SMAUG /install - installs this service
SMAUG /remove - removes (un-installs) this service
SMAUG /status - displays the status of this service
SMAUG /help - displays this information
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Sat 18 Jan 2003 05:48 AM (UTC)
Message
The server you download here is designed to run on port 4000, and the messages are because you can choose various options when starting it, like do you want to install a service or not.

There is no easy way to pass a port number through to a service, because the service starts at PC boot time.

A way around this is to recompile the code, changing the number 4000 in the source to something else.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Kris   USA  (198 posts)  [Biography] bio
Date Reply #2 on Sat 18 Jan 2003 09:58 PM (UTC)
Message
I'd just like to throw-in the option of not running smaug as a service, but stand-alone instead. True, you've got the inconvenience of having to manually start the mud when windows boots, but that's no big deal really. I, for example, don't run my mud as a service.

Try creating a file in your dist directory named '<your mud name>.bat' (i.e. in my case 'aethia.bat'). Here is a very simple example of what the contents would be:

@ECHO OFF
:mudloop
ECHO LOADING <mud name>........
CD C:\
CD \<smaug dir>\DIST\AREA
..\SRC\SMAUG.EXE 6000
ECHO THE MUD IS REBOOTING!!
GOTO mudloop


This way, you can run it as a stand-alone with ease, and if the mud reboots or crashes, it will actually reboot (rather than the program simply terminating). If you wanna make it even easier, create a windows shortcut to your .bat file, and stick that shortcut in the 'Startup' folder of your Windows Start Menu. That way, you have pretty much the same effects of the service, except you won't have to recompile to run on a different port, and it'll just sit in your taskbar instead of that little area by the clock (don't remember what it's called hehe; actually don't know if the smaug service actually put it there or not, tho I think most windows services do).

Just an alternative suggestion, based on what I do. Nick's suggestion works too tho =)
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Sat 18 Jan 2003 10:45 PM (UTC)
Message
Kris's suggestion won't work with the precompiled exe because it doesn't take the port number as an argument. However it will work with the Cygwin version. In that case you can also run as a daemon (detached, like a service) by simply appending an ampersand to the execute command. eg.

cd ../area
../src/smaug 6000 &


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Boborak   USA  (228 posts)  [Biography] bio
Date Reply #4 on Sat 18 Jan 2003 11:12 PM (UTC)
Message
Nicks suggestion would also work on a *nix based sever (besides Cygwin). Keep in mind the terminal or connection must remain open or the process will shut down. This can pose problems for people who remotely connect to their server. To get around this, use nohup (which doesn't attach the process to a terminal)

an example:

cd ../area
nohup ../src/smaug 6000 &

Most shell scripts used for starting the mud utilize nohup automatically, however if your particular script does not, use something like this.

nohup ./startup &
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Sun 19 Jan 2003 02:32 AM (UTC)
Message
Actually I thought the latest Cygwin did support the & option. I don't have mine with me right now so I can't prove it. As for nohup, that is interesting - I didn't know that.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Boborak   USA  (228 posts)  [Biography] bio
Date Reply #6 on Sun 19 Jan 2003 03:29 AM (UTC)
Message
Cygwin does support the & option, but I don't believe it supports nohup, because if you close Cygwin the server will shut down anyway.
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #7 on Sun 19 Jan 2003 05:08 AM (UTC)
Message
You mean close the shell window that started the service? Perhaps, although I haven't seen it do that.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Boborak   USA  (228 posts)  [Biography] bio
Date Reply #8 on Sun 19 Jan 2003 06:11 AM (UTC)
Message
Err.. maybe I got on a different page.. but when I said that closing the shell window would kill the service I was reffering to a native *nix environment or a remote connection to such an environment. In all honesty my knowledge of Cygwin is very limited as I much rather prefer the real thing (as I imagine anyone who uses *nix on a daily basis would) Sorry for any confusion on my part.
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #9 on Sun 19 Jan 2003 10:20 AM (UTC)
Message
This is probably a minor point, however in my experience closing the initiating window, even under *nix, does not stop any daemons started by that window. Here is an example, in this case Mac OS/X which is based on FreeBSD.

Start up smaug:

../src/smaug

Put in background:

^Z
[1]+ Stopped ../src/smaug
bash-2.05a$ bg
[1]+ ../src/smaug &

Check it is still running ...

bash-2.05a$ ps waux | grep smaug
nick 436 0.0 0.6 7864 4736 p2 S 9:03AM 1:12.03 ../src/smaug

Log out the initiating process ...

bash-2.05a$ logout
[Process completed]

From a different process check it is still running ...

bash-2.05a$ ps waux | grep smaug
nick 436 0.0 0.6 7864 4736 p2- S 9:03AM 1:12.06 ../src/smaug



- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Boborak   USA  (228 posts)  [Biography] bio
Date Reply #10 on Mon 20 Jan 2003 01:43 AM (UTC)
Message
I stand corrected. I probably should have did my homework first. I have learned that having the processes shut down upon closing a terminal, happens to be the by-product of a configuration choice of mine. I use essentially the same configuration on every distro I've ever used, so this would lead me to believe that it affects every distro I have ever used ;-) Thanks for pointing that out.
[Go to top] top

Posted by Sejshark   (4 posts)  [Biography] bio
Date Reply #11 on Mon 20 Jan 2003 08:09 PM (UTC)

Amended on Mon 20 Jan 2003 08:12 PM (UTC) by Sejshark

Message
Apparently I do not have the Cygwin version as you spoke of...because It won't accept a port number from the command line at all.

I am using the version I downloaded here on a win2000 server. I am trying to run it straight from a windows command line with the same results. (just the help screen displaying)

I tried:
..\SRC\SMAUG.EXE 6000
and
..\SRC\SMAUG.EXE 6000 &
as suggested.

Do I have the Cygwin version that accepts a port number?

If not, how can I get it?

Is recompling my only option?

Is so, I don't have a compiler for this, from where can I download one?

My suggestion would be to put code in the smaug to read a file, ie. PORT.TXT, to read in the desired port number. That way you could pass the port number even if run as a service. I would also want it to work using any port number and not be restricted to any specific ports.
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #12 on Mon 20 Jan 2003 09:13 PM (UTC)

Amended on Tue 20 Nov 2007 04:23 AM (UTC) by Nick Gammon

Message
I don't have the Cygwin executable on this site, because you need a fairly large cygwin.dll file to support it. I suppose it would be possible to put both there.

You may find such an executable at www.smaug.org (see their ftp area).

Yes, recompiling is the only option if you use the file from this site.

For more details about compiling including getting the compiler, see:

http://www.gammon.com.au/smaug/howtocompile.htm


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Sejshark   (4 posts)  [Biography] bio
Date Reply #13 on Tue 21 Jan 2003 05:37 PM (UTC)
Message
I was having trouble downloading the compiler. I'll have to try again later.

Is the source and the compiler going to work on windows 2000?
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #14 on Wed 22 Jan 2003 02:19 AM (UTC)

Amended on Thu 23 Jan 2003 09:28 PM (UTC) by Nick Gammon

Message
Should work on all versions of Windows, probably excepting 1, 2, and 3.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


42,566 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]