Trying to Load Evennia at Boot (raspberry pi)

49 views
Skip to first unread message

shadowbug

unread,
Nov 25, 2020, 2:43:48 PM11/25/20
to Evennia
Hey everyone,

I had rasp pi 3B laying around that I never got around to using and decided to try on learn linux/coding/etc with it.  I saw Evennia a couple months ago and thought it would be great to setup my own server.  Everything installed and runs well, but now I want to have it run right at boot.  

I thought editing the /etc/rc.local file would easiest way but I can't seem to figure it out.  I also went and tried making a little shell script that the rc.local file would point to and still no luck.  If I boot first and then run my script everything will load fine; but if I run it from the rc.local file the virtualenv doesnt seem to activate, as the prompt never changes; the server will load, but I can't get it stop.

Shell code (mudstart.sh)
#!/bin/bash

. /home/pi/muddev/evenv/bin/activate
evennia start --gamedir /home/pi/muddev/NewGame+

rc.local added line
. /home/pi/muddev/mudstart.sh &

(NewGame+ is the name of the game) If anyone has an answer it would be greatly appreciated.  Thanks.

Vincent Le Goff

unread,
Nov 26, 2020, 6:24:58 AM11/26/20
to eve...@googlegroups.com

Hi,

It's a detail, maybe, but I would recommend not activating the Python environment.  If you just need it to launch Evennia, simply change the Path to Python:

Replace:

. /home/pi/muddev/evenv/bin/activate
evennia start --gamedir /home/pi/muddev/NewGame+

By:

/home/pi/muddev/evenv/bin/evennia start --gamedir /home/pi/muddev/NewGame+

(Not sure why the ! but that's another thing).  I'm not saying it makes any difference, but I wouldn't activate the virtual environment in a script.

In practice I tend to use screen to run Evennia in it.  I prefer that, it's quite independent of login and it keeps track of several consoles.  But that's another story.

HTH,

Vincent (vincent-lg)

--
You received this message because you are subscribed to the Google Groups "Evennia" group.
To unsubscribe from this group and stop receiving emails from it, send an email to evennia+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/evennia/63ebcb9d-9ee3-4eec-963e-7fab544db0aan%40googlegroups.com.

Quilnux

unread,
Feb 13, 2021, 9:35:04 AM2/13/21
to Evennia
Another option might be to use crontab which will run after the system has fully booted (I've seen edge cases where rc.local runs before the system is completely booted up). Use the @reboot flag in place of the time data in your crontab file:

@reboot /home/pi/muddev/evenv/bin/evennia start --gamedir /home/pi/muddev/NewGame+

That might help. I use crontab for "after-boot" jobs mostly. rc tends to be used mostly during boot staging.
Reply all
Reply to author
Forward
0 new messages