Forums WoW Modding Support Archives Azerothcore Discord Archives [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` ?

[DiscordArchive] So finally, it's only about adding the `after` line to my regular services in `systemd` ?

Pages (4): Previous 1 2 3 4 Next
rektbyfaith
Administrator
0
05-17-2022, 04:51 PM
#21
Archived author: Revision • Posted: 2022-05-17T16:51:41.399000+00:00
Original source

My crontab that runs every sunday, I use two different lines of course.
```
0 5 * * 0 screen -S world -p 0 -X stuff "server shutdown 3600^m" >/dev/null 2>&1
5 6 * * 0 cd /root && ./azerothcore.sh both all >/dev/null 2>&1
```

It'll send "server shutdown 3600" to the console at 5 AM and at 6:05 AM it'll run my stop/update/start script.
rektbyfaith
05-17-2022, 04:51 PM #21

Archived author: Revision • Posted: 2022-05-17T16:51:41.399000+00:00
Original source

My crontab that runs every sunday, I use two different lines of course.
```
0 5 * * 0 screen -S world -p 0 -X stuff "server shutdown 3600^m" >/dev/null 2>&1
5 6 * * 0 cd /root && ./azerothcore.sh both all >/dev/null 2>&1
```

It'll send "server shutdown 3600" to the console at 5 AM and at 6:05 AM it'll run my stop/update/start script.

rektbyfaith
Administrator
0
05-17-2022, 05:28 PM
#22
Archived author: Ruderalis • Posted: 2022-05-17T17:28:25.776000+00:00
Original source

Here is the stop script I just made :
`#!/bin/bash
LOG_FILE="/home/northrend/TheLegendaryKingdom/tlk-server.log"
WORLDSERVER_SHUTDOWN_DELAY=0

### Paramétrage du délai
if [[ $1 > 0 ]]; then
WORLDSERVER_SHUTDOWN_DELAY=$1
fi

### Arrêt du serveur (world)
echo "`date` LoA > Shutting down worldserver..." | tee -a $LOG_FILE
su northrend -c "/usr/bin/screen -S loa-world -X stuff \"server shutdown $WORLDSERVER_SHUTDOWN_DELAY\\r\""
su northrend -c "screen -x loa-world"
echo "`date` LoA > Done." | tee -a $LOG_FILE

### Arrêt des services
echo "`date` LoA > Stopping world service..." | tee -a $LOG_FILE
systemctl stop loa-auth loa-world | tee -a $LOG_FILE
echo "`date` TLK > Switch > Done." | tee -a $LOG_FILE`
rektbyfaith
05-17-2022, 05:28 PM #22

Archived author: Ruderalis • Posted: 2022-05-17T17:28:25.776000+00:00
Original source

Here is the stop script I just made :
`#!/bin/bash
LOG_FILE="/home/northrend/TheLegendaryKingdom/tlk-server.log"
WORLDSERVER_SHUTDOWN_DELAY=0

### Paramétrage du délai
if [[ $1 > 0 ]]; then
WORLDSERVER_SHUTDOWN_DELAY=$1
fi

### Arrêt du serveur (world)
echo "`date` LoA > Shutting down worldserver..." | tee -a $LOG_FILE
su northrend -c "/usr/bin/screen -S loa-world -X stuff \"server shutdown $WORLDSERVER_SHUTDOWN_DELAY\\r\""
su northrend -c "screen -x loa-world"
echo "`date` LoA > Done." | tee -a $LOG_FILE

### Arrêt des services
echo "`date` LoA > Stopping world service..." | tee -a $LOG_FILE
systemctl stop loa-auth loa-world | tee -a $LOG_FILE
echo "`date` TLK > Switch > Done." | tee -a $LOG_FILE`

rektbyfaith
Administrator
0
05-17-2022, 05:45 PM
#23
Archived author: Revision • Posted: 2022-05-17T17:45:04.978000+00:00
Original source

The script will kill the server instantly
rektbyfaith
05-17-2022, 05:45 PM #23

Archived author: Revision • Posted: 2022-05-17T17:45:04.978000+00:00
Original source

The script will kill the server instantly

rektbyfaith
Administrator
0
05-17-2022, 05:45 PM
#24
Archived author: Revision • Posted: 2022-05-17T17:45:13.585000+00:00
Original source

It doesn't stop and wait for the countdown to end
rektbyfaith
05-17-2022, 05:45 PM #24

Archived author: Revision • Posted: 2022-05-17T17:45:13.585000+00:00
Original source

It doesn't stop and wait for the countdown to end

rektbyfaith
Administrator
0
05-17-2022, 05:47 PM
#25
Archived author: Revision • Posted: 2022-05-17T17:47:59.280000+00:00
Original source

I just realized you're using `-x` and not `-X`, but I'm not sure why you're attaching to the screen at all.
rektbyfaith
05-17-2022, 05:47 PM #25

Archived author: Revision • Posted: 2022-05-17T17:47:59.280000+00:00
Original source

I just realized you're using `-x` and not `-X`, but I'm not sure why you're attaching to the screen at all.

rektbyfaith
Administrator
0
05-17-2022, 05:54 PM
#26
Archived author: Ruderalis • Posted: 2022-05-17T17:54:21.332000+00:00
Original source

I attached to the screen because while it's attached, it does not continue proceeding the script. It will only continue when it leaves the screen, so when the worldserver is shutdown
rektbyfaith
05-17-2022, 05:54 PM #26

Archived author: Ruderalis • Posted: 2022-05-17T17:54:21.332000+00:00
Original source

I attached to the screen because while it's attached, it does not continue proceeding the script. It will only continue when it leaves the screen, so when the worldserver is shutdown

rektbyfaith
Administrator
0
05-17-2022, 05:54 PM
#27
Archived author: Ruderalis • Posted: 2022-05-17T17:54:57.137000+00:00
Original source

But I already rewrote it a bit, this was only to watch it and be sure to handle the delay correctly
rektbyfaith
05-17-2022, 05:54 PM #27

Archived author: Ruderalis • Posted: 2022-05-17T17:54:57.137000+00:00
Original source

But I already rewrote it a bit, this was only to watch it and be sure to handle the delay correctly

rektbyfaith
Administrator
0
05-17-2022, 05:55 PM
#28
Archived author: Ruderalis • Posted: 2022-05-17T17:55:17.483000+00:00
Original source

`#!/bin/bash
LOG_FILE="/home/northrend/TheLegendaryKingdom/tlk-server.log"
WORLDSERVER_SHUTDOWN_DELAY=0

### Paramétrage du délai
if [[ $1 > 0 ]]; then
WORLDSERVER_SHUTDOWN_DELAY=$1
fi

### Arrêt du serveur (world)
if [[ $WORLDSERVER_SHUTDOWN_DELAY > 0 ]];
then
echo "`date` LoA > Shutting down worldserver (delay: $WORLDSERVER_SHUTDOWN_DELAY sec)..." | tee -a $LOG_FILE
else
echo "`date` LoA > Shutting down worldserver..." | tee -a $LOG_FILE
fi
su northrend -c "/usr/bin/screen -S loa-world -X stuff \"server shutdown $WORLDSERVER_SHUTDOWN_DELAY\\r\""
while [[ $(pgrep "worldserver") != "" ]]; do
sleep 1s
done
echo "`date` LoA > Done." | tee -a $LOG_FILE

### Arrêt des services
echo "`date` LoA > Stopping services..." | tee -a $LOG_FILE
systemctl stop loa-auth loa-world | tee -a $LOG_FILE
echo "`date` LoA > Done." | tee -a $LOG_FILE
`
rektbyfaith
05-17-2022, 05:55 PM #28

Archived author: Ruderalis • Posted: 2022-05-17T17:55:17.483000+00:00
Original source

`#!/bin/bash
LOG_FILE="/home/northrend/TheLegendaryKingdom/tlk-server.log"
WORLDSERVER_SHUTDOWN_DELAY=0

### Paramétrage du délai
if [[ $1 > 0 ]]; then
WORLDSERVER_SHUTDOWN_DELAY=$1
fi

### Arrêt du serveur (world)
if [[ $WORLDSERVER_SHUTDOWN_DELAY > 0 ]];
then
echo "`date` LoA > Shutting down worldserver (delay: $WORLDSERVER_SHUTDOWN_DELAY sec)..." | tee -a $LOG_FILE
else
echo "`date` LoA > Shutting down worldserver..." | tee -a $LOG_FILE
fi
su northrend -c "/usr/bin/screen -S loa-world -X stuff \"server shutdown $WORLDSERVER_SHUTDOWN_DELAY\\r\""
while [[ $(pgrep "worldserver") != "" ]]; do
sleep 1s
done
echo "`date` LoA > Done." | tee -a $LOG_FILE

### Arrêt des services
echo "`date` LoA > Stopping services..." | tee -a $LOG_FILE
systemctl stop loa-auth loa-world | tee -a $LOG_FILE
echo "`date` LoA > Done." | tee -a $LOG_FILE
`

rektbyfaith
Administrator
0
05-17-2022, 05:58 PM
#29
Archived author: Revision • Posted: 2022-05-17T17:58:41.988000+00:00
Original source

You can use a parameter rather than changing the script if you want the ability to quickly change the delay
rektbyfaith
05-17-2022, 05:58 PM #29

Archived author: Revision • Posted: 2022-05-17T17:58:41.988000+00:00
Original source

You can use a parameter rather than changing the script if you want the ability to quickly change the delay

rektbyfaith
Administrator
0
05-17-2022, 05:58 PM
#30
Archived author: Revision • Posted: 2022-05-17T17:58:56.843000+00:00
Original source

never
rektbyfaith
05-17-2022, 05:58 PM #30

Archived author: Revision • Posted: 2022-05-17T17:58:56.843000+00:00
Original source

never

Pages (4): Previous 1 2 3 4 Next
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)