Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ Running the server
➜ Graceful restart from NUX environment
Graceful restart from NUX environment
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| DarkFurion
(4 posts) Bio
|
Date
| Mon 04 Mar 2013 09:39 PM (UTC) |
Message
| 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 | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #1 on Tue 05 Mar 2013 02:55 AM (UTC) |
Message
| 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. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| DarkFurion
(4 posts) Bio
|
Date
| Reply #2 on Tue 05 Mar 2013 10:14 AM (UTC) |
Message
| Thanks for your feedback Nick, i'll try that tonight. | Top |
|
Posted by
| DarkFurion
(4 posts) Bio
|
Date
| Reply #3 on Thu 07 Mar 2013 01:07 PM (UTC) |
Message
| 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?
| Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #4 on Thu 07 Mar 2013 09:13 PM (UTC) |
Message
| I think I would remove the part that reads the keyboard, as that may fail in a batch file without any input in it. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #5 on Thu 07 Mar 2013 09:15 PM (UTC) |
Message
| 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. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| DarkFurion
(4 posts) Bio
|
Date
| Reply #6 on Fri 08 Mar 2013 01:29 PM (UTC) |
Message
| 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. | 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.
22,507 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top