Public bug reported:

**Ubuntu release:** 26.04 (Resolute)

**Package versions:**

* jetty9: 9.4.58-1
* rsyslog: 8.2512.0-1ubuntu4

### Summary

The `jetty9` package installs an rsyslog rule that writes Jetty logs to
`/var/log/jetty9/jetty-console.log`, but the service unit also uses
`LogsDirectory=jetty9`. As a result, systemd changes the ownership of
`/var/log/jetty9` to `jetty:jetty`, while `rsyslog` runs as the `syslog`
user and therefore cannot create the log file.

### Expected result

The default installation should work without any manual configuration.

The rsyslog rule installed by the `jetty9` package should be able to
create and write `/var/log/jetty9/jetty-console.log`.

### Actual result

`/var/log/jetty9/jetty-console.log` is never created.

`strace` shows that `rsyslogd` repeatedly attempts to open the file but
receives:

```
openat("/var/log/jetty9/jetty-console.log", ...) = -1 EACCES (Permission denied)
```

`rsyslogd` is running as:

```
User:  syslog
Group: syslog
Supplementary groups: adm
```

The directory permissions after Jetty starts are:

```
drwxr-x--- jetty:jetty /var/log/jetty9
```

Therefore the `syslog` user cannot create new files inside that
directory.

### Investigation

The package installs the following rsyslog configuration:

```
/etc/rsyslog.d/jetty9.conf

:programname, startswith, "jetty9" {
    /var/log/jetty9/jetty-console.log
    stop
}
```

The package also installs the following systemd unit:

```
LogsDirectory=jetty9
User=jetty
Group=jetty
LogsDirectoryMode=750
```

According to the `systemd.exec` documentation, `LogsDirectory=`
recursively adjusts the ownership of the managed directory to match
`User=` and `Group=`.

This behavior was confirmed experimentally.

The package's `postinst` script sets:

```
chown -Rh jetty:adm /var/log/jetty9
```

However, immediately after the service starts, the ownership becomes:

```
jetty:jetty
```

showing that the change is performed by systemd rather than by the
maintainer script.

### Additional experiment

To verify that rsyslog itself is functioning correctly, the destination
was temporarily changed to a directory owned by `syslog`:

```
/var/log/testsyslog/
```

with ownership:

```
syslog:syslog
```

After only changing the destination path, `rsyslog` immediately created
the log file and successfully wrote Jetty log messages.

This demonstrates that the failure is not caused by rsyslog itself, but
by the ownership of `/var/log/jetty9`.

### Conclusion

The package currently installs two default configurations that are
incompatible with each other:

* the rsyslog rule expects `rsyslog` to be able to create files inside 
`/var/log/jetty9`;
* the systemd unit configures `LogsDirectory=jetty9`, which makes that 
directory writable only by `jetty`.

As a result, the default installation cannot produce `jetty-console.log`
without manual intervention.

ProblemType: Bug
DistroRelease: Ubuntu 26.04
Package: jetty9 9.4.58-1
ProcVersionSignature: Ubuntu 7.0.0-27.27-generic 7.0.6
Uname: Linux 7.0.0-27-generic x86_64
ApportVersion: 2.34.0-0ubuntu2
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: KDE
Date: Thu Jul  2 12:54:27 2026
InstallationDate: Installed on 2022-09-26 (1375 days ago)
InstallationMedia: Kubuntu 22.04.1 LTS "Jammy Jellyfish" - Release amd64 
(20220809.1)
PackageArchitecture: all
SourcePackage: jetty9
UpgradeStatus: Upgraded to resolute on 2026-05-19 (44 days ago)

** Affects: jetty9 (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug resolute wayland-session

** Attachment added: "Bug evidence"
   
https://bugs.launchpad.net/bugs/2158988/+attachment/5979925/+files/ubuntu-26.04-jetty9-9.4.58-1-bug-report-evidence.log

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2158988

Title:
  jetty9: LogsDirectory ownership prevents rsyslog from creating jetty-
  console.log

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/jetty9/+bug/2158988/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to