I was trying to setup Jenkins web app inside the Tomcat server and it continuously gave me this error:
SEVERE: Failed to initialize Jenkins
hudson.util.NoHomeDir
This I fixed by creating the folder ‘/usr/share/tomcat7/.jenkins’
mkdir /usr/share/tomcat7/.jenkins
On redeploying Jenkins I again noticed the following error.
WARNING: Failed to record boot attempts
java.io.FileNotFoundException: /usr/share/tomcat7/.jenkins/failed-boot-attempts.txt (Permission denied)
I fixed this issue by giving full access to this folder.
sudo chmod 777 /usr/share/tomcat7/.jenkins
I believe 777 is not a good approach in a production environment, but for development perspective it looks ok.