[DiscordArchive] So finally, it's only about adding the `after` line to my regular services in `systemd` ?
[DiscordArchive] So finally, it's only about adding the `after` line to my regular services in `systemd` ?
Archived author: Ruderalis • Posted: 2022-05-17T16:14:45.664000+00:00
Original source
So finally, it's only about adding the `after` line to my regular services in `systemd` ?
Archived author: Ruderalis • Posted: 2022-05-17T16:15:00.574000+00:00
Original source
Then reloading the whole thing of course
Archived author: Revision • Posted: 2022-05-17T16:15:13.637000+00:00
Original source
Yes, it should force it to wait for mysql to be running before starting. I say it should because it's supposed to, but I don't guarantee it's success.
Archived author: Ruderalis • Posted: 2022-05-17T16:16:04.638000+00:00
Original source
Okay, thanks a lot for the tip then
Archived author: Ruderalis • Posted: 2022-05-17T16:17:02.177000+00:00
Original source
If it doesn't work, the service will still restart after a few seconds, this until db is up.
Archived author: Revision • Posted: 2022-05-17T16:18:16.321000+00:00
Original source
The idea is to make it wait until the database is up and running. I don't use a service myself since my server never restarts unless I need it to, and I manually start the script which also auto-restarts the server if it crashes, so I have only used services for my DHCP server etc which obviously isn't quite the same.
Archived author: Ruderalis • Posted: 2022-05-17T16:20:34.048000+00:00
Original source
Yeah that makes sense. I remember using screen based scripts before I switched to services, it worked pretty damn well but I thought it was hacky and I imagined it could mess performances
Archived author: Revision • Posted: 2022-05-17T16:21:34.392000+00:00
Original source
There isn't really much that is hacky when it comes to Linux, unless you really go far out there.
Archived author: Ruderalis • Posted: 2022-05-17T16:22:35.923000+00:00
Original source
Yeah, I was litterally telling myself "dude, in some ways linux IS hacky itself" but that's because I don't know much of it (x
Archived author: Revision • Posted: 2022-05-17T16:22:51.075000+00:00
Original source
```
#!/bin/bash
while :; do
./worldserver
if [[ $? == 0 ]]; then
break
fi
sleep 5
done
```
That's my world.sh script, which will restart if it crashes but not if I run .server shutdown/restart. Not hacky.