Infos:
- Used Zammad version: 2.0.0
- Used Zammad installation source: source
- Operating system: Debian x86
Running the concatenated commands directly in bash prompt to run the Ruby server and startup scripts is pretty straightforward.
However I wanted to simplify the process of running Zammad for my less experienced in Linux colleague, and wrapped the run command(s) into alias. It does run the software but doesn’t return to to bash.
After some research I found the only related SO question, but unfortunately the top-voted answers didn’t help either.
Expected behavior:
Bash alias/function ‘zammad’ runs Zammad, outputs background jobs IDs and returns to bash prompt:
zammad@helpdesk:~$ zammad
[1] 3321
[2] 3322
[3] 3323
zammad@helpdesk:~$
Actual behavior:
Bash alias/function ‘zammad’ runs Zammad, produces no output, moves cursor to the new line, allowing user input:
zammad@helpdesk:~$ zammad
It stays in this state indefinitely, until ^C^C or ^Z is sent to the stdin.
Steps to reproduce the behavior:
- Add either alias or function named ‘zammad’ to .bashrc:
alias zammad='bundle exec rails s -p 3000 &>> log/zammad.log & bundle exec script/websocket-server.rb start &>> log/zammad.log & bundle exec script/scheduler.rb start &>> log/zammad.log &'
function zammad() {
bundle exec rails s -p 3000 &>> log/zammad.log &
bundle exec script/websocket-server.rb start &>> log/zammad.log &
bundle exec script/scheduler.rb start &>> log/zammad.log &
}
- Initialize alias/function by executing
source .bashrc
- Run the alias/function
I cannot figure out why wrapping the exact same command(s) into alias or function changes the behavior so much. Please advise.