I have a redmine script in /etc/init.d/ folder which was working fine before I broke the ruby and rails packages link. Then I played with ruby gems and finally fixed the broken links. Then I tried to restart redmine script, But strangely, I got the below error
sudo service redmine stop
Shutting down redmine: /etc/init.d/redmine: line 49: killproc: command not found
user@studio:~$ sudo service redmine start
Starting redmine: /etc/init.d/redmine: /usr/local/bin/bundle: /usr/local/bin/ruby: bad interpreter: No such file or directory
/etc/init.d/redmine: line 35: echo_failure: command not found
My question has two answers, telemark already given answer for my 2nd problem ( ie, I had broken ruby links ). I solved path issues by uninstalling all ruby, rails and gem packages and reinstalled using apt repository. using rvm, chruby, etc everything failed when I switch between users. So I thought of going with the system ruby installation, relying on apt. Fortunately brightbox comes to the rescue.
Using brightbox and apt solved my path issues.
Then, /etc/init.d/functions, this was missing. It says, No such file or directory. I searched in google and found this link
I just copy pasted to /etc/init/functions and given execute permission
sudo chmod a+x /etc/init.d/functions
I forgot to mention one important thing, some functions like
log_progress_message, etc are not available in functions file. So it's better to include
. /lib/lsb/init-functions file.