-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprestart.sh
executable file
·25 lines (18 loc) · 1.02 KB
/
prestart.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/bash
# This script is executed by systemd before sueprvisord is started.
# See: https://github.com/Notifiarr/workers/blob/main/root/etc/systemd/system/supervisor.service.d/notifiarr.conf
set -e
PATH=/usr/bin
# Before starting supervisor, we create a symlink to the website config file for this server.
ln -sf "/share/websites/confs/server.$(hostname -s)" "/config/server.json"
# We also create a symlink to a server-specific log directory in shared storage.
ln -Tsf "/share/logs/notifiarr/supervisor/$(hostname -s)" "/config/log"
mkdir -p "/share/workers/$(hostname -s)/supervisor"
cp /share/workers/defaults/local.conf "/share/workers/$(hostname -s)/supervisor"
# This php script creates (builds) the supervisord configurations for this server.
if ! php /share/websites/www/notifiarr.com/supervisor/confBuilder.php; then
echo "The previous error is from confBuilder.php" >&2
exit 1
fi
# The files created by confBuilder.php go in this directory. Fix their ownership.
chown -R abc: "/share/workers/$(hostname -s)/supervisor"