Skip to content

Commit 2129076

Browse files
committed
push pieces around
1 parent 99e6f0f commit 2129076

File tree

6 files changed

+24
-14
lines changed

6 files changed

+24
-14
lines changed

after-install.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,24 @@
22

33
# This is the postinst deb package script. It runs after the package contents are installed.
44

5+
set -e
6+
57
if [ -d ~abc/.ssh ]; then
68
chown -R abc: ~abc/.ssh
79
fi
810

9-
if [ -d /var/log/workers ]; then
11+
if [ -d "/var/log/workers" ]; then
1012
chown -R abc: /var/log/workers
1113
fi
1214

15+
if [ -d "/etc/supervisor/conf.d" ]; then
16+
rm -rf /etc/supervisor/conf.d
17+
fi
18+
1319
if [ -x "/bin/systemctl" ]; then
1420
/bin/systemctl daemon-reload
15-
fi
1621

17-
rm -rf /etc/supervisor/conf.d
22+
if [ -d "/share/websites/www" ]; then
23+
/bin/systemctl restart supervisor
24+
fi
25+
fi

before-install.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# This is the preinst deb package script. It runs before the package is installed.
44

5+
set -e
6+
57
# Make a user and group for this app, but only if it does not already exist.
68
groupadd --force --non-unique --gid 1001 abc
79
id abc >/dev/null 2>&1 || \

before-remove.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ if [ "$1" = "upgrade" ] || [ "$1" = "1" ] ; then
66
exit 0
77
fi
88

9-
if [ -x "/bin/systemctl" ]; then
10-
/bin/systemctl stop supervisor 2>/dev/null
11-
fi
12-
139
# Put this back.
1410
if [ -d /etc/supervisor ]; then
15-
rm -f /etc/supervisor/conf.d 2>/dev/null
16-
mkdir /etc/supervisor/conf.d 2>/dev/null
11+
rm -f /etc/supervisor/conf.d
12+
mkdir /etc/supervisor/conf.d
13+
fi
14+
15+
if [ -x "/bin/systemctl" ]; then
16+
/bin/systemctl stop supervisor
1717
fi

build.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ read -r -d '' PACKAGE_ARGS <<- PACKAGE_ARGS
5252
--vendor='${VENDOR}'
5353
PACKAGE_ARGS
5454

55-
mkdir -p root/var/log/workers
55+
mkdir -p root/var/log/workers root/config
56+
ln -sf /var/log/workers root/config/log
57+
ln -sf /share/websites/www root/config/www
58+
5659
rm -f ${PACKAGE_NAME}_${VERSION}-${ITERATION}_amd64.deb
5760
echo fpm -s dir -t deb ${PACKAGE_ARGS} ${DEPENDS} -a amd64 -v ${VERSION} -C root/
5861
eval fpm -s dir -t deb ${PACKAGE_ARGS} ${DEPENDS} -a amd64 -v ${VERSION} -C root/

root/etc/sudoers.d/workers

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
abc ALL=(ALL) NOPASSWD: /usr/bin/systemctl restart supervisor
1+
abc ALL=(root) NOPASSWD: /usr/bin/systemctl restart supervisor
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# Before starting supervisor, we create a symlinks to the Notifiarr-specific files for this server.
22
# Those files live in a folder with this server's name, so create a dynamic symlink to reach them at a known path.
33
[Service]
4-
ExecStartPre=/usr/bin/mkdir -p /config
5-
ExecStartPre=/usr/bin/ln -sf /var/log/workers /config/log
6-
ExecStartPre=/usr/bin/ln -sf /share/websites/www /config/www
74
ExecStartPre=/bin/bash -c 'ln -sf "/share/workers/$(hostname -s)/supervisor/" "/etc/supervisor/conf.d"'
85
ExecStartPre=/bin/bash -c 'ln -sf "/share/websites/confs/server.$(hostname -s)" "/config/server.json"'

0 commit comments

Comments
 (0)