-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.sh
executable file
·41 lines (34 loc) · 1.08 KB
/
run.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
echo "Mounting USB devices..."
mount -t devtmpfs none /dev
#re-trigger udev to recognize new devices and set udev rules properly
udevadm trigger
#make app owner
chown -R app:app /usr/src/app
chown -R app:app /data
echo "Starting subprocesses..."
supervisord -n -c /etc/supervisor/supervisord.conf
#sanebd drops priviliges itself, so no need for gosu here (doesn't work anyways...)
# gosu app bash -c ' \
# SANE_CONFIG_DIR=/usr/local/etc/scanbd /usr/local/sbin/scanbd -f -c /usr/local/etc/scanbd/scanbd.conf & \
# redis-server --save "" --appendonly no & \
# sidekiq -c 10 -r /usr/src/app/boot.rb & \
# sidekiq -c 4 -q ocr -r /usr/src/app/boot.rb'
#
# dumb-init bash -c 'SANE_CONFIG_DIR=/usr/local/etc/scanbd /usr/local/sbin/scanbd -f -c /usr/local/etc/scanbd/scanbd.conf' & \
# gosu app bash -c 'redis-server --save "" --appendonly no & \
# sidekiq -c 10 -r /usr/src/app/boot.rb & \
# sidekiq -c 4 -q ocr -r /usr/src/app/boot.rb'
# cleanup ()
# {
# kill -s SIGTERM $!
# exit 0
# }
#
# trap cleanup SIGINT SIGTERM
#
# while [ 1 ]
# do
# sleep 60 &
# wait $!
# done