We moved this page to our Documentation Portal. You can find the latest updates here. |
Question
How to check what the recipe is executing on my Linux VS?
Answer
When executing recipes on a Linux based VS, we can check what commands are being executed or where the recipe has stuck by doing the following:
Identify the PID of the father process that started to executed the recipe and watch that PID.
1. Recipes always run under a session run by root and with no tty. In order to identify the PID of the father process for our recipe, find that process under your processes list:
[root@cpinstall ~]# ps aux | grep notty
root 887 0.0 0.1 97944 2992 ? Ss 12:51 0:00 sshd: root@notty
root 12964 0.0 0.0 103240 872 pts/0 R+ 13:11 0:00 grep notty
2. Once identified, watch the process using pstree. This will create a dynamic view of the process:
[root@cpinstall] watch -n1 "pstree -H 887"
init─┬─auditd───{auditd}
├─crond
├─master─┬─pickup
│ └─qmgr
├─6*[mingetty]
├─mysqld_safe───mysqld───10*[{mysqld}]
├─ntpd
├─rsyslogd───3*[{rsyslogd}]
├─snmpd
├─sshd───bash───pstree
├─sshd───bash───bash───onapp-cp-instal─┬─tee
│ └─yum───sh───rake───{rake}
├─sshd
└─udevd
As we can see,your process is executing sh───rake───{rake}, rake it's being executed. If you go back to your recipe, check the full command. Here is the one we were executing:
rake onapp:password[admin,root_password]
The correct command should have been:
rake onapp:password[admin,$root_password]
This is why the process was stuck.