Request: Linux NWNW2 help
#1
Posté 22 juin 2012 - 11:46
start a new screen
cd/nordock/awakening
./nwnstartup.sh
detach from the screen
log out
But I am new to Linux and not sure how to add a startup script.
2. I am looking for a way from in game to activate my nwnx2 restart script. Normally from the command line I
screen -x
exit
This would on shut down fire my startup script but I am looking for the best way to do this from in game.
Thanks so much!
#2
Posté 23 juin 2012 - 03:19
http://social.biowar.../1/subindex/156
#3
Posté 23 juin 2012 - 06:19
#4
Posté 23 juin 2012 - 09:06
i have a similar setup - i run nwnstartup.sh from a screen session. here's how i do it from boot:
su - nwn -c "/nwn/dalakora/start-startup > /tmp/logfile" &
so that it runs as user "nwn".
then, i have for "start-startup":
screen -A -d -m -S nwn1 ./wrapper.sh
the "-d" makes it launch in detached mode (because there will be no tty associated with it at boot time).
and then my wrapper script just starts my nwnstartup.sh.
honestly though, i think that startup script has only run like once or twice. the linux server jsut doesn't crash:
[nwn@dalakora dalakora]$ uptime
16:06:19 up 731 days, 22:40, 3 users, load average: 1.74, 1.57, 1.52
Modifié par acomputerdood, 23 juin 2012 - 09:09 .
#5
Posté 24 juin 2012 - 08:09
screen -A -d -m -S nwn1 ./wrapper.sh
so that it executes on boot?
#6
Posté 24 juin 2012 - 09:57
http://jonathonhill....-ubuntu-server/
At least I believe it is working as it was posting to log.boot with an error until I fixed it.
But the other scripts are not working. Here is what I have
awakening_on_boot.sh:
su - awakening -c "/nordock/awakening/start-startup > /tmp/logfile" &
start-startup.sh (located at /nordock/awakening/start-startup.sh)
screen -A -d -m -S nwn1 ./wrapper.sh
wrapper.sh (located at /nordock/awakening/wrapper.sh)
./nwnstartup.sh
But when I look for a screen in terminal it does not find any.
Modifié par nwnsmith, 24 juin 2012 - 09:58 .
#7
Posté 24 juin 2012 - 11:12
nwnsmith wrote...
Okay, I got the script to fire at boot by following the instructions here.
http://jonathonhill....-ubuntu-server/
At least I believe it is working as it was posting to log.boot with an error until I fixed it.
great!
But the other scripts are not working. Here is what I have
awakening_on_boot.sh:
su - awakening -c "/nordock/awakening/start-startup > /tmp/logfile" &
start-startup.sh (located at /nordock/awakening/start-startup.sh)
screen -A -d -m -S nwn1 ./wrapper.sh
i'm guessing that this is the problem right here. your "awakening_on_boot.sh tries to run the command "start-startup" but your screen is launched from a file called "start-startup.sh". they're not the same thing. you'll either have to modify the "awakening_on_boot.sh" to launch "start-startup.sh" or change the name of "start-startup.sh" to be "start-startup".
if you do a:
$ cat /tmp/logfile
(where "$" is the system prompt, not something you type in) it should give a clue as to what the problem was.
#8
Posté 24 juin 2012 - 11:36
Thanks for any help!
#9
Posté 25 juin 2012 - 09:45
awakening_on_boot.sh:
ubuntu didn't like using "su" and prefers sudo instead, and then it was choking on my earlier use of "> /tmp/logfile" redirect.#!/bin/sh
sudo -u awakening -c "/nordock/awakening/start-startup" &
start-startup.sh:
#!/bin/sh
screen -A -d -m -S awakening1 bash -c '/nordock/awakening/wrapper.sh; exec bash'
screen wanted the command run in a shell, which i'm a little confused about because wrapper.sh should already have been launching it in a shell. but i digress and bear with me here.
wrapper.sh:
this puts your nwnstartup.sh into a while loop, meaning you can kill the nwn server and it will automatically restart it when it dies. your can remove the while loop if you want it to die and stay dead.#!/bin/sh
while true
do
/nordock/awakening/nwnstartup.sh
done
then, just make sure you have done a "chmod 755" on all the files to make them executable.
Modifié par acomputerdood, 25 juin 2012 - 09:46 .





Retour en haut






