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

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  Running the server
. . -> [Subject]  No ./startup directory? (nohup error)

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: No ./startup directory? (nohup error)
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1  2  3 4  

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Wed 16 Sep 2009 06:44 PM (UTC)  quote  ]
Message
Those are just warnings. It shouldn't cause any issues.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Gogoicarus   Japan  (15 posts)  [Biography] bio
Date Wed 16 Sep 2009 03:31 PM (UTC)  quote  ]
Message
yeah, i did my old default typing of nohup ./startup 4000 & almost on autopilot in the faint hope of it working. and it did. how puzzling.

now i'm getting some i3 errors from players logging in

Comm: Loading player data for: Nelren (10K)
Log: [*****] FILE: ../player/n/Nelren LINE: 155
Log: [*****] BUG: Fread_char: no match: i3perm
Log: [*****] FILE: ../player/n/Nelren LINE: 155
Log: [*****] BUG: Fread_char: no match: 1
Log: [*****] FILE: ../player/n/Nelren LINE: 156
Log: [*****] BUG: Fread_char: no match: i3flags
Log: [*****] FILE: ../player/n/Nelren LINE: 156
Log: [*****] BUG: Fread_char: no match: 256

but i know the reason for this: we removed i3 early on when moving to the new server, because we thought we didn't use it. i think it might have been causing some errors, too.

i don't recall ever editing i3, though...i'll tackle this more after i actually get some breakfast and do some real-life stuff.


Star wars 'is a good movie.'
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Wed 16 Sep 2009 03:28 PM (UTC)  quote  ]
Message
Chances are that you changed something, and then thought you changed it back or something, but didn't. It's easy to make mistakes like that when changing lots of things in lots of places over a very short period of time, when trying to get something to work.

Anyhow, you need to run your script in the background:

nohup ./startup &

the nohup says to not die when the terminal "hups" (hangs up) and the & at the end says to run in the background.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Gogoicarus   Japan  (15 posts)  [Biography] bio
Date Wed 16 Sep 2009 03:19 PM (UTC)  quote  ]
Message
o...kay...now the original script works just fine.

i deleted that troublesome space, converted it to unix, chmod'd it appropriately and now, for mysterious reasons unknown to me, it is suddenly working.

literally no changes have been made to it from the last time i reported on it not running.

could it be that startup was somehow conflicting with the non-running sabstartup? because editing sabstartup made the original startup work fine.

i am so utterly baffled.

Star wars 'is a good movie.'
[Go to top] top

Posted by Gogoicarus   Japan  (15 posts)  [Biography] bio
Date Wed 16 Sep 2009 03:09 PM (UTC)  quote  ]

Amended on Wed 16 Sep 2009 03:12 PM (UTC) by Gogoicarus

Message
woops. my bad.

the first script is the one my coder wrote, which i'd prefer to use.

i think we're on to something! my command prompt appears hung, but the MUD itself booted up and people can connect.

the problem now is that when i hit ctrl+c to bring back my prompt or close putty, it goes down again. i tried a nohup, but no dice.

but at least the startup script is running...so some headway is being made.

here's the edited script, in a code tag.


#!/bin/sh

####################################################
# Smaug startup script in bash                     #
# Written by Khtall for Sabrous                    #
# Functions the same as the normal startup script, #
# but it's written in bash, not csh.               #
####################################################

#Name of the shutdown logfile
shutdown='shutdown.txt'

#If a port number was provided ($1 has nonzero length)...
if [ -n "$1" ] 
then
  #Use the specified value
  port="$1"
else
  #Otherwise, use the default value
  port=4000
fi

#Because Smaug has to be run from the areas folder, move to it
cd "../area"

#If there is a leftover shutdown file from the last time Smaug was run...
if [ -e "$shutdown" ]
then
  #...then remove it to avoid confusion.
  rm -f "$shutdown"
fi

#Keep restarting Smaug if it dies unless it was deliberately shut down
while (true)
do
  
  #Keep trying logfile numbers until we find one that doesn't exist.
  #Start at 1000, for some reason the Smaug coders decided on.
  lognumber=1000
  logfile=../log/$lognumber.log
  while [ -e "$logfile" ]
  do
    lognumber=`expr $lognumber + 1`
    logfile=../log/$lognumber.log
  done
  
  #Append the time the MUD started up at to the log and boot files.
  date > "$logfile"
  date > "../area/boot.txt"
  
  #Check if Smaug is already running by checking if the selected port
  #is already bound.
  #matches=`netstat -an | grep ":$port " | grep -c LISTEN`
  #if [ "$matches" -ge 1 ]
  #then
    #Smaug is already running, or something else has that port.
    #echo Port $port is already in use.
    #echo Make sure that Smaug is not already running.
    #echo If it is not, make sure nothing else is using port $port.
    #We can't do anything, so exit the script
    #exit 0
  #fi
  
  #Run Smaug. Use nohup so that it keeps going even after a terminal logout.
  nohup ../src/smaug $port >&! $logfile
  
  #If we get here, Smaug has exited. Check if it was shut down, first:
  if [ -e "$shutdown" ]
  then
    #Smaug was shut down and should not be restarted.
    #Before we finish, remove the leftover shutdown file.
    rm -f $shutdown
    #Normal exit
    exit 0
  fi
  
  #Wait a moment to let old connections die.
  sleep 15
  
done

Star wars 'is a good movie.'
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Wed 16 Sep 2009 03:01 PM (UTC)  quote  ]
Message
Which startup file is which?

Try deleting this section, it's probably the one checking /proc/net/tcp:

#Check if Smaug is already running by checking if the selected port
#is already bound.
matches=`netstat -an | grep ":$port " | grep -c LISTEN`
if [ "$matches" -ge 1 ]
then
#Smaug is already running, or something else has that port.
echo Port $port is already in use.
echo Make sure that Smaug is not already running.
echo If it is not, make sure nothing else is using port $port.
#We can't do anything, so exit the script
exit 0
fi


(Also, the code tags are easier to read for that sort of thing than the quote tags.)
(EDIT: Among other things, the code tags let you preserve indentation of files; when I copy/pasted, I was left with the above without spaces.)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Gogoicarus   Japan  (15 posts)  [Biography] bio
Date Wed 16 Sep 2009 02:58 PM (UTC)  quote  ]
Message
here's the startup script:

Quote:

#!/bin/sh

####################################################
# Smaug startup script in bash #
# Written by Khtall for Sabrous #
# Functions the same as the normal startup script, #
# but it's written in bash, not csh. #
####################################################

#Name of the shutdown logfile
shutdown='shutdown.txt'

#If a port number was provided ($1 has nonzero length)...
if [ -n "$1" ]
then
#Use the specified value
port="$1"
else
#Otherwise, use the default value
port=4000
fi

#Because Smaug has to be run from the areas folder, move to it
cd "../area"

#If there is a leftover shutdown file from the last time Smaug was run...
if [ -e "$shutdown" ]
then
#...then remove it to avoid confusion.
rm -f "$shutdown"
fi

#Keep restarting Smaug if it dies unless it was deliberately shut down
while (true)
do

#Keep trying logfile numbers until we find one that doesn't exist.
#Start at 1000, for some reason the Smaug coders decided on.
lognumber=1000
logfile=../log/$lognumber.log
while [ -e "$logfile" ]
do
lognumber=`expr $lognumber + 1`
logfile=../log/$lognumber.log
done

#Append the time the MUD started up at to the log and boot files.
date > "$logfile"
date > "../area/boot.txt"

#Check if Smaug is already running by checking if the selected port
#is already bound.
matches=`netstat -an | grep ":$port " | grep -c LISTEN`
if [ "$matches" -ge 1 ]
then
#Smaug is already running, or something else has that port.
echo Port $port is already in use.
echo Make sure that Smaug is not already running.
echo If it is not, make sure nothing else is using port $port.
#We can't do anything, so exit the script
exit 0
fi

#Run Smaug. Use nohup so that it keeps going even after a terminal logout.
nohup ../src/smaug $port >&! $logfile

#If we get here, Smaug has exited. Check if it was shut down, first:
if [ -e "$shutdown" ]
then
#Smaug was shut down and should not be restarted.
#Before we finish, remove the leftover shutdown file.
rm -f $shutdown
#Normal exit
exit 0
fi

#Wait a moment to let old connections die.
sleep 15

done


and the old startup file

Quote:

#!/bin/tcsh

# Set the port number.
set port = 4000
if ( "$1" != "" ) set port="$1"

# Change to area directory.
cd ../area

# Set limits.
nohup
limit stacksize 1024k
limit coredumpsize unlimited
if ( -e shutdown.txt ) rm -f shutdown.txt

while ( 1 )
# If you want to have logs in a different directory,
# change the 'set logfile' line to reflect the directory name.
set index = 1000
while ( 1 )
set logfile = ../log/$index.log
if ( ! -e $logfile ) break
@ index++
end

# Record starting time
date > $logfile
date > ../area/boot.txt

# Run SMAUG.
# Check if already running
set matches = `netstat -an | grep ":$port " | grep -c LISTEN`
if ( $matches >= 1 ) then
# Already running
echo Port $port is already in use.
exit 0
endif
../src/smaug $port >&! $logfile

# Restart, giving old connections a chance to die.
if ( -e shutdown.txt ) then
rm -f shutdown.txt
exit 0
endif
sleep 15
end



i deleted the extra space, trying to run startup now...

nope, same deal.


sabrous@ps14248:~/src$ chmod u+x startup
sabrous@ps14248:~/src$ ./startup
: No such file or directory.
sabrous@ps14248:~/src$ dos2unix startup
sabrous@ps14248:~/src$ ./startup
/proc/net/tcp: Permission denied

same with sabstartup:

sabrous@ps14248:~/src$ chmod u+x sabstartup
sabrous@ps14248:~/src$ ./sabstartup
-bash: ./sabstartup: /bin/sh^M: bad interpreter: No such file or directory
sabrous@ps14248:~/src$ dos2unix sabstartup
sabrous@ps14248:~/src$ ./sabstartup
/proc/net/tcp: Permission denied


Star wars 'is a good movie.'
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Wed 16 Sep 2009 02:52 PM (UTC)  quote  ]
Message
Why is it trying to access /proc/net/tcp? What is your startup script doing?

By the way,
#! /bin/tcsh 

note the extra space in between the ! and the / -- that should not be there.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Gogoicarus   Japan  (15 posts)  [Biography] bio
Date Wed 16 Sep 2009 02:30 PM (UTC)  quote  ]

Amended on Wed 16 Sep 2009 02:39 PM (UTC) by Gogoicarus

Message
getting wild ideas in any attempt to progress at all.

sabrous@ps14248:~/src$ dos2unix sabstartup
sabrous@ps14248:~/src$ ./sabstartup
/proc/net/tcp: Permission denied

that's a NEW error. did my chmods reset?

sabrous@ps14248:~/src$ ls -l sabstartup
-rwxr-xr-x 1 sabrous pg501817 2229 Sep 16 07:28 sabstartup

looks the same as before...let's just set them to be sure?

sabrous@ps14248:~/src$ chmod u+x sabstartup
sabrous@ps14248:~/src$ ./sabstartup
/proc/net/tcp: Permission denied

okay so ...having read around this is maybe because i'm not in my root directory? WHATEVER YOU SAY, SERVER.


sabrous@ps14248:~$ ./src/sabstartup
./src/sabstartup: line 24: cd: ../area: No such file or directory
./src/sabstartup: line 48: ../log/1000.log: No such file or directory
./src/sabstartup: line 49: ../area/boot.txt: No such file or directory
/proc/net/tcp: Permission denied

now you really got me. the area folder DOES exist, there's no boot.txt in the area folder or 1000.log in the logs folder, but should that really matter? not to mention, permission still denied?

what is going ON?


Star wars 'is a good movie.'
[Go to top] top

Posted by Gogoicarus   Japan  (15 posts)  [Biography] bio
Date Wed 16 Sep 2009 02:17 PM (UTC)  quote  ]
Message
just to be 100% clear, I CAN run the MUD by going into the area directory and running smaug. she starts right up, in that case.

It just seems an extremely unreliable and ghetto way of running a MUD...I'd like my freakin' startup script!

Star wars 'is a good movie.'
[Go to top] top

Posted by Gogoicarus   Japan  (15 posts)  [Biography] bio
Date Wed 16 Sep 2009 01:49 PM (UTC)  quote  ]

Amended on Wed 16 Sep 2009 02:20 PM (UTC) by Gogoicarus

Message
Sorry to revive a dead topic, but I'm lost and have a similar problem.

When I try to run startup, with or without nohup, I'm told the directory doesn't exist.

sabrous@ps14248:~/src$ ./startup
: No such file or directory.

Just like everyone else here... Despite the fact that I do have tcsh installed on the server, it didn't help at all. Here's the first lines of the startup...

#! /bin/tcsh

# Set the port number.
set port = 4000
if ( "$1" != "" ) set port="$1"

Nothing out of the ordinary, no? Well, in an effort to stem the frustration that's plagueing us, someone coded a new startup file using bash. here's the first lines of that...

#!/bin/sh

####################################################
# Smaug startup script in bash #
# Written by Khtall for Sabrous #
# Functions the same as the normal startup script, #
# but it's written in bash, not csh. #
####################################################

#Name of the shutdown logfile
shutdown='shutdown.txt'

only when i try to run THAT, i get...

sabrous@ps14248:~/src$ ./sabstartup
-bash: ./sabstartup: /bin/sh^M: bad interpreter: No such file or directory
sabrous@ps14248:~/src$

what the hell. i've chmoded everything, and the server is adamant that it's 100% not their fault. but i can't think what on earth else it could be. the file works fine when tested on the offline version of the MUD. just not on the freakin server! HELP!


here's the ls -l of both files, in case it helps at all...

sabrous@ps14248:~/src$ ls -l startup
-rwxr--r-- 1 sabrous pg501817 1036 Sep 15 16:14 startup

sabrous@ps14248:~/src$ ls -l sabstartup
-rwxr-xr-x 1 sabrous pg501817 2308 Sep 16 05:50 sabstartup


after having checked out this post:
http://www.gammon.com.au/forum/?id=2322

i wonder if maybe the files are in DOS format? I did download them to a windows machine from the old server, and did edit them on my windows machine before re-uploading to the new server.

i tried to do a quick fix in vi in case this was the problem , but after inputting :1,$s/^M//g the pattern was not found. So, I'm guessing conversion ISN'T my problem.

so frustrated right now.

Star wars 'is a good movie.'
[Go to top] top

Posted by Tseris   (98 posts)  [Biography] bio
Date Sat 13 Oct 2007 08:12 AM (UTC)  quote  ]
Message
Yes. Yes. Yes. Yes. Yes. Thank you guys so much. That was exactly it. Installed, compiled, started up, and running. Bang!
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Sat 13 Oct 2007 06:50 AM (UTC)  quote  ]
Message
Open a terminal, and type:

sudo apt-get install zlib1g-dev

you'll have to enter your password.

After that, you'll have the zlib development libraries and should be able to compile your source code.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Sat 13 Oct 2007 01:45 AM (UTC)  quote  ]
Message
You don't have the zlib package, you need that.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Tseris   (98 posts)  [Biography] bio
Date Sat 13 Oct 2007 12:42 AM (UTC)  quote  ]
Message
Latest attempt:

zach@Animus:~/Desktop/smaugfuss/src$ make
make -s smaug
Compiling o/comm.o....
In file included from comm.c:30:
mccp.h:18:18: error: zlib.h: No such file or directory
mccp.h:33: error: ISO C++ forbids declaration of ‘z_stream’ with no type
mccp.h:33: error: expected ‘;’ before ‘*’ token
comm.c: In function ‘bool write_to_descriptor(DESCRIPTOR_DATA*, char*, int)’:
comm.c:1639: error: ‘struct mccp_data’ has no member named ‘out_compress’
comm.c:1641: error: ‘struct mccp_data’ has no member named ‘out_compress’
comm.c:1642: error: ‘struct mccp_data’ has no member named ‘out_compress’
comm.c:1644: error: ‘struct mccp_data’ has no member named ‘out_compress’
comm.c:1646: error: ‘struct mccp_data’ has no member named ‘out_compress’
comm.c:1647: error: ‘struct mccp_data’ has no member named ‘out_compress’
comm.c:1649: error: ‘struct mccp_data’ has no member named ‘out_compress’
comm.c:1651: error: ‘struct mccp_data’ has no member named ‘out_compress’
comm.c:1651: error: ‘Z_SYNC_FLUSH’ was not declared in this scope
comm.c:1651: error: ‘deflate’ was not declared in this scope
comm.c:1653: error: ‘Z_OK’ was not declared in this scope
comm.c:1657: error: ‘struct mccp_data’ has no member named ‘out_compress’
comm.c:1695: error: ‘struct mccp_data’ has no member named ‘out_compress’
make[1]: *** [o/comm.o] Error 1
make: *** [all] Error 2
[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.


13,856 views.

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

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]