Change font size
It is currently Thu Sep 24, 2020 3:19 am

Forum rules


{L_IMAGE}
Please only post about software that directly relates to opensim, thank you.



Post a new topicPost a reply Page 1 of 1   [ 2 posts ]
Author Message
 Post subject: Running open simulator as a daemon/service on startup
PostPosted: Tue Aug 04, 2020 5:43 pm 

Joined: Sat Jul 25, 2020 11:43 pm
Posts: 13
Location: Dallas, TX
Now that I've got open simulator running on CentOS 8.2 using the opensim.sh script from the command line, I'd like to move to having it run as a normal service so it starts up when the server boots and runs 24/7. Normally there'd be a systemctl unit in /etc/systemd that starts and stops the service but I don't see one included in the opensim tarball. I did find a page on the open simulator wiki that shows some old-style SysV init files:

http://opensimulator.org/wiki/Startup_script_linux

But most modern linux distros are using systemd rather than SysV. Assuming the info on that wiki page is still valid for the current version of opensim, I can probably cobble together a systemctl unit but if anyone out there has already made a working one, I'd love to save the time.


Top
 Profile  
 
 Post subject: Re: Running open simulator as a daemon/service on startup
PostPosted: Fri Aug 07, 2020 3:41 pm 

Joined: Sat Jul 25, 2020 11:43 pm
Posts: 13
Location: Dallas, TX
I didn't get any feedback on this so I took a shot at it and came up with this for a systemd opensim.service unit file:

{L_CODE}:
[Unit]
Description=OpenSimulator service
After=network.target

[Service]
User=opensim
Group=opensim
Type=simple
LimitSTACK=1048576
TimeoutStopSec=60
WorkingDirectory=/opt/opensim/bin
ExecStart=/usr/bin/mono --server /opt/opensim/bin/OpenSim.exe

[Install]
WantedBy=multi-user.target


I had to create an "opensim" user (no login and no password). I dropped the opensim dir from the tar ball into /opt and set the user/group. So far, it seems to be working. I can start/stop it with systemctl and enable or disable the service to start automatically when the server boots. I think this should work on any recent CentOS, RHEL, or Fedora GNU/Linux distro.

I just took a wild guess on the Type and TimeoutStopSec values. If anyone has any suggestions for tweaks, let me know. Once I have an opensim wiki account, I'll add it to Linux startup script page.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 2 posts ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net