SystemD too early + Rocket.Chat snap doesn't work


I was trying to set up a mail server and managed to considerably screw up my server while trying. An interesting problem is now happening though: Whenever I start the server, the snap (which was working fine before) doesn’t load, and I have found this is most likely because it is starting too early in the boot process and crashing. I had a custom Gitea instance, which also was working just fine when it got screwed up and was starting too early.

I temporarily fixed the Gitea instance by adding the following line to the service file: RestartSec=10

However, I couldn’t figure out where Snap keeps its service file (or, at least, how to properly modify it). How can I modify the service file to insert a line like above OR could you help me figure out why SystemD is starting everything too early now?

If it is of any use, the script I used was . I am searching it for SystemD changes…

Update: You can’t load Rocket.Chat anymore over port 3000. I can start manually with ‘snap run rocketchat-server’, and don’t see any errors immediately, but it doesn’t work anymore when manually ran. You can’t connect to port 3000. :frowning:

Maybe I just need to spin up a new cloud server and try again.

This just sounds like you have installed an application which uses port 3000 and starts before rocket chat can claim that port?

Interestingly, netstat reports that ‘node’ is using port 3000. Which is Rocket.Chat.

However, I can’t connect to rocketchat, even when I use the IP address. The Firewall is deactivated, and DigitalOcean has port 3000 open. Not to mention it worked before I ran the script.

If I can’t fix it, I will spin up a new server (would like to try to avoid that though).

I also can’t figure out why Gitea was also starting too early. I put in that “restart every 10 seconds” instruction and that fixed it. Again, pre-script… fine.

I couldn’t find too many systemd instructions in the script. Maybe a package… I will keep looking. I can’t find any modified SystemD config files though, yet.