summaryrefslogtreecommitdiff
path: root/bin/mail_room
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2015-08-27 16:35:00 +0200
committerJacob Vosmaer <contact@jacobvosmaer.nl>2015-08-27 16:35:00 +0200
commit1081a322f1b846fcddb3cb77f068e2e818f9d73f (patch)
treea3c30c924469a1b28ca1bf5a1a6990915db89061 /bin/mail_room
parentabb5b9f6e526195c4eb027d5b7c28e070d9ac3c1 (diff)
downloadgitlab-ce-1081a322f1b846fcddb3cb77f068e2e818f9d73f.tar.gz
Properly daemonize the mail_room processimprove-mail_room-wrapper
The old invocation only worked by accident because we have a '&' somewhere in the init script for expediency. When ran from a terminal, the mail_room daemon process ended up in the session of the terminal. This commit adds a small wrapper that tries to do the textbook daemonization steps (double fork, setsid etc.) while also taking care that the pidfile is written before the 'start' process exits.
Diffstat (limited to 'bin/mail_room')
-rwxr-xr-xbin/mail_room4
1 files changed, 1 insertions, 3 deletions
diff --git a/bin/mail_room b/bin/mail_room
index f4f1a170c04..74a84f5b2b4 100755
--- a/bin/mail_room
+++ b/bin/mail_room
@@ -19,9 +19,7 @@ get_mail_room_pid()
start()
{
- bundle exec mail_room -q -c $mail_room_config >> $mail_room_logfile 2>&1 &
- PID=$!
- echo $PID > $mail_room_pidfile
+ bin/daemon_with_pidfile $mail_room_pidfile bundle exec mail_room -q -c $mail_room_config >> $mail_room_logfile 2>&1
}
stop()