motd-news.service scheduled even when /etc/update-motd.d/50-motd-news is not executable
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
base-files (Ubuntu) |
Triaged
|
Low
|
Unassigned |
Bug Description
update-motd(5) says:
Executable scripts in /etc/update-
login, and this information is concatenated in /run/motd.dynamic. The order of script execu‐
tion is determined by the run-parts(8) --lsbsysinit option (basically alphabetical order, with
a few caveats).
So sysadmins are used to "chmod -x" motd fragments from /etc/update-motd.d/ to prevent their execution. When doing so for /etc/update-
systemd[3704]: motd-news.service: Failed to execute command: Permission denied
systemd[3704]: motd-news.service: Failed at step EXEC spawning /etc/update-
Permission denied
systemd[1]: motd-news.service: Main process exited, code=exited, status=203/EXEC
systemd[1]: motd-news.service: Failed with result 'exit-code'.
systemd[1]: Failed to start Message of the Day.
The motd-news.service unit looks like this:
$ systemctl cat motd-news.service
# /lib/systemd/
[Unit]
Description=Message of the Day
After=network-
Documentation=
[Service]
Type=oneshot
ExecStart=
This problem was observed on a Bionic system:
$ lsb_release -rd
Description: Ubuntu 18.04.1 LTS
Release: 18.04
$ apt-cache policy base-files
base-files:
Installed: 10.1ubuntu2.3
Candidate: 10.1ubuntu2.3
Version table:
*** 10.1ubuntu2.3 500
500 http://
100 /var/lib/
10.1ubuntu2.2 500
500 http://
10.1ubuntu2 500
500 http://
But the problem also exist in Disco.
tags: | added: bionic bitsize eoan |
tags: |
added: bitesize removed: bitsize |
Changed in base-files (Ubuntu): | |
importance: | Undecided → Low |
tags: | added: jammy kinetic lunar |
A possible fix would be to make the unit execution conditional to the update-motd fragment being executable:
[Unit] IsExecutable= /etc/update- motd.d/ 50-motd- news
ConditionFile
I'm not sure if this should be added to motd-news.service, motd-news.timer or both.