Linux guide error...

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

User avatar
meanvel
Posts: 129
Joined: 19 Jan 2017, 14:06

Linux guide error...

Postby meanvel » 04 Mar 2017, 05:43

This doesn't correctly configure SmartFox to start on server boot... Please fix this documentation.
http://docs2x.smartfoxserver.com/Gettin ... stallation

Code: Select all

ln -s /home/*user*/SmartFoxServer_2X/SFS2X/sfs2x-service S99sfs2X


It looks like it also needs the "start" command issued to the service. When I manually run the link, that is what it says. I guess ill have to create a .sh script and have the script run the start command.
Image
Attachments
doesntStart.png
(25.89 KiB) Not downloaded yet
User avatar
meanvel
Posts: 129
Joined: 19 Jan 2017, 14:06

Re: Linux guide error...

Postby meanvel » 04 Mar 2017, 06:16

The workaround is to link to this .sh script instead. It may need execute permissions set.

startSfs2X.sh

Code: Select all

exec /home/SmartFoxServer_2X/SFS2X/sfs2x-service start


Update: What the heck... This will work manually if I just do "./S99sfs2X" on the link to the .sh script in the rc5.d folder... But it won't run on reboot. I checked and the server run level is 5... What could it be?
User avatar
meanvel
Posts: 129
Joined: 19 Jan 2017, 14:06

Re: Linux guide error...

Postby meanvel » 04 Mar 2017, 08:25

Still working on it... Tried to install it as a service in systemd... No luck there... Going to try cron next.

I just need it to start on boot! Not manually, gahhh...

Code: Select all

[Unit]
Description=SmartFoxServer 2X
After=network.target

[Service]
Type=simple
User=root
WorkingDirectory=/home/SmartFoxServer_2X/SFS2X
ExecStart=/home/SmartFoxServer_2X/SFS2X/sfs2x-service
Restart=on-abort

[Install]
WantedBy=multi-user.target
User avatar
meanvel
Posts: 129
Joined: 19 Jan 2017, 14:06

Re: Linux guide error...

Postby meanvel » 04 Mar 2017, 08:41

Finally... Kind of a hacky solution, but this works. I would prefer to be able to install smartFox as a service into systemd which will monitor it and restart it in the event of a crash/etc...

Image
Attachments
workingNow.png
(16.69 KiB) Not downloaded yet
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Linux guide error...

Postby Lapo » 04 Mar 2017, 08:48

Hi,
we'll look into it.

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
meanvel
Posts: 129
Joined: 19 Jan 2017, 14:06

Re: Linux guide error...

Postby meanvel » 04 Mar 2017, 09:03

Here is the exact server software version... It should not have taken me a three hours to get simple startup on boot working, lol... Ubuntu is what you recommend.

Image
Attachments
server.png
(7.27 KiB) Not downloaded yet
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Linux guide error...

Postby Lapo » 04 Mar 2017, 15:14

Yes, though Ubuntu has switched from init to systemd and we haven't looked into it yet.
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
meanvel
Posts: 129
Joined: 19 Jan 2017, 14:06

Re: Linux guide error...

Postby meanvel » 04 Mar 2017, 20:52

Lapo wrote:Yes, though Ubuntu has switched from init to systemd and we haven't looked into it yet.


Cool, well whenever you guys get around to it, systemd integration should be simple... I think my bottom example is "pretty close" to all you need. I just missed something somewhere... I am definitely not a system admin. I use to pay $100 support tickets on Joyent when I needed a simple extension like Amf-C installed.

//smartFoxServer2X.service - Goes in /etc/systemd/system/
//Activate on reboot with "systemctl enable smartFoxServer2X.service"

Code: Select all

[Unit]
Description=SmartFoxServer 2X
After=network.target

[Service]
Type=simple
User=root
WorkingDirectory=/home/SmartFoxServer_2X/SFS2X
ExecStart=/home/SmartFoxServer_2X/SFS2X/sfs2x-service
Restart=on-abort

[Install]
WantedBy=multi-user.target
menrix
Posts: 1
Joined: 04 May 2017, 08:28

Re: Linux guide error...

Postby menrix » 04 May 2017, 08:42

While instalilng the SmartFoxServer software on a new Debian-based server, I was looking into the systemd issue as well. I used the config provided by meanvel and modified it a bit. I also created a new system user smartfox to avoid running the service with root privileges. I placed the file smartfox.service in /lib/systemd/system/ and then activated the service (systemctl enable smartfox.service). So far, it seems to be working fine.

Here is my config:

Code: Select all

[Unit]
Description=SmartFoxServer 2X
After=network.target

[Service]
Type=forking
User=smartfox
WorkingDirectory=/opt/SmartFoxServer_2X/SFS2X
ExecStart=/opt/SmartFoxServer_2X/SFS2X/sfs2x-service start
ExecStop=/opt/SmartFoxServer_2X/SFS2X/sfs2x-service stop
Restart=on-abort

[Install]
WantedBy=multi-user.target
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Linux guide error...

Postby Lapo » 04 May 2017, 08:49

Thanks for reporting.
We're in the process of reviewing and updating several sections of the docs. We'll make sure to update the "install-as-daemon" section in the Linux doc as well.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Stevenor and 68 guests