Graceful restart from NUX environment

Posted by DarkFurion on Mon 04 Mar 2013 09:39 PM — 7 posts, 29,250 views.

#0
Hello Everyone, hello Nick.

I've been hired as a sysadm on an Italian mud that runs smaug.

I've been prompted with a request about doing a scheduled restart of the mud every night.

The quick n dirty solution is to kill the mud and start it again.

I'd like to implement a way to emulate the wiz "shutdown mud now" command, issuing it from a crontab shell.

Is there a way to insert commands into the mud's command buffer from the unix shell?

Thanks in advance,

Furion
Australia Forum Administrator #1
You should be able to write a tiny "client" that connects to the server with an admin login / password and then issues the shutdown command. Run that each night.

Here is some example code:

http://www.gammon.com.au/forum/bbshowpost.php?id=2206

Instead of waiting for keyboard input you could simply send a shutdown after the client had logged in for 10 seconds.
#2
Thanks for your feedback Nick, i'll try that tonight.
#3
I've been working with the code, i'm at the point where, if i launch the client manually, it will show me the mud, the automatic input will be fired and the mud will be rebooted correctly.

I enclosed the executable inside a sheel that launches it but, when, through crontab, the whole process is started, the function "sendit(s, msg)" won't fire the messages, the mud remains on the initial splash (initial_string isn't enough to pass through the login process)

Any suggestions?

do i have to remove the whole part of the keyboard input loop?
Australia Forum Administrator #4
I think I would remove the part that reads the keyboard, as that may fail in a batch file without any input in it.
Australia Forum Administrator #5
I tried something like this but without success:


telnet <ip address> <port> << EOF
nick   <-- player name
foo    <-- password

shutdown mud now
quit
EOF


There must be a way of doing something like that.

You could have MUSHclient running on your PC, and have a timer set to connect to the MUD, and then shut it down, every day.
#6
I'll try to mash with the code a bit and see if i get a nice solution to post up here, so if anyone might need it, it would be available.