Uploaded image for project: 'JBoss Web Server'
  1. JBoss Web Server
  2. JWS-666

[RHEL 7 RPM] TOMCAT_USER variable ignored

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • JWS 5.0_RHEL DR1
    • JWS 3.1.0 CR7
    • rpm, tomcat
    • None
    • Release Notes
    • Hide
      The `__TOMCAT_USER__` and `__TOMCAT_GROUP__` environment variables defined in the sysconfig and tomcat configuration files have been deprecated in favor of the `_User_` and `_Group_` variables within the systemd service unit ([filename]`/usr/lib/systemd/system/tomcat.service`).
      Show
      The `__TOMCAT_USER__` and `__TOMCAT_GROUP__` environment variables defined in the sysconfig and tomcat configuration files have been deprecated in favor of the `_User_` and `_Group_` variables within the systemd service unit ([filename]`/usr/lib/systemd/system/tomcat.service`).
    • Documented as Resolved Issue
    • Workaround Exists
    • Hide

      In order to update the user/group owner of the tomcat processes with the new systemd service unit on RHEL 7 users will need to update the User and/or Group properties of the service unit (/usr/lib/systemd/system/tomcat7.service and/or /usr/lib/systemd/system/tomcat8.service) rather than the sysconfig or tomcat conf files.

      Show
      In order to update the user/group owner of the tomcat processes with the new systemd service unit on RHEL 7 users will need to update the User and/or Group properties of the service unit (/usr/lib/systemd/system/tomcat7.service and/or /usr/lib/systemd/system/tomcat8.service) rather than the sysconfig or tomcat conf files.

    Description

      The following is an excerpt from /usr/share/tomcat8/conf/tomcat8.conf showing that TOMCAT_USER is configured there:

      # What user should run tomcat
      TOMCAT_USER="tomcat"
      

      However, this is quite misinforming as updating TOMCAT_USER or TOMCAT_GROUP has no effect on the service. This is because the service unit (/usr/lib/systemd/system/tomcat8.service) explicitly configures the User/Group which owns the service:

      [Service]
      ...
      User=tomcat
      Group=tomcat
      ...
      

      This is done because using environment variables in the systemd unit does not work by design (they only work when used with ExecStart/ExecStop and a couple other directives, read more here).

      Attachments

        Issue Links

          Activity

            People

              rhn-support-csutherl Coty Sutherland
              bsikora Bogdan Sikora (Inactive)
              Jan Onderka Jan Onderka
              Tyler Kelly Tyler Kelly (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: