Error when trying to run Tomcat7: cannot open terminal: unknow

April 26, 2017 2.1k views
Java Ubuntu 16.04

I'm trying to run tomcat 7 on ubuntu 16.04 but when I run "sudo service tomcat7 start" I get

Job for tomcat7.service failed because the control process exited with error code. See "systemctl status tomcat7.service" and "journalctl -xe" for details.

and if I run "systemctl status tomcat7.service" I get

jhon@mitutorweb:/etc/init.d$ systemctl status tomcat7.service
● tomcat7.service - LSB: Start Tomcat.
Loaded: loaded (/etc/init.d/tomcat7; bad; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2017-04-26 04:38:57 UTC; 4s ago
Docs: man:systemd-sysv-generator(8)
Process: 2012 ExecStart=/etc/init.d/tomcat7 start (code=exited, status=1/FAILURE)

Apr 26 04:38:57 mitutorweb systemd[1]: Starting LSB: Start Tomcat....
Apr 26 04:38:57 mitutorweb sudo[2019]: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/nano /etc/
Apr 26 04:38:57 mitutorweb sudo[2019]: pamunix(sudo:session): session opened for user root by (uid=0)
Apr 26 04:38:57 mitutorweb tomcat7[2012]: Error opening terminal: unknown.
Apr 26 04:38:57 mitutorweb sudo[2019]: pam
unix(sudo:session): session closed for user root
Apr 26 04:38:57 mitutorweb systemd[1]: tomcat7.service: Control process exited, code=exited status=1
Apr 26 04:38:57 mitutorweb systemd[1]: Failed to start LSB: Start Tomcat..
Apr 26 04:38:57 mitutorweb systemd[1]: tomcat7.service: Unit entered failed state.
Apr 26 04:38:57 mitutorweb systemd[1]: tomcat7.service: Failed with result 'exit-code'.
lines 1-15/15 (END)

I know it is related to the nano command but I don't know how solve it.
I hope you can help me.
Thanks in advance.

1 Answer

Sorry to see that your question hasn't received an answer yet. Unfortunately, after this much time, it is unlikely an answer for this specific question will be provided without more information. In general, the error Error opening terminal: unknown. is seen when attempting to run a program that requires interaction in an environment without access to a tty. Though I'm unsure why that would be the case here and would need to see /etc/init.d/tomcat7 to better understand what it is calling.

For people still landing here via search, check out this updated tutorial on getting Tomcat up and running on Ubuntu:

by Justin Ellingwood
Apache Tomcat is a web server and servlet container that is used to serve Java applications. Tomcat is an open source implementation of the Java Servlet and JavaServer Pages technologies, released by the Apache Software Foundation. This tutorial covers the basic installation...
Have another answer? Share your knowledge.